Recently in the study of discuz! But I just can't figure out how he loaded the discuz.htm template after inputting 127.0.0.1/forum.php. Remember this post must be reasonable, not dry, otherwise it is not to give points, this back to the points but many ah. 100 min
Array (' Announcements ', ' onlinelist ', ' forumlinks ', ' heats ', ' historyposts ', ' Onlinerecord ', ' userstats ', ' Diytemplatenameforum '), ' forumdisplay ' = = Array (' smilies ', ' announcements_forum ', ' globalstick ', ' forums ', ' Onlinelist ', ' Forumstick ', ' threadtable_info ', ' threadtableids ', ' stamps ', ' diytemplatenameforum '), ' viewthread ' = > Array (' smilies ', ' smileytypes ', ' forums ', ' usergroups ', ' stamps ', ' bbcodes ', ' smilies ', ' custominfo ', ' Groupicon ', ' Stamps ', ' threadtableids ', ' threadtable_info ', ' posttable_info ', ' diytemplatenameforum '), ' redirect ' = = Array (' Threadtableids ', ' threadtable_info ', ' posttable_info '), ' post ' = = Array (' Bbcodes_display ', ' bbcodes ', ' Smileycodes ', ' smilies ', ' smileytypes ', ' domainwhitelist ', ' albumcategory '), ' space ' = = Array (' fields_required ', ' Fields_optional ', ' custominfo '), ' group ' = = Array (' GroupType ', ' Diytemplatenamegroup '), $mod =!in_array (C::app () ->var[' mod '], $modarray)? ' Index ': C::app ()->var[' mod '];d efine (' Curmodule ', $mod); $cachelist = Array ();if (Isset ($modcachelist [Curmodule])) {$cachelist = $modcachelist [Curmodule]; $cachelist [] = ' plugin '; $cachelist [] = ' Pluginlanguage_system ';} if (C::app ()->var[' mod '] = = ' Group ') {$_g[' basescript '] = ' group ';} C::app ()->cachelist = $cachelist; C::app ()->init (); Loadforum (); Set_rssauth (); Runhooks (); $navtitle = Str_replace (' {bbname} ', $_g[' setting '] [' Bbname '], $_g[' setting ' [' Seotitle '] [' Forum ']), $_g[' setting ' [' threadhidethreshold '] = 1;require discuz_root. '. /source/module/forum/forum_ '. $mod. php ';? >
Reply to discussion (solution)
In the above code there is no logical discuz this variable exists, so I just wonder why he can load it
$mod =!in_array (C::app ()->var[' mod '), $modarray)? ' Index ': C::app ()->var[' mod ');
No mod parameter is mod=index;
You'll find forum_index.php when you get to/source/module/forum.
This is the background file of the homepage
In the last include template (' Diy:forum/discuz: '. $gid);
is to introduce discuz.html.
The truth is, it can't be dry.
$mod =!in_array (C::app ()->var[' mod '), $modarray)? ' Index ': C::app ()->var[' mod ');
No mod parameter is mod=index;
You'll find forum_index.php when you get to/source/module/forum.
This is the background file of the homepage
In the last include template (' Diy:forum/discuz: '. $gid);
is to introduce discuz.html.
Well, you really understand, you can certainly get points, but I have a question, can you answer it? $mod =!in_array (C::app ()->var[' mod '), $modarray)? ' Index ': C::app ()->var[' mod '); in the sentence "C::app ()->var[' mod ')" I don't understand that the double colon here is a static method in a class, right? What is it? As a static method, how does the app () come from? I searched for the var array. No, I don't understand. I'm sure I'll give you a break. Cheat you puppy.
Class C: source/class/class_core.php, at the bottom of the file, inherits the core class, on top of this file, called the C::creatapp () on top of the core class; This static method uses the Discuz_application:: Instance ();
Discuz_application class: Source/class/discuz/discuz_application.php, this class is the core class, all the portal file calls is actually it, which defines the $var array, and there is a sentence $this- >var = & $_g, I think $_g don't know, so $_g[' mod ' can also get mod parameter values