Version: 1.00, by Xenon
Developer Last Online: Oct 2023
Version: 2.2.x
Rating:
Released: 12-19-2002
Last Update: Never
Installs: 94
No support by the author.
Ok, what this Hack does is it reduces the ammount of queries on forumhome by caching the moderatorlist and by optimizing most of the queries used on index.php
I'd really appreciate getting feedback how it reduces serverload on greater boards
On an unhacked vb index.php (pm enabled accesmask disabled) it reduces the ammount of queries from 19 to 15
my experiments have shown, that the queries are faster than the normal ones, too....
Show Your Support
This modification may not be copied, reproduced or published elsewhere without author's permission.
I have the "user online today" hack installed and that cause not being able to install the hack. even when I remove it I cant do teh find/replace stuff cause my lines are different, I'll be bugging you on icq xenon, maybe you can help me
i just want to remove moderator querys from index ...
i have to do these
PHP Code:
remove:
$imodcache = array();
$mod = array();
$forummoderators=$DB_site->query('SELECT user.userid,user.username,moderator.forumid
FROM moderator
LEFT JOIN user
ON (moderator.userid=user.userid)
ORDER BY user.username');
while ($moderator=$DB_site->fetch_array($forummoderators)) {
$imodcache["$moderator[forumid]"][] = $moderator;
$mod["$moderator[userid]"] = 1;
}
$DB_site->free_result($forummoderators);
unset($moderator);
PHP Code:
find:
$listexploded=explode(",", $forum['parentlist']);
while ( list($mkey1,$mval1)=each($listexploded) ) {
if ( !isset($imodcache["$mval1"]) ) {
continue;
}
reset($imodcache["$mval1"]);
while ( list($mkey2,$moderator)=each($imodcache["$mval1"]) ) {
if ( !isset($forum['moderators']) ) {
eval("\$forum['moderators'] = \"".gettemplate('forumhome_moderator')."\";");
} else {
eval("\$forum['moderators'] .= \", ".gettemplate('forumhome_moderator')."\";");
}
}
}
if ( !isset($forum['moderators']) ) {
$forum['moderators'] = ' ';
}
it won't hurt anymore then
you shouldn't have any upgrade problems, AFAIK Erwin has removed that col long time ago already and didn't get in trouble..
nevertheless if you just remove the mod query and don't install the mod thing into forum.php (of my file) and also don't improve the whos' online on forumhome queries with my hacking advices, mods wouldn't be highlighted anymore (just supermods and admins would..)
There is the online now feature on forumhome right?
and if you have enabled the moderatorhighlightin, all your online mods show up bold.
if you remove the mod query above and do not change the part which generates the current online users, all normal mods wouldn't be bold anymore
Originally posted by Xenon wow, good server if it's that fast with 55 queries
but i think you should optimize index.php more than just with my hack
Now the result is 'Page generated in 0.26656604 seconds (43.08% PHP - 56.92% MySQL) with 50 queries.' Since I turned off the vBportal left colum display.
One question, how can I optimize it even more? :knockedout: