The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
|
#1
|
|||
|
|||
Some code in my phpinclude_start - how would you rewrite this code?
Am I doing this the most efficient and proper way? I don't trust myself much :nervous:
It works but perhaps it's noobish? Can u tell me how to make it more correct? I'm mostly referring to stuff like changing some things to OR, AND, ELSE and combing it into one statement or whatever. Will doing so make it parse faster and more effieciently? Code:
// question 1 if (!defined('IN_PORTAL_AREA')) { // question 2 if (THIS_SCRIPT == 'index') { // do something $lifetime_posts = $DB_site->query_first("SELECT post.postid FROM " . TABLE_PREFIX . "post AS post ORDER BY post.postid DESC LIMIT 1"); $lifetime_threads = $DB_site->query_first("SELECT thread.threadid FROM " . TABLE_PREFIX . "thread AS thread ORDER BY thread.threadid DESC LIMIT 1"); } // question 3 if (THIS_SCRIPT == 'index' OR THIS_SCRIPT == 'forumdisplay') { // do something $forumcounts= $DB_site->query("SELECT forumid, replycount, threadcount FROM " . TABLE_PREFIX . "forum "); while ($forumcount = $DB_site->fetch_array($forumcounts)) { $forumreply[$forumcount[forumid]] = $forumcount[replycount]; $forumthread[$forumcount[forumid]] = $forumcount[threadcount]; } } // question 4 if ($bbuserinfo['userid'] != 1) { // question 5 if (THIS_SCRIPT == 'adv_index') { // do something include("./forums/statistic_counter.php"); } // question 6 if (THIS_SCRIPT == 'index') { // do something include("./statistic_counter.php"); } } // question 7 if (defined('IN_PORTAL_AREA')) { // do something require_once('./global.php'); } |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|