10-08-2000, 11:32 AM
I'm new hacker of vBulletin. So backup your index.php first:-)
(1) find:
$categorys=$DB_site->query("SELECT categoryid,title,displayorder FROM category WHERE displayorder<>0 ORDER BY displayorder");
under it add:
$forummoderators=$DB_site->query("SELECT user.username,forumid FROM forumpermission,user WHERE user.usergroupid=forumpermission.usergroupid AND canadminedit=1");
while ($moderator=$DB_site->fetch_array($forummoderators)) {
$forum_idx=$moderator[forumid];
$mod[$forum_idx][]=htmlspecialchars($moderator[username]);
}
(2)find:
$forummoderators=$DB_site->query("SELECT user.username,user.usergroupid FROM forumpermission,user WHERE user.usergroupid=forumpermission.usergroupid AND canadminedit=1 AND forumid=$forumid");
if ($moderator=$DB_site->fetch_array($forummoderators)) {
$moderators=htmlspecialchars($moderator[username]);
while ($moderator=$DB_site->fetch_array($forummoderators)) {
$moderators.=", ".htmlspecialchars($moderator[username]);
}
} else {
$moderators="?";
}
REPLACE with:
if ($mod[$forumid]){
$moderators=join(",",$mod[$forumid]);
}else{
$moderators="?";
}
I benchmark my board with ab -c 5 -n 30 (apache 1.32),Requests per second from 0.9x up to 5.12 ^_^
AGAIN please backup your index.php first,I'm not sure if it's bug free.
(1) find:
$categorys=$DB_site->query("SELECT categoryid,title,displayorder FROM category WHERE displayorder<>0 ORDER BY displayorder");
under it add:
$forummoderators=$DB_site->query("SELECT user.username,forumid FROM forumpermission,user WHERE user.usergroupid=forumpermission.usergroupid AND canadminedit=1");
while ($moderator=$DB_site->fetch_array($forummoderators)) {
$forum_idx=$moderator[forumid];
$mod[$forum_idx][]=htmlspecialchars($moderator[username]);
}
(2)find:
$forummoderators=$DB_site->query("SELECT user.username,user.usergroupid FROM forumpermission,user WHERE user.usergroupid=forumpermission.usergroupid AND canadminedit=1 AND forumid=$forumid");
if ($moderator=$DB_site->fetch_array($forummoderators)) {
$moderators=htmlspecialchars($moderator[username]);
while ($moderator=$DB_site->fetch_array($forummoderators)) {
$moderators.=", ".htmlspecialchars($moderator[username]);
}
} else {
$moderators="?";
}
REPLACE with:
if ($mod[$forumid]){
$moderators=join(",",$mod[$forumid]);
}else{
$moderators="?";
}
I benchmark my board with ab -c 5 -n 30 (apache 1.32),Requests per second from 0.9x up to 5.12 ^_^
AGAIN please backup your index.php first,I'm not sure if it's bug free.