VERSION 1.2 RELEASED Basically the only difference you will notice is a dropdown menu that will display the unchached templates.
In this way, you can add it to the cache and save one or more queries.
[high]THIS HACK WAS TESTED IN A DEFAULT, CODE UNMODIFIED BOARD.[/high]
This hack will add at the bottom of each vBulletin(powered) page the following stats:
REGULAR USERS STATS
- load time of specified page in microseconds (with custom no. of digits to show)
- percentages of PHP/MySQL usage
- number of queries executed
ADMINISTRATOR STATS
- number/name of uncached templates (name highlighted in blue, for uncached template)
- vBulletin DEBUG mode status
- server GZIP library compression status
- average Server Loads
[high]This is not only estethic, it will also help you troubleshoot any wierd queries that you have in your scripts.[/high]
IMPORTANT
If you get results like: Page generated in 3.35731196 seconds (9.05% PHP - [high]90.95%[/high] MySQL) with 17 queries
You probably use a bad piece of code, because vBulletin will never generate those extreme results.
Imagine this: the code uses only 10% the resources to read the actual PHP code and the rest of 90% is used only to scan the tables... WOW!
That means the code forces to read into the database for each user who visits the site at this percentage... if you have 1000 users viewing the page in the same time.. you can get a picture of it...
If you compare this with vBulletin, the software does the opposite, 90% PHP and 10% MySQL... the right way.
DIVISION BY ZERO ERROR? Read this. INVALID STATS IF MYSQL COMPILED IN A NON-ENGLISH LANGUAGE? Read this.
NOTE: The blue highlighting is not working in Opera 7.23 version. (Thanks Christine)
Have fun.
Show Your Support
This modification may not be copied, reproduced or published elsewhere without author's permission.
SafeMode is off, by the way, but I still can't see the average server loads.
If I enter uptime via SSH2 with root I get a result. If I enter it with my website's account via SSH2 I get uptime: command not found, just in case it shouldn't be like this.
Turn DEBUG on to find out what template is cached and put it in the templates section at the top of the file for the page it isn't cached on.
The easiest way is to install Teck's update for this great hack and you won't need to enable DEBUG to find out which template isn't cached. The drop down box for the Uncached templates (in the update) will show you the template that isn't cached.
I have a question. How can i "cache" an "uncached" template without installing an update?
You need to know what templates are performing an extra query for their uncached name. You can do this with the latest version of this hack, it will take you 30 seconds to upgrade it.
Once you know the name of the uncached templates, simply add it to $globaltemplates array, present at the top of each .php file in vBulletin.
So if in your index.php file, you have 2 unchached templates, look at the top of index.php file and find:
Code:
$globaltemplates = array(
'FORUMHOME',
...,
and add the end the template name you missed to add.