PHP Bulletin Board Home
News About Home
Features of phpBB Test drive phpBB Downloads Support for phpBB The phpBB Community Styles for customising phpBB 3rd party modifications to phpBB

Support Home | Knowledge Base Home | Submit Article | Search Articles | Browse Articles
 Don't Use Moderators? Speed Up index.php !! 
Description: How to reduce the amount of queries in index.php by not showing the moderators.
Author: AbelaJohnB
Date: Tue Oct 29, 2002 3:50 pm
Type: HowTo
Keywords: speed, increase, moderators, SQL, load, queries, query
Category: Improvements
Hello.


Do you have a small forum? Or a really huge forum? Or are you just a power-hungry admin? <grin>

If you use phpBB2.0 and do not use/have "Moderators" then you can increase the speed of index.php and save yourself two (2) extra SQL queries, by following this simple 'how-to'.


First, I am not going to instruct you on how-to -remove- the code, simply to comment it out. You may, in the future want to use/acknowledge your Moderators, at which time simply reverse the below steps!



OPEN:

index.php

FIND:

Code:

//
// Obtain list of moderators of each forum
// First users, then groups ... broken into two queries
//


BEFORE, ADD:

Code:

/*/



FIND:


Code:

//
// Find which forums are visible for this user
//


BEFORE, ADD:

Code:

/*/



FIND:


Code:

'L_MODERATOR' => $lang['Moderators'],


REPLACE WITH:

Code:

// 'L_MODERATOR' => $lang['Moderators'],




FIND:


Code:

if ( count($forum_moderators[$forum_id]) > 0 )
{
   $l_moderators = ( count($forum_moderators[$forum_id]) == 1 ) ? $lang['Moderator'] : $lang['Moderators'];
   $moderator_list = implode(', ', $forum_moderators[$forum_id]);
}
else
{
   $l_moderators = '&nbsp;';
   $moderator_list = '&nbsp;';
}


REPLACE WITH:

Code:

/*
if ( count($forum_moderators[$forum_id]) > 0 )
{
   $l_moderators = ( count($forum_moderators[$forum_id]) == 1 ) ? $lang['Moderator'] : $lang['Moderators'];
   $moderator_list = implode(', ', $forum_moderators[$forum_id]);
}
else
{
   $l_moderators = '&nbsp;';
   $moderator_list = '&nbsp;';
}
*/




FIND:

Code:

'MODERATORS' => $moderator_list,


REPLACE WITH:

Code:

// 'MODERATORS' => $moderator_list,



FIND:

Code:

'L_MODERATOR' => $l_moderators,


REPLACE WITH:

Code:

// 'L_MODERATOR' => $l_moderators,




That is it !!

This will reduce your SQL load by two (2) queries.

Not a -huge- increase in speed, but it will help!

Username: Password:
News | Features | Demo | Downloads | Support | Community | Styles | Mods | Links | Merchandise | About | Home
 © Copyright 2002 The phpBB Group.