The Arcive of vBulletin Modifications Site. |
|
|
#1
|
|||
|
|||
|
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');
}
|
|
#2
|
||||
|
||||
|
that's not bad at all
![]() although i'm not sure about question 7, is that the vBglobal.php you're requiring? |
|
#3
|
|||
|
|||
|
7 is vbportal which i have now abandoned all that !defined in portal area is gone now
good addon but i dont have the patience to do all the work to make it work like i want ill just add 10 individual hacks to replace its funcionability
|
|
#4
|
||||
|
||||
|
good luck
|
![]() |
|
|
| X vBulletin 3.8.12 by vBS Debug Information | |
|---|---|
|
|
More Information |
|
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|