![]() |
vBMicrostats
Finally, the vBMicroStats product for vBulletin 3.5.4 is here. :)
The previous versions of my mod were very solicited by vBulletin administrators... I hope you will enjoy this new version as much you did the other ones. Looking for VB 3.6.x version? It is here. This mod with add at the bottom of each vBulletin (powered) page, the statistics listed below. Also, it will help you troubleshoot and optimize your vBulletin board by viewing or comparing PHP/MySQL options and other statistics that are normally hidden in your forum pages. Regular Users: ? Load time of specified page in microseconds ? Number of queries executed ? PHP percent page usage ? MySQL percent page usage Administrators Only: ? Server memory usage per page (in Kb) ? DEBUG mode status ? Browser GZIP library compression status ? Server average loads ? Uncached templates (useful to troubleshoot the code) The code modifications listed below were tested into a clean installed vBulletin board. They work 100%. If you encounter any problems, feel free to post your questions here. Step by step install instructions are posted into vbmicrostats.html file. In order to perform an efficient modification of your files, I recommend you to use Dreamweaver (Coder Mode) or Textpad. Both editors will allow you to complete all steps without any coding errors. I tried to use the plugin system as much as I could, in order to avoid any unnecessary code modifications. In order to set the right query execution time, you will need to perform 2 small code changes to each of the following files: ? class_core.php (folder /includes) ? init.php (folder /includes) The code changes are very safe and designed not to interfere in any way with the vBulletin performance/functionality. Make sure you modify, save and upload one file at the time to your server. Then, simply run the product-plugin_vbmicrostats.xml file. Once the product installed, don't forget to enable it. Go to your vBulletin Options, click on BB MicroStats setting group and set all your options. |
Division by Zero? View the fix.
Negative results? View the fix. I'm waiting a response from vBulletin Team, for a better fix. Stats not showing in PhotoPost? View the fix. Stats only for Administrators? View the fix. Also, if you get results like: Page generated in 3.35731196 seconds (9.05% PHP - [high]90.95%[/high] MySQL) with 30 queries every time you refresh your php page, you probably use a bad piece of code. 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. |
awesome, I'll check it out :)
|
Excellent work, sir. Been waiting for this. And welcome back! ;)
|
awesome :)
|
Thank you Boofo (and all my vBFriends)! Good to be back in the house.
BTW, the VB3.5.4 code made me pull my hair few times, trickier then I thought... since it's so different from VB2. Now, back to my vBlog product... :) |
Quote:
I will suggest downloading and installing mtha's Advanced Product Manger though. It is the only thing to use for putting hacks together. Everything all in one place to work with. You won't regret it. ;) |
ok question mine dont center and it makes a table... check the screen shot out.. also is there anyway to make it display like this mod does https://vborg.vbsupport.ru/showthread.php?t=82900 at the bottom of the footer without the table?
|
hmmm. all code mods installed, double checked, template modified, enabled, shows up on page, but no value for time displayed
Quote:
|
i was just getting ready to say the same thing lol
|
Your request is simple to fill. :)
There is a template, hidden in the plugin code. It's the best/fastest way to load it, plus it does eliminate other extra code modifications in files. All you have to do is edit the following code, present in your vBMicroStats Global Hook plugin: Code:
$ms_output = '<tr align="' . $stylevar['right'] . '">' . "\n"; The first code segment will set the regular user options, the second will take care of the administrator ones. If you edit this html code the way you like it, you will obtain the result you want. BTW, you can place the code: Code:
<if condition="$show['microstats']">{microstats}</if> EDIT: The best way to edit the plugin code is to copy it all and paste it into your favorite editor. Do all html changes, then paste it back and save it. |
Quote:
Open the vBMicroStats Global Hook plugin and find this code: Code:
Page generated in ' . $totaltime . ' seconds Code:
Page generated in ' . $total_time . ' seconds |
Thanks for sharing this TECK!
|
Version 1.0.1 released. Bug fixed.
You can uninstall/install the plugin if you like, instead of editing the code. |
I'm nor seeing anything for some reason. I dounble checked everything but nothing shows up. And it is all turned on.
EDIT: My fault. I added it to the wrong skin. Sorry. ;) |
Teck, is there any way to edit the html code for this so that it will make sense to us html dummies? I can't get it looking right on my site and I'm not sure what to do to fix it.
|
Sure, Bobby. :)
I will post an example here... in few minutes. |
Quote:
Here's my site URL so you can see my problem: Fathers' Rights Forums |
yeah im playin with it to but im going crazy lol i have it where it centers the text but not the table... or i try and remove the table and the text goes poof
|
also i see you have..
$ms_output = '<tr align="' . $stylevar['center'] . '">' . "\n"; now if i make it $ms_output = '<tr align="center">' . "\n"; is there any down fall? cause that makes it 100% html complaint... there is 2 spots where that is... |
Ok, here it is an example:
Code:
$ms_output = '<span class="smallfont">'; If you want the $ms_output template code even simplier, use this: Code:
$ms_output = 'Page generated in ' . $total_time . ' seconds (' . $php_percent . ' - ' . $sql_percent . ') with ' . $query_count . ' queries<br />'; Code:
<if condition="$show['microstats']">{microstats}</if> For example, to make your two new lines centered, use this: Code:
<if condition="$show['microstats']"> If you have any other questions, go ahead and post them. :) |
is there a way to track down which hacks are the troublesome ones using this?
|
much easier thank you
|
Bob, I looked at your site, it looks fine?
If you want to place the microstats after the vBulletin copyright (for example), use my second $ms_output template, listed above. |
Quote:
And a screenshot. :) |
one sec im just moving around the text lol tryin to see where it looks best
|
Quote:
However, there is a tricky way to see what's the "bad" mod in your source. You need to enable only one mod at the time. Then simply view your pages with the specific mod enabled/disabled. Compare your stats between the original vBulletin unmodded page and the one with the mod enabled. You will notice rightaway and erratic number of extra queries or abnormal percentages.... and complain to the mod creator. :) That's why the users loved so much vBMicroStats, it was the first mod that told you what's really going on with your PHP code... If you find a better way, please share it with the users here. |
ok quick question here is what i have so far...
Code:
if ($vbulletin->options['vb_mstats_active']) ok now when i remove the bottom table it all groups in one line... im tryin to keep it 2 lines like you have it but when i remove the admins alt1 Code:
$ms_output .= ' <td class="alt1"' . iif($show['quickchooser'] OR $show['languagechooser'], ' colspan="' . $colspan . '"') . '>' . "\n"; |
Quote:
EDIT: Ok, I now see what you mean. Am working on it now. Thank you, sir. ;) |
here is my screen shot so far of what i have going on... just tryin to figure out the admin table now
|
here is what i mean if i remove the admin table the alt1 it groups both lines into one...
|
Bob, post here the actual html code from the page source, not footer template. Start from the beginning of microstats code to the end of footer.
I will fix it, something is wrong with the row colspan, in my mod. |
working good for me, though if I view the same exact page without any changes sometimes I'll get php close to 90% and every once in awhile I'll get the sql at like 70%.
|
Quote:
First segment of code is ok, but try this instead. Find: Code:
$ms_output .= ' <span class="smallfont">Page generated in ' . $total_time . ' seconds (' . $php_percent . ' - ' . $sql_percent . ') with ' . $query_count . ' queries</span>' . "\n"; Code:
$ms_output .= 'Page generated in ' . $total_time . ' seconds (' . $php_percent . ' - ' . $sql_percent . ') with ' . $query_count . ' queries<br />'; Code:
$ms_output .= '<tr align="' . $stylevar['right'] . '">' . "\n"; Code:
$ms_output .= $memory_status . $debug_status . $gzip_status . $server_status . $templates_status; Code:
$vbphrase[powered_by_vbulletin]<if condition="$show['microstats']"><br /> |
Quote:
|
lol i just got it before i refreshed the page lol thank you very much here is my code in my vBMicroStats Global Hook if anyone wants it like this hope you dont mind if so ill remove it.... just remember members only see the top code not the bottom one...
also i placed my <if condition="$show['microstats']">{microstats}</if> in the copyright part of the footer like this Code:
<div align="center"> |
Quote:
MySQL is a very smart language. If you run a query for the first time, it will execute it and also store it in the memory, in case you will need to perform it again. That saves server resources. If you don't use it for a certain period of time, the process is dumped automatically. This is where you see the critical points in your PHP pages. If every time you load a new page that have wierd mods enabled, MicroStats will warn you with the actual results, creating rightaway a question mark in your mind about the quality of the code you installed. The best way to see what are the "clean" results of your PHP/MySQL code is to install MicroStats into an unmodded vBulletin test board. Then you can compare the clean results with your board results... |
Quote:
Watch the server load, it's close to the sky. The bold numbers should not be higher then 1.00, yours are over 3.00. Are you on a shared server? If you are, contact your host and let them know. Someone is eating a lot of CPU there... |
lol im doing a backup thats why... but the queries you are seeing is from my vbadvanced page...
|
Quote:
The second, into your footer template, or any other template you like. ;) |
All times are GMT. The time now is 04:54 PM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|