View Full Version : vbMicroStats: page load time, queries, GZIP and PHP version
Looking for VB3 version? Is here (https://vborg.vbsupport.ru/showthread.php?t=62173).
This hack will add at the bottom of each vBulletin(powered) page the following stats:
- load time of specified page in microseconds (with custom no. of digits to show)
- number of queries executed
- server GZIP library compression status
- vBulletin DEBUG mode
- PHP version
- PHP percent page usage
- MySQL percent page usage
- Server Load
This is not only estethic, it will also help you troubleshoot any wierd queries that you have in your scripts.
The hack is template based so you can edit it the way you want in few seconds.
NOTE: From users experiences, this hack will work only with PHP 4.0.6 or higher. Let me know if it works with a lower PHP version.
THE FIX FOR VB2.3.0 IS HERE (https://vborg.vbsupport.ru/showthread.php?postid=359609#post359609).
HACK UPDATES
Version 2.1
------------------------------------
Changes:
- added Server Load
NOTE: I spoked with Kevin 'tubedogg' from vBulletin Support team and he explained to me that not all the servers are configured to support the @exec("uptime").
Contact your host for more details and ask them about this issue.
For a full explanation of your 3 server load values, read more here (http://www.vbulletin.com/forum/showthread.php?s=&action=showpost&postid=291831).
*If you want to have the stats viewable only by admins, read (https://vborg.vbsupport.ru/showthread.php?postid=265092#post265092) this post.
Version 2.0
------------------------------------
Changes:
- added vBulletin DEBUG Mode
- removed the Details link
- cleaned a little the code to match VB2.2.6
- better explanations into the install file.
Version 1.7
------------------------------------
VB2.2.5:
Minor change in admin/db_mysql.php. Read more here (https://vborg.vbsupport.ru/showthread.php?postid=248469#post248469) on how to update your hack.
Minor change in forum/global.php. Read more here (https://vborg.vbsupport.ru/showthread.php?action=showpost&postid=237728) on how to update your hack.
Changes:
- corrected negative values on certain servers.
Version 1.6
------------------------------------
Changes:
- PHP version and GZIP library status viewable only to admin.
- added a link to Detailed Stats View (generated by vBulletin), for that specific page. Only admins can view that link.
To see how it looks a Detailed View, click here (https://vborg.vbsupport.ru/showpost.php?s=&postid=228645).
Version 1.5
------------------------------------
Added:
- GZIP library status is now related to your vBulletion options.
- GZIP library compression level.
Version 1.4
------------------------------------
Bugs corrected:
- GZIP library status not displayed properly on certain servers.
Version 1.3
------------------------------------
Bugs corrected:
- vbPortal display code in modules
The hack is template based now.
All you have to do is call it with the {getmicrostats} string, anywhere you want (for example in footer).
You also have the choice to install it as template based or coded directly into your functions.php file.
Version 1.2
------------------------------------
Added the PHP and MySQL page percentage.
(Addon by Chen 'FireFly' Avinadav)
Version 1.1
------------------------------------
vB.org decided to add this hack to their board. ;)
Bugs corrected:
- incorrect time load
- incorrect query count
You like this hack? Please click (https://vborg.vbsupport.ru/misc.php?s=&action=install&threadid=35811) on the Install button.
To download the latest version of this hack, click below:
a screenshot for vbMicrostats v2.1
look at the bottom of the page...
sleepbirdcyp
03-07-2002, 03:38 AM
Great Hack
THX~
Gamingforce
03-07-2002, 03:54 AM
Excellent. Works perfectly.
sleepbirdcyp
03-07-2002, 03:57 AM
how abt the server loads after install this hack??
ther are no queries to be performed.. so the server load is null ;)
sleepbirdcyp
03-07-2002, 04:25 AM
Great!
SaintDog
03-07-2002, 05:54 AM
Nice one!
Going to place this on my board...tomorrow, too tired to tonight :)
SaintDog
Admin
03-07-2002, 08:53 AM
This works but doesn't... it shows the wrong info. nakkid, I told you more in an e-mail, read it and understand what I'm talking about.
Floris
03-07-2002, 09:36 AM
Oi, just read firefly's post .. I think I will wait for the upgrade :D
nafae
03-07-2002, 09:40 AM
yes but this is a fantastic concept, hopefully the bugs will get worked out :)
Xelation
03-07-2002, 10:46 AM
cool, great hack... I hope you can get the bugz fixed soon. :D
Originally posted by FireFly
This works but doesn't... it shows the wrong info. nakkid, I told you more in an e-mail, read it and understand what I'm talking about. Firefly, ok.. i know where is the problem. i didnt grabbed properly the start and end_time, i mean not from the moment the script starts until it's loaded. that's all. i will release a new version tonite, to correct this little problem, so it will show the correct load time.
regards,
nakkid.
wooolF[RM]
03-07-2002, 01:14 PM
*G* hacker-waker... *G*
ok.. i updated the file. enjoy ;)
Admin
03-08-2002, 12:07 PM
Nice going nakkid. :)
Lesane
03-08-2002, 02:54 PM
Great, well done Nakkid :up:
hmm.. firefly installed this hack on this site. thanks :)
he also made an interesting mod to if to show the %. i will add that mod to the hack (with proper credit, of course).
sHORTYWZ
03-08-2002, 03:23 PM
I run an IIS server and even though my page is using gzip compression it is showing as disabled with this mod... any ideas?
the gzip variables are called properly. check your server config.
regards,
nakkid.
Admin
03-08-2002, 04:26 PM
sHORTYWZ -- have you added $gziptext to the string? It's not there by default.
ptbyjason
03-08-2002, 04:44 PM
thanks nakkid :D
how can we display 71.11% PHP - 28.89% MySQL ???
thx
Xelation
03-08-2002, 05:30 PM
Great Hack! :D I'll install at soon as I have time!
sHORTYWZ
03-08-2002, 05:35 PM
Yeah I actually did Firefly and it showed disabled.. shrug - I don't really want it there anyways =)
Originally posted by dyt4
how can we display 71.11% PHP - 28.89% MySQL ???
thx i will mod the hack tonight... before i live in my honey moon.. did you checked The Lounge? ;)
Originally posted by sHORTYWZ
Yeah I actually did Firefly and it showed disabled.. shrug - I don't really want it there anyways =) the browser check to see if the server have GZIP enabled. if it is, it will show it as enabled.
Gamingforce
03-08-2002, 07:01 PM
Hey Nakkid, how would you uninstall the first version? Do you have the original text file?
I get an error with global.php about unable to get function microstats().
i dont have the original version.. but i will make one.. is really easy.. :) as soon as i go home i will email you.
for now search for $microstats and delete those lines.. they must be under $footer
regards,
nakkid.
nafae
03-08-2002, 07:17 PM
Hmm Nakkid I am not sure what is wrong here, but I get the following error:
Parse error: parse error in /home/coderfor/public_html/admin/functions.php on line 2109
Warning: Cannot add header information - headers already sent by (output started at /home/coderfor/public_html/admin/functions.php:2109) in /home/coderfor/public_html/admin/functions.php on line 1553
Any ideas?
you called twice the headers. check your code. what vB version you have? this was tested only in 222 and 223.
regards,
nakkid.
nafae
03-08-2002, 07:25 PM
its 222... I'm not sure where to check for this...
function dooutput()... do you still have your original file before you edit it? follow the install steps exacly and you will do great. probably you copied an extra line in there.
let me know.
nafae
03-08-2002, 08:02 PM
Alright, thanks Nakkid i got it working, When copying I had missed a few characters lol -Thanks again, hack looks great.
dont worry it happens to everyone ;)
i'm glad you like it.
freakyshiat
03-08-2002, 08:14 PM
i need to uninstall the first one. can u post that one?
Originally posted by Fazle
i need to uninstall the first one. can u post that one? i'm at work now. i will post the uninstall as soon as i get home. you should always save the readme files related to any hacks.
regards,
nakkid.
freakyshiat
03-08-2002, 08:25 PM
I saved the readme, but its at home :p
okrogius
03-08-2002, 08:26 PM
Originally posted by FireFly
sHORTYWZ -- have you added $gziptext to the string? It's not there by default.
What string?
Originally posted by nakkid
i will mod the hack tonight... before i live in my honey moon.. did you checked The Lounge? ;)
the browser check to see if the server have GZIP enabled. if it is, it will show it as enabled.
thx again for all :)
Renegade
03-09-2002, 02:11 AM
Cool hack, I might check it out!
lowlight
03-09-2002, 02:23 AM
Mine isn't showing GZIP status... How can I do that?
use the $gziptext variable. i just released ver 1.2
it's self explanatory.
Reeve of shinra
03-09-2002, 04:40 AM
Maybe its just late, but what variable is added to the footer?
Gamingforce
03-09-2002, 04:56 AM
Awesome hack however just like the first one you should make it so that the user can add a variable to their footer instead of functions.php automatically printing it to the end. Many people like myself have custom footers at the bottom and it doesn't harm those who don't and helps those who do tremendously.
Thanks and keep up the great work!
Originally posted by Reeve of shinra
Maybe its just late, but what variable is added to the footer? there is no variable to be added to the footer.
Originally posted by Gamingforce
Awesome hack however just like the first one you should make it so that the user can add a variable to their footer instead of functions.php automatically printing it to the end.i tried. it gives incorrect values because you must load it before headers... that's why i changed the code and released ver 1.1. ;)
about the custom footer, insert the custom html code into your $vartext.
regards,
nakkid.
Admin
03-09-2002, 05:20 AM
Funny, on this board the text is stuck in the footer HTML code... ;)
hehehe... sssssstttthhhh.. ;) dont sell industrial secrets...
i tried to make it easier for people FireFly.
now be nice... :D
freakyshiat
03-09-2002, 07:48 AM
heres the original one if someone wants to uninstall it
freakyshiat
03-09-2002, 08:06 AM
Originally posted by FireFly
Funny, on this board the text is stuck in the footer HTML code... ;)
can you share how, master? :p
Fazle, i will see what i can do with it to make you happy.
vB.org variable test:Page generated in 0.35182405 seconds (26.11% PHP - 73.89% MySQL) with 27 queriesthe code above was called with a variable.
as you notice, the higher you place it on the page, the lower are the values...
Tim Wheatley
03-09-2002, 09:51 AM
Why are my percentages coming through wrong??
Page generated in 0.1624170 (-5,389.35% PHP - 5,489.35% MySQL) seconds with 116 queries.
PHP version 4.1.2 (Debug mode) with GZIP compression library disabled.
reload the page, it will be ok. and btw, if you have 116 queries, you are in big trouble. you must check your hacked board. you have a huge error there.
hmmm.. i just checked your forum. you probably didnt updated all files. did you downloaded the previous version 1.1? in that case, you must clear your cookies to see the actual file. when you view the attachment, it will pull it the one from temp folder not the actual file.
make sure you edit forum/admin/db_mysql.php
let me know.
psico
03-09-2002, 10:17 AM
Version 1.2 has problems with vBPortal...
Shows the message under every Block on vBPortal!!!
Any solution for that?
And shows me 199 queries!!! mmmm
i'm working on a mod right now, so you can enter a variable instead. it will cure your prob.. give me another 15min ;)
Admin
03-09-2002, 11:30 AM
Originally posted by psico
And shows me 199 queries!!! mmmm
LOL now I remember why we don't use vbPortal.
Tim Wheatley
03-09-2002, 12:41 PM
It seems to be working now for me... did I clear cookies? I don't know. ;)
Jawelin
03-09-2002, 04:51 PM
:(
I always get PHP percentage negative.... ????
(even reloading and reloading).
Always something like :
Page generated in 0.37837 seconds (-54.60% PHP v4.1.2 - 154.60% MySQL) with 34 queries.
I DON'T have VbPortal and use vb 2.2.2 yet...
Thanks
Tim Wheatley
03-09-2002, 05:01 PM
I have too many queries then I guess? Why would that be? Am I looping something?
yes you do. this is extremly high. after 50 queries, the server start to go on the red side. i'm surprised your host didnt contact you yet. ;)
ok.. i went to sleep yesterday. so i'm gonna start the mod right now. gimme 30min for my breakfest and keep in mind that i should do my luggage instead of posting here. tomorrow at 8 i have the plane taking me away to my baby sweet loving woman.. :D
Floris
03-09-2002, 07:40 PM
Originally posted by FireFly
LOL now I remember why we don't use vbPortal.
:) haha, but your's not free :P
I'll personally wait till v3 I think :>
Tim Wheatley
03-09-2002, 07:56 PM
Originally posted by nakkid
yes you do. this is extremly high. after 50 queries, the server start to go on the red side. i'm surprised your host didnt contact you yet. ;)
My host has contacted me, apologised and upgraded the server twice thinking their hardware wasn't strong enough - LOL
So - how do I find out what the problems are? I know how to edit, I understand how php works (i think) but don't know how to change how it works myself...
version 1.3 released. bugs fixed with vbPortal.
Originally posted by Tim Wheatley
My host has contacted me, apologised and upgraded the server twice thinking their hardware wasn't strong enough - LOL
So - how do I find out what the problems are? I know how to edit, I understand how php works (i think) but don't know how to change how it works myself... you should open a separate thread for this.
Jawelin
03-09-2002, 10:58 PM
Originally posted by Jawelin
:(
I always get PHP percentage negative.... ????
(even reloading and reloading).
Always something like :
I DON'T have VbPortal and use vb 2.2.2 yet...
Thanks
As said above, I always get negative php percent values.
So I started investigating... ;)
Could someone explain which is the meaning of $starttime=explode(" ",$pagestarttime);
$endtime=explode(" ",$pageendtime);
$totaltime=$endtime[0]-$starttime[1];
... instead ....
$totaltime=$endtime[0]-$starttime[0]+$endtime[1]-$starttime[1]; ??
Besides, actually I would prefer the first version of the hack, with an explicitly called variable to display microstats, instead of using the dooutput() function.
Mainly because I would control exactly where stats are displayed - would prefer footer only, not at the end of each page
Thanks a lot.
Bye
it gets the start time and end time to a specific location only.
did you try it to leave the value defaulted?$totaltime=$endtime[0]-$starttime[0]+$endtime[1]-$starttime[1];when i leave it default, it gives a format like:
1,236,324,262.324626726 seconds
the negative time is due to some code misconfiguration only.
and btw, that's what ver 1.3 does (is template based) hihi...
Jawelin
03-10-2002, 08:32 AM
Originally posted by nakkid
it gets the start time and end time to a specific location only.
did you try it to leave the value defaulted?$totaltime=$endtime[0]-$starttime[0]+$endtime[1]-$starttime[1];when i leave it default, it gives a format like:
1,236,324,262.324626726 seconds
the negative time is due to some code misconfiguration only.
and btw, that's what ver 1.3 does (is template based) hihi...
Nice! Now I appreciate much more the new 'philosophy' ...
:)
Same, I saw now you use $totaltime=$endtime[0]-$starttime[0]; (only 0 index value...)
Well. Even still doesn't work to me: the problem is - trying both versions with or without templates (wich I would prefer ...) - I have some difficulties modifying the dovars() function.
(already hacked with FF's Reader's name inside post which already puts a first-element replacement..)
Actually I wouldn't like to use another replacement handly-added and simply would use $microstats var directly in the footer template.
But it isn't enough to define it (as global) within the dooutput() function, as you did as a part of the hack.
Why ?
Any workaround ?
Excuse me, but would manage to understand the chinese-box inheritance of those php vars !!
Thanks a lot.
;)
you can add more then one index and value to your array:$findwords=array(0 => '{getmicrostats}', 1 => '{bbusername}');
$replacewords=array(0 => $microstats, 1 => $bbusername);
$i=2;try it and let me know.
also dont forget that dooutput() is needed to call the headers and the time before it starts the page and it ends also. dovars() will only replace the variables. use this code for now: // time format (how many digits you want to show)
$digits=7;
$totaltime=$endtime[0]-$starttime[0];
$trimmedtime=number_format($totaltime,$digits);
$percentphp=number_format(((($totaltime-$querytime)/$totaltime)*100), 2)."% PHP";
$percentsql=number_format((($querytime/$totaltime)*100), 2)."% MySQL";
$debugmode=(DEBUG)?" (Debug mode)":"";
$versionphp=phpversion();
if (strstr($HTTP_SERVER_VARS["HTTP_ACCEPT_ENCODING"], "gzip")) {
$gziptext="enabled";
} else {
$gziptext="disabled";
}
$vartext .= "Page generated in $trimmedtime seconds ($percentphp - $percentsql) with $query_count queries.<br>
PHP version $versionphp$debugmode with GZIP library compression $gziptext.";no need to edit anymore dovars(). you can add html code to it.
Jawelin
03-10-2002, 10:24 AM
Originally posted by nakkid
you can add more then one index and value to your array:$findwords=array(0 => '{getmicrostats}', 1 => '{bbusername}');
$replacewords=array(0 => $microstats, 1 => $bbusername);try it and let me know.
also dont forget that dooutput() is needed to call the headers and the time before it starts the page and it ends also. [...]
Thanks for the update to dovars()....
But, as said, I would prefer to use a simple $varbit to add to the footer template.
This because I could control better the place where that var is put (if I'd used the dooutput() with $vartext, that string would be added to EACH page, even those without footer code ... i.e. vb popup smilies, etc...)
Any case I'll use by now the replacement... :(
Thanks again
Bye
you cannot add a variable $varbit in dooutput() for the simple reason that you will have to edit every single dooutput() piece of code in every single script that uses that function. trust me, there are alot of them. this hack is about getting the right time before and after the page is loaded. the rest of variables are pulled from the server.
i do not understand why you cannot use the array values instead? like the way i show you above? you will be able to use both strings, whereever you want to place them.
Admin
03-10-2002, 10:44 AM
Originally posted by Jawelin
Thanks for the update to dovars()....
But, as said, I would prefer to use a simple $varbit to add to the footer template.
This because I could control better the place where that var is put (if I'd used the dooutput() with $vartext, that string would be added to EACH page, even those without footer code ... i.e. vb popup smilies, etc...)
Any case I'll use by now the replacement... :(
Thanks again
Bye
If you want to place the info in a diff place, install the latest version of the hack and just use {getmicrostats} instead of $varbit. It's that simple.
Jawelin
03-10-2002, 10:51 AM
Ok. Ok.
Both of you persuaded me... :) I'm gonna use the replacement var adding it to FF's hack in dovars()... ;)
Thnx again and sorry for the time.
The Realist
03-10-2002, 11:13 AM
I have cleared my cookies and all Iam seeing is this:
vB Load Time, Queries Execution, |
| GZIP Compression and PHP Version MICROSTATS |
| Version 1.0
Can someone send me the latest version please to:
realist@skytronic-forums.com
Thanks
:)
Originally posted by The Realist
Can someone send me the latest version...done. check your email.
Jawelin... look, i use the vbMicroStats variable here:
{genininfo}
you can place {getmicrostats} everywhere you want, as firefly mention it before. ;)
Jawelin
03-10-2002, 11:29 AM
:) Thnx
The Realist
03-10-2002, 01:40 PM
Thanks M8 :)
Originally posted by nakkid
done. check your email
okrogius
03-10-2002, 02:48 PM
Can I get the latest version emailed to me please? oleg@gaminguru.com Thanks in advance.
The Realist
03-10-2002, 02:55 PM
Regarding the below after installing the latest hack.
Page generated in 0.0828900 seconds (19.67% PHP - 80.33% MySQL) with 34 queries.
PHP version 4.0.6 (Debug mode) with GZIP library compression disabled.
Its says that GZIP compression is disabled?
How can I get it to be enabled, it is enabled in VB admin panel and also installed on the server..... so why is it saying this?
Any help?
nafae
03-10-2002, 02:56 PM
I get the same problem TR, it must just be the script not talking to the server properly or the server not outputting that gzip is enabled..
Lesane
03-10-2002, 03:54 PM
Same here aswell and i know that gzip is enabled...
Page generated in 0.0575660 seconds (-4,066.49% PHP - 4,166.49% MySQL) with 41 queries.
PHP version 4.1.2 (Debug mode) with GZIP library compression disabled.
same thing for me as you can see here :
for gzip : http://dyt4concept.com/temp/gzip.php here gzip is enabled and here : http://forum.dyt4concept.com/ gzip is disabled ???? It's the same server...
freakyshiat
03-10-2002, 05:29 PM
Originally posted by dyt4
same thing for me as you can see here :
for gzip : http://dyt4concept.com/temp/gzip.php here gzip is enabled and here : http://forum.dyt4concept.com/ gzip is disabled ???? It's the same server...
yes your forum is gzipped ; I installed this hack too and it says gzip is disabled on my site when I know it's enabled.
go here to test see if gzip is enabled for your site:
http://leknor.com/code/gziped.php
thx the results :
http://forum.dyt4concept.com is gziped.
and
http://dyt4concept.com is gziped.
I really don't understand, maybe a bug in the hack ? I don't know
Please help
thx
lowlight
03-10-2002, 08:17 PM
Originally posted by nakkid
use the $gziptext variable. i just released ver 1.2
it's self explanatory. Not exactly self explanitory for people who don't know anything about code, but I figured it out :)
Now I have an issue... It tells me that GZIP is disabled, however using this test (http://leknor.com/code/gziped.php?url=http%3A%2F%2Fwww.hardcoreware.net%2 Fforum%2Findex.php) it seems to be enabled...
Odd
lowlight
03-10-2002, 08:32 PM
Also, it tells me that debug is on.... Should this be on? How do I turn it off?
Jawelin
03-10-2002, 08:52 PM
:( Well. I used the replacement var - finally - but still have negative values:
0.24685 seconds (-98.10% PHP v4.1.2 - 198.10% MySQL) with 34 queries.
What could be the misconfiguration problems Nakkid referred to ?
Thanks
did you modified properly db_mysql.php? the PHP percent is pulled from there.
GZIP library compression will be enabled only in pages where GZIP is in use. ;)
the hack is looking in the header, to see id GZIP os enabled, and dont forget that those stats are generated individually for each page.
Originally posted by lowlight
Also, it tells me that debug is on.... Should this be on? How do I turn it off? DEBUG mode can be turned on or off by your host.
also in the install file, you have all the variables listed there.
regards,
nakkid.
GZIP library compression will be enabled only in pages where GZIP is in use
GZIP is in use on my forum but it's always marked disabled ?
eva2000
03-10-2002, 09:38 PM
Originally posted by Jawelin
:( Well. I used the replacement var - finally - but still have negative values:
0.24685 seconds (-98.10% PHP v4.1.2 - 198.10% MySQL) with 34 queries.
What could be the misconfiguration problems Nakkid referred to ?
Thanks i get negative values when the time for the queries is lower than the average probably because i have php accelerator installed and some php sided queries are sped up by the accelerator ?
reloading the page goes back to normal
i.e.
forumhome page
Page generated in 0.0316610 seconds (-1,271.66% PHP - 1,371.66% MySQL) with 29 queries.
and
Page generated in 0.3843770 seconds (-12.94% PHP - 112.94% MySQL) with 29 queries.
and
Page generated in 0.2906680 seconds (-49.57% PHP - 149.57% MySQL) with 29 queries.
normally it's around
Page generated in 0.5901080 seconds (22.84% PHP - 77.16% MySQL) with 29 queries.
if i use index.php?explain=1
i get
Page generated in -0.361466 seconds with 29 queries,
spending 0.43714368343353 doing MySQL queries and -0.79860968343353 doing PHP things.
Originally posted by dyt4
GZIP is in use on my forum but it's always marked disabled ? look what it shows on your page. GZIP disabled. understand that this is the dooutput() function that it look in headers for the variables, not on the server.
Originally posted by eva2000
i get negative values when the time for the queries is lower than the average probably because i have php accelerator installed and some php sided queries are sped up by the accelerator?it might be the cause... i wonder if zend can play a role on this. but me and firefly have both zend enabled on server. we both tested the script. firefly went over and gave the ok in every little bit of code. he even bothered to see a dev and make sure is ok all. we both never got negative values.
i wish i could expplain why sometimes the time goes negative. firefly have 1.3 installed. and the PHP and MySQL % is generated in db_mysql.php
lowlight
03-10-2002, 10:20 PM
Originally posted by nakkid
GZIP library compression will be enabled only in pages where GZIP is in use. ;)
the hack is looking in the header, to see id GZIP os enabled, and dont forget that those stats are generated individually for each page. Okay so how do we make it look in the proper place? GZIP should be in use on every PHP page, shouldn't it?
lowlight
03-10-2002, 10:21 PM
Originally posted by nakkid
DEBUG mode can be turned on or off by your host.
also in the install file, you have all the variables listed there.
regards,
nakkid. I guess I worded my question wrong :)
I'd like to know if it SHOULD be turned off... If that would increase server performance... If so, I'll go do it right away :D
ok. let's try this piece of code: if (strstr($HTTP_GET_VARS['HTTP_ACCEPT_ENCODING'], 'gzip')) {
$gziptext='enabled';
} else {
$gziptext='disabled';
}let me know if it still shows disabled.
DEBUG mode is selected as default by PHP 4.0.5 and higher.
george, this is what i get on your board:
Page generated in 0.4542080 seconds (93.83% PHP - 6.17% MySQL) with 17 queries.
i reload it 10times and i never got a negative value.
i'm beginning to believe is the browser's fault.. and i'm not even neo.. hehe
eva2000
03-10-2002, 11:07 PM
Originally posted by nakkid
george, this is what i get on your board:
Page generated in 0.4542080 seconds (93.83% PHP - 6.17% MySQL) with 17 queries.
i reload it 10times and i never got a negative value.
i'm beginning to believe is the browser's fault.. and i'm not even neo.. hehe strange if i log out and do explain first time i got 0.11 for 17 queries but reloading i get 15 queries
Page generated in 0.092332 seconds with 15 queries,
spending 0.029972076416016 doing MySQL queries and 0.062359923583984 doing PHP things.
this is the query that got time reduced the most on subsequent reloads
Query: SELECT template,title
FROM template
WHERE (title IN ('forumhome_birthdaybit','error_nopermission','for umhome_pmloggedin','forumhome_welcometext','forumh ome_logoutcode','forumhome_newposts','forumhome_to dayposts','forumhome_logincode','forumhome_loggedi nuser','forumhome_loggedinusers','forumhome_lastpo stby','forumhome_moderator','forumhome_forumbit_le vel1_nopost','forumhome_forumbit_level1_post','for umhome_forumbit_level2_nopost','forumhome_forumbit _level2_post','forumhome','forumhome_unregmessage' ,'timezonelist','timezone_city','timezone_city_col ','gobutton','timezone','username_loggedout','user name_loggedin','phpinclude','headinclude','header' ,'footer','forumjumpbit','forumjump','nav_linkoff' ,'nav_linkon','navbar','nav_joiner','pagenav','pag enav_curpage','pagenav_firstlink','pagenav_lastlin k','pagenav_nextlink','pagenav_pagelink','pagenav_ prevlink')
AND (templatesetid=-1 OR templatesetid='10'))
OR (title = 'maxloggedin')
OR (title = 'birthdays')
ORDER BY templatesetid
Time before: 0.012995958328247
Time after: 0.027544975280762
Upgrade to Version 1.4 (from 1.3)
in functions.php and function dooutput(), find:global $pagestarttime,$query_count,$showqueries,$querytim e,$DB_site,$microstats;replace it with:global $pagestarttime,$query_count,$showqueries,$querytim e,$DB_site,$microstats,$HTTP_ACCEPT_ENCODING;still in dooutput(), find:if (strstr($HTTP_SERVER_VARS["HTTP_ACCEPT_ENCODING"], "gzip")) {replace it with:if (strpos(" ".$HTTP_ACCEPT_ENCODING,"gzip")) {now it will look to see if the GZIP is enabled everywhere.. :D
george, here it is:
1. Page generated in 0.7345470 seconds (96.28% PHP - 3.72% MySQL) with 15 queries.
2. Page generated in 0.8443970 seconds (96.82% PHP - 3.18% MySQL) with 15 queries.
3. Page generated in 0.6960710 seconds (71.68% PHP - 28.32% MySQL) with 15 queries.
4. Page generated in 0.9797110 seconds (66.31% PHP - 33.69% MySQL) with 15 queries.
5. Page generated in 0.6964480 seconds (96.46% PHP - 3.54% MySQL) with 15 queries.i just refreshed 5 times and posted the results.
about your time:Time before: 0.012995958328247
Time after: 0.027544975280762this is extremly small, so that means you do not call it before and after the headers. that explains the negative values in PHP and MySQL.
Originally posted by nakkid
IF YOU DOWNLOADED A PREVIOUS VERSION,
MAKE SURE YOU CLEAR YOUR TEMP FILES, CACHE AND HISTORY,
BEFORE YOU REDOWNLOAD THE UPDATED FILE!
I noticed that, when you download again an attachment, it will store it as the old install. The easiest way to see if you have the right version, is to look at the top of the file, it will say there Version 1.4. Why don't you just change the name of the file with each upgrade? It would be easier for everybody. :classic:
i tried. it will do the same, if i delete the attachment and upload a new one called vbmicrostats2.txt, if i click on the download link, it will save it as vbmicrostats.txt to my pc.. wierd huh? and btw, this was the solution firefly gave me. ;)
regards,
nakkid.
Originally posted by nakkid
i tried. it will do the same, if i delete the attachment and upload a new one called vbmicrostats2.txt, if i click on the download link, it will save it as vbmicrostats.txt to my pc.. wierd huh? and btw, this was the solution firefly gave me. ;)
regards,
nakkid. Bummer. :ponder:
works great thanks again ;)
Jawelin
03-11-2002, 08:25 AM
Originally posted by nakkid
did you modified properly db_mysql.php? the PHP percent is pulled from there.
Yes. I did from the 1.1 ver and always checked wasn't changed in any new release of your hack.
P.S.: just a question about GZIP. My server supports it (as written in phpinfo and $HTTP_ACCEPT_ENCODING...), but in my VB options I disabled it to decrease server CPU load.
1) Do you think it should displayed 'enabled' or 'disabled' in your hack ? Standing on the bare code, I guess only the server var status is checked, not the vb one too...
2) Do you think I should enable it to increase performances ? How the cpu load should be acceptably higher ?
Thanks a lot.
Jawelin
03-11-2002, 11:53 AM
Just as an addendum to point 1 just above, I used this small customization about gzip:
within: function dooutput($vartext,$sendheader=1) {
add
$gzipoutput,$gziplevel
at the end of
global .... row.
then add
if ($gzipoutput and $gziplevel)
$gziptext.=" and active (level $gziplevel)";
right after
$gziptext="enabled";
:cross-eyed:
Btw, my questions above about negative value (as eva said, mostly on the main page somethimes...) and the cpu overloading with gzip, REMAIN .... :)
Thanks a lot
Bye
very nice hack nakkid
working gr8 :)
thx
Upgrade your vbMicroStats to Version 1.5:
forum/admin/functions.php
1. in function dooutput(), find the code:global $pagestarttime,$query_count,$showqueries,$querytim e,$DB_site,$microstats,$HTTP_ACCEPT_ENCODING;repla ce it with:global $pagestarttime,$query_count,$showqueries,$querytim e,$DB_site,$gzipoutput,$gziplevel,$microstats;2. find the code:
if (strpos(" ".$HTTP_ACCEPT_ENCODING,"gzip")) {
$gziptext="enabled";
} else {
$gziptext="disabled";
}replace it with:
if ($gzipoutput==1) {
$gziptext="enabled (level $gziplevel)";
} else {
$gziptext="disabled";
}NOTE: The GZIP compression will show as enabled only if you enabled your board to use GZIP compression.
To do this, do yo your VBulletin Options > HTTP Headers and output > GZIP Output and select Yes.
Otherwise, it will show as disabled.
okrogius
03-11-2002, 10:35 PM
Originally posted by nakkid
Upgrade your vbMicroStats to Version 1.5:
forum/admin/functions.php
1. in function dooutput(), find the code:global $pagestarttime,$query_count,$showqueries,$querytim e,$DB_site,$microstats,$HTTP_ACCEPT_ENCODING;repla ce it with:global $pagestarttime,$query_count,$showqueries,$querytim e,$DB_site,$gzipoutput,$gziplevel,$microstats;2. find the code:
if (strpos(" ".$HTTP_ACCEPT_ENCODING,"gzip")) {
$gziptext="enabled";
} else {
$gziptext="disabled";
}replace it with:
if ($gzipoutput==1) {
$gziptext="enabled (level $gziplevel)";
} else {
$gziptext="disabled";
}NOTE: The GZIP compression will show as enabled only if you enabled your board to use GZIP compression.
To do this, do yo your VBulletin Options > HTTP Headers and output > GZIP Output and select Yes.
Otherwise, it will show as disabled.
Is there a clean install txt directions file telling how to isntall 1.5? If you can email it to me that would be great. oleg@gaminguru.com
just download the vbmicrostats.txt attachment. make sure you clear your history and cookies if you cannot download the latest version. i put it FREAKY YELLOW what you have to do in order to get the latest file, so you cannot miss it. ;)
also, please do not quote full code, it make your post almost unreadable.
regards,
nakkid.
Jadelit
03-11-2002, 11:51 PM
woot woot.. hehe
Page generated in 0.6007300 seconds (90.65% PHP - 9.35% MySQL) with 93 queries.
PHP version 4.1.2 (Debug mode) with GZIP library compression disabled.
Originally posted by Jadelit
woot woot.. heheyour forums look great. congrats. however, there is only one thing:
YOU REMOVED THE Jelsoft COPYRIGHT NOTICE.
please re-add it asap, as you infringe vBulletin's copyright and proper usage.
i forgot one detail (thanks Recon_Boy): 93 queries?
this is extremly high, you could crash your host's server if you have over 100 users simultaneously on your board.
check your code hacks. you have a bug there. vB.org who is loaded up to the sky with hacks, have 33 queries max.
regards,
nakkid.
Recon_Boy
03-12-2002, 12:33 AM
Originally posted by Jadelit
woot woot.. hehe
Page generated in 0.6007300 seconds (90.65% PHP - 9.35% MySQL) with 93 queries.
PHP version 4.1.2 (Debug mode) with GZIP library compression disabled.
93 queries is awful high...lol...
yeah, do what Nakkid says.
Well I realised that many of us don't want to let users see to many technical details. So in v1.6, the PHP version, Debug mode and GZIP compresion status will be visible only to admins.
A neat feature that i added was the Detailed View. Basically, it's a link that will output in details, what is happening on that page, related to PHP and MySQL. I will post a screenshoot below, so you can understand better.
1. forum/admin/functions.php
In function dooutput(), replace the previous edited code with:// ###################### Start dooutput #######################
function dooutput($vartext,$sendheader=1) {
global $pagestarttime,$query_count,$showqueries,$querytim e,$DB_site,$gzipoutput,$gziplevel,$bbuserinfo,$mic rostats;
$pageendtime=microtime();
$starttime=explode(" ",$pagestarttime);
$endtime=explode(" ",$pageendtime);
// time format (how many digits you want to show)
$digits=7;
$totaltime=$endtime[0]-$starttime[0];
$trimmedtime=number_format($totaltime,$digits);
$percentphp=number_format(((($totaltime-$querytime)/$totaltime)*100), 2)."% PHP";
$percentsql=number_format((($querytime/$totaltime)*100), 2)."% MySQL";
if ($bbuserinfo['usergroupid']==6) {
if ($gzipoutput==1) {
$gziptext="GZIP library compression enabled (level $gziplevel)";
} else {
$gziptext="GZIP library compression disabled";
}
$debugmode=(DEBUG)?" (Debug mode)":"";
$versionphp=phpversion();
$adminstats="PHP version $versionphp $debugmode with $gziptext. [<a href=\"$PHP_SELF?explain=1\" target=\"_blank\">details</a>]";
} else {
$adminstats="";
}
if ($showqueries) {
$vartext .= "<!-- Page generated in $totaltime seconds with $query_count queries -->";
} else {
eval("\$microstats = \"".gettemplate('home_microstats')."\";");
}2. home_microstats template
replace your vbMicroStats template contents with:Page generated in $trimmedtime seconds ($percentphp - $percentsql) with $query_count queries.<br>
$adminstatsif you used the $microstats variable, replace the old code with:$microstats = "Page generated in $trimmedtime seconds ($percentphp - $percentsql) with $query_count queries.<br>
$adminstats";
vbMicroStats detailed view (generated by vBulletin):
Jadelit
03-12-2002, 07:08 AM
Originally posted by nakkid
your forums look great. congrats. however, there is only one thing:
YOU REMOVED THE Jelsoft COPYRIGHT NOTICE.
please re-add it asap, as you infringe vBulletin's copyright and proper usage.
Ok done.
thank you for being professional.
all the best with your work. you deserve it, you did an amasing job there.. ;)
Jadelit
03-12-2002, 07:15 AM
thanks again =]
Jawelin
03-12-2002, 09:17 AM
Originally posted by nakkid
thank you for being professional.
Nakkid! Are you leaving or not !?!? :squareeyed:
Are the others so 'professional' ????
:cool:
Admin
03-12-2002, 09:29 AM
Originally posted by Jadelit
Ok done.
Actuall you need to state that the forum is powered by vBulletin, which is copyright Jelsoft. (you can only omit the version)
right now, when I click on the details link, I've got a nice blank page without details :(
can you again help me plz
thx
do you use some wierd java frames? you cannot get a blank page because look what i get me on your page... btw 66 queries? your server is exploding right now..
ok the details link is made of $PHP_SELF$...
and here are shots , I don't understand
sHORTYWZ
03-12-2002, 02:14 PM
OK I was having 150ish queries on my frontpage too and I finally figured out what it is.. and I imagine it's the same for most people.
The "Number of Active User's Today" hack creates a HUGE amount of queries on your frontpage (one for every user who has visited today.)
Because of this hack I have 100+ on my main page yet my thread and other forum pages are around 15-20.. just thought I'd share some wisdom =)
Originally posted by dyt4
ok the details link is made of $PHP_SELF$...i checked the attachment.. and in the file this is what i see:$PHP_SELF?explain=1check your code properly, you probably played with it.. ;)
sHORTYWZ, do you get a blank page? let me know people.
thanks.
btw, firefly have the same hack installed on the main page.. let's convince him to tell us how he did it (ofcourse on a new thread).
someone please open a thread in Help. ;)
Maybe I'm stupid :paranoid: LOL
But I didn't play with the code here is a sample of my functions.php :
// ###################### Start dooutput #######################
function dooutput($vartext,$sendheader=1) {
global $pagestarttime,$query_count,$showqueries,$querytim e,$DB_site,$gzipoutput,$gziplevel,$bbuserinfo,$mic rostats;
$pageendtime=microtime();
$starttime=explode(" ",$pagestarttime);
$endtime=explode(" ",$pageendtime);
// time format (how many digits you want to show)
$digits=7;
$totaltime=$endtime[0]-$starttime[0];
$trimmedtime=number_format($totaltime,$digits);
$percentphp=number_format(((($totaltime-$querytime)/$totaltime)*100), 2)."% PHP";
$percentsql=number_format((($querytime/$totaltime)*100), 2)."% MySQL";
if ($bbuserinfo['usergroupid']==6) {
if ($gzipoutput==1) {
$gziptext="biblioth?que GZIP disponible (niveau $gziplevel)";
} else {
$gziptext="biblioth?que GZIP non disponible";
}
$debugmode=(DEBUG)?" (Debug mode)":"";
$versionphp=phpversion();
$adminstats="Version PHP $versionphp $debugmode avec $gziptext. [<a href=\"$PHP_SELF?explain=1\" target=\"_blank\">d?tails</a>]";
} else {
$adminstats="";
}
if ($showqueries) {
$vartext .= "<!-- Page generated in $totaltime seconds with $query_count queries -->";
} else {
eval("\$microstats = \"".gettemplate('home_microstats')."\";");
}
if (!$showqueries) {
echo dovars($vartext,$sendheader);
flush();
} else {
$output=dovars($vartext,$sendheader);
echo "\n<b>Page generated in $totaltime seconds with $query_count queries,\nspending $querytime doing MySQL queries and ".($totaltime-$querytime)." doing PHP things.</b></pre>";
flush();
}
}
as you can see I didn't play with this code :classic:
you are correct. the code is perfect. and you are a smart person, never say this.. that you are stupid.
i'm sure you did a great job on installing it correctly.. however we still have that problem on hand, right?
anyone else had this problem?
PS. when you post code like that, please attach it to a .txt file due to jelsoft copyrights.. i think. firefly told me something about this. he will post a comment here i'm sure if something is wrong.. ;)
sHORTYWZ
03-12-2002, 04:33 PM
No I don't have a blank page.. everything works great for me.
Grower
03-12-2002, 06:30 PM
| Template: home_microstats (optional) |
+-----------------------------------------------+
| Do this only if you want to edit easier your vbMicroStats look.
| NOTE: This will add an extra query
You can get around that extra query if you cache microstats template in global.php around line 250:
$templatesused.=',pagenav,pagenav_curpage,pagenav_ firstlink,pagenav_lastlink,pagenav_nextlink,pagena v_pagelink,pagenav_prevlink,home_microstats';
excellent point Grower. i completly forgot about it. :D
Originally posted by Jawelin
Nakkid! Are you leaving or not !?!? :squareeyed:
Are the others so 'professional' ????
:cool: yesssss they all are.. :)
and yes i'm leaving in exacly 15min.. whohooooo!!!!!
i love to stick with vB.org.. is this dedication or what???
all the best.. i will go to internet cafe to check you guys out.. dont forget about me!!!
cheers,
nakkid.
honeymoon
you're so lucky ;)
Jadelit
03-12-2002, 10:19 PM
Originally posted by FireFly
Actuall you need to state that the forum is powered by vBulletin, which is copyright Jelsoft. (you can only omit the version)
Ok, done.. I added a little style to it also.. hehe looks nice..
Jadelit
03-12-2002, 10:23 PM
Hmm.. thats odd.. I had 93 queries but here are my stats now..
Page generated in 0.3840470 seconds (97.91% PHP - 2.09% MySQL) with 29 queries.
PHP version 4.1.2 (Debug mode) with GZIP library compression enabled (level 9). [details]
JulianD
03-13-2002, 05:04 AM
seems great... pressing the install button :)
I've tried with windows 2000 Pro and XP Pro with netscape 6.2, IE6 nothing, but with opera 6 it works ! ?
try this dyt4, in function dooutput(), in the global line add $PHP_SELF, right after $microstats. let me know.
I've tried but always the same thing :(
Gutspiller
03-14-2002, 06:25 PM
My forum front page shows this:
Page generated in 0.0918310 seconds (-669.55% PHP - 769.55% MySQL) with 92 queries.
I think it's fawkered. :(
this is extremly high.. :alien: :dead: check your hacks..
Page generated in 0.6798900 seconds (100.00% PHP - 0.00% MySQL) with 29 queries.
That seem odd to you? ;p
cerebro
03-16-2002, 07:20 PM
i install but i deleted
if ($bbuserinfo['usergroupid']==6) {
if ($gzipoutput==1) {
$gziptext="GZIP library compression enabled (level $gziplevel)";
} else {
$gziptext="GZIP library compression disabled";
}
$debugmode=(DEBUG)?" (Debug mode)":"";
$versionphp=phpversion();
$adminstats="PHP version $versionphp $debugmode with $gziptext. [<a href=\"$PHP_SELF?explain=1\" target=\"_blank\">details</a>]";
} else {
$adminstats="";
}
becauso i dont what to use that...thanks
David Bott
03-16-2002, 07:46 PM
nakkid...
Just so you know, the negative numbers seems to have something to do with the server time somehow and has nothing to do with the web browser that I can see. I say this for here is a reading from my main site page...
Page generated in 0.3543150 seconds (86.99% PHP - 13.01% MySQL) with 19 queries.
And here is a reading again from the same site after using SEARCH...
Page generated in 0.4924000 seconds (-6,852.20% PHP - 6,952.20% MySQL) with 13 queries.
Notice the speed is still all good and even less queries...But...the time it takes the server to do things it needs seems to mess things up.
Not sure why...for it does not happen on this site with the serach. But it does on my server and always seems to give a negitive when the server is taking it's time even though the page is generated quickly.
Note...my site is not small by any means...
http://www.avsforum.com/avs-vb
Hope this helps. Not sure how...But hope it does.
David Bott
AVS Forum
I'm getting the exact same problem that David Bott
==============================
Page generated in 0.7519780 seconds (-1,907.81% PHP - 2,007.81% MySQL) with 26 queries.
PHP version 4.0.5 (Debug mode) with GZIP library compression enabled (level 3).
===================================
scotty
03-17-2002, 02:01 PM
hm weired - the first few seconds everything worked fine with that hack, but round about a minute after installing it all users became this error:
Invalid SQL: INSERT INTO session (sessionhash,userid,host,useragent,lastactivity,lo cation) VALUES ('84359734a0c822c487019565d2c15f','1','80.133.*.*' ,'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;','1016380059','/board/index.php?s=')
mysql error: Duplicate entry '84359734a0c822c487019565d2c15f' for key 1
mysql error number: 1062
the error showed up in den "admin" too, when I want to shut off the board...
...what could it be?
bevor this error the microstats where correctly displayed in my footer...
Ghard296
03-18-2002, 12:31 AM
Works perfect for me! Thanks.
Originally posted by David Bott
nakkid...
Page generated in 0.4924000 seconds (-6,852.20% PHP - 6,952.20% MySQL) with 13 queries.
Notice the speed is still all good and even less queries...But...the time it takes the server to do things it needs seems to mess things up.
Hope this helps. Not sure how...But hope it does.
David Bott
AVS Forum hmm that's odd. it should be the same no matter what.. and you are right, it's related directly to the server performance, the hack reads the speed your server operate the page creation.
Jawelin
03-21-2002, 09:25 PM
Hi. As said, finally installed the 1.6 version... and worked fine...
Just recently I noticed my server changed configuration: now I see Debug Mode on and GZip disabled after a long time I used it without problem (level 1 for minimum cpu load...)
Verified even with phpinfo ... now HTTP_ACCEPT_ENCODING variable isn't present any more... :(
I'm on a shared server.
Could I change any way this configuration ? How could I verify it in php.ini ?
Thanks a lot.
Bye
Jawelin
03-21-2002, 09:58 PM
I still obtain negative values (i.e. ending times smaller than starting times in db_mysql ... :surprised: :surprised: ) !!!!
For example, on DETAILS against my forumhome page, I got something like:
Page generated in -0.484897 seconds with 36 queries,
spending 0.47043216228485 doing MySQL queries and -0.95532916228485 doing PHP things.
The same page gave these percentages:
Page generated in 0.20868 seconds (-118.92% PHP v4.1.2 - 218.92% MySQL) with 35 queries.
:dead:
Pragmatically, how could I correct in functions.php out-of-scale values of mySql times ? I though something like val % 100, but... :laugh:
Thanks
for me it's the same, installed the latest version (on vB 2.2.4), and from time to time I get negative values:
this is an result for my forum home page:
Page generated in 0.5797920 seconds (-8.82% PHP - 108.82% MySQL) with 23 queries.
PHP version 4.0.6 (Debug mode) with GZIP library compression disabled. [details]
I am sure that I hacked the files correctly (checked it several times)
Strange is that the timedisplay is positive but the percentage values are negative
I put {getmicrostats} into the footer template
Greets
JDD
wooolF[RM]
03-22-2002, 01:01 PM
same here...
cihangir
03-23-2002, 07:16 PM
same here:
Page generated in 0.0731950 seconds (-1,558.43% PHP - 1,658.43% MySQL) with 24 queries.
PHP version 4.0.6 (Debug mode) with GZIP library compression enabled (level 1). [details]
but i get negative values only on the frontpage. (installed on v2.2.4 and 'no template' Mod )
forumuser
03-23-2002, 09:38 PM
do you guys ever have a problem editing files, like some files just wont accept anymore text or something? WHat is up with that? I cant install this hack cause the file wont take anymore text
NetherChris
03-26-2002, 01:00 AM
Why does it always show Debug Mode as on? It's spefically disabled in PHP... but on all other notes this hack is WONDERFUL!
scotty
03-26-2002, 04:36 AM
please help!
----
the first few seconds after installing everything worked fine with that hack, but round about a minute after installing it all users became this error:
Invalid SQL: INSERT INTO session (sessionhash,userid,host,useragent,lastactivity,lo cation) VALUES ('84359734a0c822c487019565d2c15f','1','80.133.*.*' ,'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;','1016380059','/board/index.php?s=')
mysql error: Duplicate entry '84359734a0c822c487019565d2c15f' for key 1
mysql error number: 1062
the error showed up in den "admin" too, when I want to shut off the board...
...what could it be?
bevor this error the microstats where correctly displayed in my footer...
any suggestions?
THX!
Originally posted by JDD
for me it's the same, installed the latest version (on vB 2.2.4), and from time to time I get negative values:
Strange is that the timedisplay is positive but the percentage values are negativeit must be related to your server? i never get a negative value. the best example is vB.org site. firefly can back me up on this, because he had checked my code. ;)
Kyomu
03-26-2002, 08:37 PM
Originally posted by JDD
for me it's the same, installed the latest version (on vB 2.2.4), and from time to time I get negative values:
this is an result for my forum home page:
I am sure that I hacked the files correctly (checked it several times)
Strange is that the timedisplay is positive but the percentage values are negative
I put {getmicrostats} into the footer template
Greets
JDD
I get the same thing. I think it has to do with being in a shared environment.
Originally posted by Jawelin
I still obtain negative values (i.e. ending times smaller than starting times in db_mysql ... :surprised: :surprised: ) !!!!
For example, on DETAILS against my forumhome page...i'm convinced is a server issue Jawelin. as you see, even in unhacked (details) mode you get negativs. i wish i could do something but i cant. you should contact your host. let me know what they said.. it might help others who have the same prob.
scotty
03-26-2002, 10:39 PM
anyone suggestions for my prob?
https://vborg.vbsupport.ru/showthread.php?postid=230244#post230244
Originally posted by scotty
anyone suggestions for my prob?
https://vborg.vbsupport.ru/showthread.php?postid=230244#post230244 sessionhash probs. check your hacks.
Jawelin
03-27-2002, 08:15 AM
Originally posted by nakkid
i'm convinced is a server issue Jawelin. as you see, even in unhacked (details) mode you get negativs. i wish i could do something but i cant. you should contact your host. let me know what they said.. it might help others who have the same prob.
Yes, sure. My server is quite strange (Linux shared...). Even - thanks to your enhanced hack version - I saw they somethimes turn off the gzip for no reason ... Bah!?!?
Instead I often get a negative value on the forumhome page, with about 35 queries. Some hacks installed, but even with the original index.php and templates, the query time has often strange values.
I asked my host people, but they said it's an 'application' issue cause they use a standard MySQL configuration... :rolleyes:
Pragmatically, I would findout a simple way to re-scale strange values with a not-totally-random algorithm... :classic:
I though to 'sql time % 100', but it's too empiric.... :p
Do you have any better idea ?
Thanks and welcome back. As you can see, Nakkid, your work became very popular... :squareeyed:
Bye
lowlight
03-27-2002, 11:32 AM
So what's a good stat to have?
Most of my pages are like this:
Page generated in 0.5019860 seconds (91.89% PHP - 8.11% MySQL) with 22 queries.
I guess it's good that MySQL isn't bogging down right? :)
looks good to me.. your stats are solid. not to many queries (very important for your server - keep it under 40)
Originally posted by Jawelin
Pragmatically, I would findout a simple way to re-scale strange values with a not-totally-random algorithm... :classic:
I though to 'sql time % 100', but it's too empiric.... :p
Do you have any better idea ?install a test board with no hacks. this way you will see exacly where is the bug related to your server.
the way your host twisted the answer made me laugh. application prob? hmmm well, with a plain board installed there is nothing thay can commnet on it. i guarantee you will get the same probs. let me know please how it went. :)
lowlight
03-27-2002, 12:47 PM
Originally posted by nakkid
looks good to me.. your stats are solid. not to many queries (very important for your server - keep it under 40) Yeah I want to keep everything running nicely... I have PHP-Accelerator installed, and MOD_GZIP... I hope all that helps, because I am going to make my site into a full dynamically-served site!
Wish me luck :D
Hi...
I have examined the code a little bit deeper, and I got a solution for these negative value problems, I think.
In my opinion it is a little bug in your hack. I figured out that my pagestarttime was always set to zero.
This is caused in global.php:
if (isset($explain)) {
$showqueries=1;
}
if (isset($showqueries)) {
$pagestarttime=microtime();
}
so it will only be set if showqueries is set.
I changed it to:
$pagestarttime=microtime();
if (isset($explain)) {
$showqueries=1;
}
if (isset($showqueries)) {
$pagestarttime=microtime();
}
so.. with this I got a start time. But there is an other little problem in functions.php.
replace this:
// time format (how many digits you want to show)
$digits=7;
$totaltime=$endtime[0]-$starttime[0];
$trimmedtime=number_format($totaltime,$digits);
$percentphp=number_format(((($totaltime-$querytime)/$totaltime)*100), 2)."% PHP";
$percentsql=number_format((($querytime/$totaltime)*100), 2)."% MySQL";
with
// time format (how many digits you want to show)
$digits=7;
$totaltime=$endtime[0]-$starttime[0]+$endtime[1]-$starttime[1];
$trimmedtime=number_format($totaltime,$digits);
$percentphp=number_format(((($totaltime-$querytime)/$totaltime)*100), 2)."% PHP";
$percentsql=number_format((($querytime/$totaltime)*100), 2)."% MySQL";
and now it should work perfectly, at least for me it does :)
Greets
JDD
If this may be wrong, just inform me and I edit this (but I think it should solve the problem)
$totaltime=$endtime[0]-$starttime[0]+$endtime[1]-$starttime[1];initially, that's what i had in my hack, but the numbers were most of the time messed.. that was the issue i debated with firefly. he did the same thing here at vB.org. i cannot explain it why but this will work only in 20% of servers. as you see, there are alot of users who dont have this problem at all.. so i decided to leave it the way it is. firefly even went deeper then you think, by contacting a develloper at vB.com just to get an answer to the mistery.
leave the rest unchanged, it should work fine, the starttime must be set to zero.
initially, that's what i had in my hack, but the numbers were most of the time messed..
jepp, no wonder if starttime is allways set to zero. You would get funny looking huge values most of the time ;) (exactly the difference to 1.1.1970 :D) btw. how do you calculate times over 1 sec with not handling the seconds part of microtime at all in your totaltime?
leave the rest unchanged, it should work fine, the starttime must be set to zero.
sorry to disagree here as well... But if starttime is set to zero you will never get correct values.. The reason why the mysql part works is easy. You don't subtract the endtime from the starttime directly but go over some interims vars (beforetime, aftertime), so the starttime part isn't invovled in the calculating at all.
So, just give my modifications a chance and try them out, you'll see they would work. I have no clue why it is working on vB.org, but I doubt they use your code in it's original form.
This is btw. a really nice hack - I like it very much therefore I tried to make it work and excamined it a little bit more than usual.
JDD
Jawelin
03-28-2002, 08:03 AM
Extension: how could I use a similar replacement variable (or at least similar calculation) to show stats of some AdminCP pages ?
Note: db_mysql.php vars are of course always present (saw appending &explain=1 to the query_string) ....
I tried to call dooutput(" ", 0) just before the end of AdminCP page and then use $microstats variable (correctly set), but got an unexpected behavior of that function...
I saw unprintable chars .... for example.
Thnx
Jawelin
03-28-2002, 08:25 AM
Originally posted by JDD
$totaltime=$endtime[0]-$starttime[0]+$endtime[1]-$starttime[1];
I noticed a possible incongruence (or simply an algorithm I can't understand... :ogre:) between the original - corrected by FF - time calculation of functions.php and the same calc within db_mysql.php, where both are made with:
$beforetime=$endtime[0]-$starttime[0]+$endtime[1]-$starttime[1];
.
.
.
$aftertime=$endtime[0]-$starttime[0]+$endtime[1]-$starttime[1];
:eek:
Thnx
Hi...
I noticed a possible incongruence (or simply an algorithm I can't understand... ) between the original - corrected by FF - time calculation of functions.php and the same calc within db_mysql.php, where both are made with
yes there is possible an incongruence, if global.php is called more than once to generate a page, the starttime var would be set to a different value (if global.php is only called once the startime would be of the same value during the whole calculation)
For the endtime var it doesn't matter because it is always set to the current time just before it is used. So only starttime could be a prob, I have a solution for it to fix.. just sent me a pm so we could try it out (unfortunately I couldn't test it, because the ftp server of my webpage is currently down, therefore I don't post it because I am not sure that it does work 100%)
JDD
Jawelin
03-28-2002, 12:28 PM
Originally posted by nakkid
install a test board with no hacks. this way you will see exacly where is the bug related to your server.
Actually I don't think it depends on installed hacks...
Let me try. Looking at php.net manual for microtime() (http://www.php.net/manual/en/function.microtime.php) I tried to use that sample function
function getmicrotime(){
list($usec, $sec) = explode(" ",microtime());
return ((float)$usec + (float)$sec);
}
to measure my sample page (with many sql queries) loading time.
Well.
I got values of about 3-4 seconds, nearest to the actual latency time before displaying on a fast connection... many more than 0.7 seconds displayed by { getmicrostats } function at the end of the same page...
:ermm:
Heeeellllllllpppppppp !!!!!!!! :squareeyed:
Originally posted by JDD
You would get funny looking huge values most of the time ;) (exactly the difference to 1.1.1970)that's what i got. then i shortenned the code and it worked ok.
Originally posted by JDD
So, just give my modifications a chance and try them out, you'll see they would work. I have no clue why it is working on vB.org, but I doubt they use your code in it's original form.FireFly uses the code i posted, except that it has the full start-endtime line the way it was defaulted (not mines). it doesnt have the starttime mod in global.php. i will set it as you mention tonite at home and if ok, i will add it to the hack.. ;)
also, what time values you get when you load the page? can you post a website so i see the way it works on your server?
Originally posted by Jawelin
I noticed a possible incongruence (or simply an algorithm I can't understand... :ogre:) between the original - corrected by FF - ...just to clear things up Jawelin. this hack was verified by FireFly, not edited. all hack is written by me, except the PHP-MySQL% addon (made by FireFly, with proper credit in the .txt file). he also explained to me what is the proper way to call the {microstats} variable anywhere.
Jawelin
03-28-2002, 08:28 PM
Originally posted by nakkid
just to clear things up Jawelin. this hack was verified by FireFly, not edited. all hack is written by me
[...]
Thanks for having pointed it out, np, but I just was talking about the algorithm... and I was talking to you, of course.
Referred to FF only to identify the original hack and distinguish it from the variant by JDD. That's all.
Btw, as I repeat, the 'empirical' way following the php.net gave numbers about 5-7 times larger than microstats values...
That's my question.
;)
Thnx
This upgrade will fix the negative values some users get when loading a page.
CREDITS:
JDD (https://vborg.vbsupport.ru/member.php?s=&action=getinfo&userid=195)
pagestarttime addon in global.php
VB2.2.4 forum/global.php (2 changes)
1. Find the code:if (isset($showqueries)) {
$pagestarttime=microtime();
}Replace it with:$pagestarttime=microtime();2. Find the code:$templatesused.=',pagenav,pagenav_curpage,pag enav_firstlink,pagenav_lastlink,pagenav_nextlink,p agenav_pagelink,pagenav_prevlink';Replace it with:$templatesused.=',pagenav,pagenav_curpage,pag enav_firstlink,pagenav_lastlink,pagenav_nextlink,p agenav_pagelink,pagenav_prevlink,home_microstats'; forum/admin/functions.php (1 change)
1. Find the code:$totaltime=$endtime[0]-$starttime[0];Replace it with:$totaltime=$endtime[0]-$starttime[0]+$endtime[1]-$starttime[1];
wooolF[RM]
03-29-2002, 01:08 AM
]works great :) thanx :)
David Bott
03-29-2002, 01:12 AM
At this point I can say I have not seen a negitive number with the fix above. Thank you.
i modified a little the $pagestarttime code JDD posted initially.
let's hope that will cure all the probs...... ;)
Kyomu
03-29-2002, 02:47 AM
Originally posted by nakkid
This upgrade will fix the negative values some users get when loading a page.
CREDITS:
JDD (https://vborg.vbsupport.ru/member.php?s=&action=getinfo&userid=195)
pagestarttime addon in global.php
forum/global.php (2 changes)
1. Find the code:if (isset($showqueries)) {
$pagestarttime=microtime();
}Replace it with:if (isset($showqueries)) {
$pagestarttime=microtime();
} else {
$pagestarttime=microtime();
}
Can't that just be replaced with $pagestarttime=microtime();
Either case of the if statement will yield that code... so there really is no need for the if statement. Right?
$showqueries is present and it asks for microtime.. the rest is for my hack.. :)
i did it this way so you dont get any wierd errors if u miss isset. i like to leave VB unchanged in those areas.. you never know where it can hit you with an error. leave it this way, it will not hurt nothing.
Originally posted by nakkid
This upgrade will fix the negative values some users get when loading a page.That did the trick! Thank you. :classic:
Admin
03-29-2002, 06:33 AM
Originally posted by nakkid
$showqueries is present and it asks for microtime.. the rest is for my hack.. :)
i did it this way so you dont get any wierd errors if u miss isset. i like to leave VB unchanged in those areas.. you never know where it can hit you with an error. leave it this way, it will not hurt nothing.
He's right though, it really doesn't matter. It's like:
if ($me == $you) {
echo 'yea';
} else {
echo 'yea';
}
No matter what it will echo yea, so you better just remove the if statement.
Renegade
03-29-2002, 09:39 AM
Very cool hack, especially when debugging the board.
Originally posted by FireFly
He's right though, it really doesn't matter.done, removed the code. wasnt sure if it would not affect anything.. ;)
in other order of ideas... can you post if there are still any negative values present at all time?
thanks.
Jawelin
03-30-2002, 07:51 AM
Originally posted by nakkid
in other order of ideas... can you post if there are still any negative values present at all time?
thanks.
Nakkid, here I'm.
Since installed 1.7 I never got negative values any more, even on the forumhome... :knockedout:
Still I'm receiveing strange values for time. As JDD said before perhaps due to global.php reloaded many times (so even the pagestarttime many times reset), I always get too small values for microseconds elapsed. :(
I made this check:
created a function getmicrotime() to expand seconds and microseconds, as sampled on php.net
put a $customstartpage=getmicrotime() at the top of a php page
put a $customstoptime = getmicrotime() at the end of an action
displayed the difference near the { getmicrostats } replacement variable
...
Well. $customdifference values are MUCH larger than the {gms} variable one !!! (about an order... i.e. 10 vs. 1 !!! )
How could I force the pagestarttime reset only at the very beginning of the page and not other times within ????
Thanks again for all your upgrades and support .
Bye
hmm.. did you tried the simple plain microtime? instead of exploding it like at php.net?
Jawelin
03-30-2002, 11:28 AM
Originally posted by nakkid
hmm.. did you tried the simple plain microtime? instead of exploding it like at php.net?
No... See Post #174 (https://vborg.vbsupport.ru/showthread.php?postid=233674#post233674) above...
I put that getmicrotime() function in functions.php and used it both times, for start and stop time.
Even used strange var names to be sure they weren't messing anything.
And got a final global difference of about 4-6 seconds... The same page, at the end, I see the {gms} var about 0.56xxxxx seconds.
That's very strange...
:confused:
Thanks
strange indeed. so you get those values only with the microtime from php.net? as a .php file? or part of vBulletin?
Viruseater
03-31-2002, 01:35 AM
I read this thread. Well I skipped through it, looking for an error like I'm getting. Didn't see one so I'm posting about it.
I've installed this hack on my webserver. it's pulling some strange information.
here's the results of the query.
Page generated in 1,017,549,010.701014 seconds (100.00% PHP - 0.00% MySQL) with 21 queries.
Don't think I need to define much, pretty self explanitory.
I'm converting a few UBB's over to vBulletin since I just bought it. (bring 5 UBB's down, and combining them into one VB.
I've hacked the crud out of the UBB's but most of what I want in the boards are already here in VB.
I'm sure it's a newbie thing. Just don't know where to go. I've completed the import of my threads and users, but just cannot figure this out, and want to resolve it before i go to production. You can see the test bed here:
www.clanservers.net/forumtest
If this has already been addressed, I apologize, and if someone could link me to where it's resolved I'd be very greatful.
V
Viruseater
03-31-2002, 01:38 AM
and before anyone says how ugly the individual categories are inside, heehe I know, but I don't care about looks on this board, just functionality. So I'll correct the themes when I get everything working.
Originally posted by Viruseater
Page generated in 1,017,549,010.701014 seconds (100.00% PHP - 0.00% MySQL) with 21 queries.you forgot to edit properly your global.php
check the file.
Originally posted by Viruseater
here's the results of the query.
Page generated in 1,017,549,010.701014 seconds (100.00% PHP - 0.00% MySQL) with 21 queries.
You hacked the wrong file. You will get that result if you modify admin/global.php instead of the global.php in the forums root. I know, I found out the hard way. :)
Viruseater
03-31-2002, 03:46 AM
That sounds like exactly what I likely did.
Doesn't make sense to me that there'd be duplicate file names like that, but I'm no coder, so I'll keep my mouth shut prior to making a fool of myself.
I found another error, so I wiped the entire board, and am setting it up again, so I'll hack the right file now :p
thanks for the replies!
Viruseater, check your code. you get those values only because vB is looking for $pagestarttime and it can't find it.
if you check all the steps carefully, you will see your mistake.
regards,
nakkid.
Jawelin
03-31-2002, 12:09 PM
Originally posted by nakkid
strange indeed. so you get those values only with the microtime from php.net? as a .php file? or part of vBulletin?
Nakkid, yes, I used VBulletin files, double checked your v1.7 hack
statements against my modified files. Last, as said, I put the
getmicrotime() function in admin/functions.php exactly
as it's described on www.php.net
This is exactly what I did: I used two files index.php, called
index224_plain.php and index224_hackd.php and uploaded to
forum home dir, respectively the original 2.2.4 version and the
hacked one.
Both with some mods:
// just after
require('./global.php');
// put
$custompagebeginmicrotime = (float)getmicrotime();
// Then, in 4-5 different points of the two files (same points), i put these two rows:
$bulkloadmicrotime = number_format(getmicrotime()-$custompagebeginmicrotime,7);
echo "<font size=1 face='arial'>Bulk load microtime [qrs=$query_count] (xxxx breakpoint identification) = <b>$bulkloadmicrotime</b></font><br>";
Besides, in global.php with an echo "<h1>Pagestarttime Global reset</h1>"
just after the $pagestarttime=microtime() at the beginning
of the page, I ensured that script is called only ONCE by index.php...
Note: last two days, for some unexplained reason, my server
disabled GZip and any other encoding ... I hope it's a short time event... :(
PLAIN index.php
---------------
Bulk load microtime [qrs=6] (start time) = 0.0000969
Bulk load microtime [qrs=13] (after processing main SELECT group) = 0.0069339
Bulk load microtime [qrs=19] (after processing most SELECTs and some templates) = 0.0228729
Bulk load microtime [qrs=19] (before processing main template) = 0.0863299
{ getmicrostats }= Page (81.17% PHP + 18.83% MySQL) with 19 queries generated in 0.1926436
Bulk load microtime [qrs=20] (after processing all templates) = 0.7915579
HACKED index.php
----------------
Bulk load microtime [qrs=6] (start time) = 0.0000930
Bulk load microtime [qrs=26] (after processing main SELECT group) = 0.5236299
Bulk load microtime [qrs=33] (after processing most SELECTs and some templates) = 0.5396340
Bulk load microtime [qrs=38] (before processing main template) = 0.6587319
{ getmicrostats }= Page (20.74% PHP + 79.26% MySQL) with 38 queries generated in 0.7506131
Bulk load microtime [qrs=39] (after processing all templates) = 2.1796360
As you can see, the results pointed out most of the page time is
taken by the forumhome template processing. Much more than all
the SELECTs (38 with hacks, 19 with the plain version). And the
{ getmicrostats } is evalued BEFORE the
template is loaded and processed. Infact that value is almost
similar to mine as computed immediately before the eval
("forumhome template").
Of course, the doubled number of queries in the hacked version
reversed also the percentage ratio of php vs. sql ...
Interesting, isn't it ? :)
Hope I was able to explain myself
:stupid:
Thanks.
i dont know what to say Jawelin. anyone else have the same problem? so far everyone is really happy with 1.7...
Viruseater
04-01-2002, 02:48 AM
Got it worked out Nakkid, thanks.
I've got 1.6 running on the current board, which I just put into production. www.clanservers.net/forum and I'll do the upgrade next.
Like the hack, and it's got some great debug features.
great job
Jawelin
04-01-2002, 09:12 AM
Originally posted by nakkid
i dont know what to say Jawelin. anyone else have the same problem? so far everyone is really happy with 1.7...
Absolutely NO PROBLEM, Nakkid.
I went deeper only to investigate better why times reported are so different each other.
As said before, version 1.7 is absolutely stable and works perfectly... Never had negative (or > 100) values any more...
Even, I verified global.php is called only once.
The strange even is the greatest processing time is taken by the 'eval ... forumhome template', not by my 38 queries on the homepage.... :nervous: :nervous:
Thanks again for support.
I exposed my search results only to have some number to talk about.
Bye
Originally posted by Jawelin
As said before, version 1.7 is absolutely stable and works perfectly... Never had negative (or > 100) values any more...
Even, I verified global.php is called only once.ok.. just wanted to make sure i understood you corectly. ;)
just another little question about time I obtain always page generated in between 0.5 and 1.5 seconds . But I look at my watch it's often 10 or 20 seconds with my ISDN connection and 2 seconds with my DSL connection at work ???
do you have v1.7 installed?
on my localhost (no internet connection) i got up to 2.600000seconds to load a page, depending what i was doing.
look here at vB.org:
Page generated in 5.97940302 seconds (74.72% PHP - 25.28% MySQL) with 38 queries.
Jawelin
04-02-2002, 07:55 PM
I definetively don't think the connection speed could affect any way the page generation time on the server side (i.e. php + sql time ARE server times)....
:)
I'm talking about different measurements of the same server-side time in different page 'breakpoints'... let's say.
actually it depends a little in your pc performance. if you have a slow pc, the time it takes to load the page will reflect it. ;)
i did a test, on several pc's, at work... to load vB.org. i got different values (huge ones) on winXP, win2k and win98 (P4, P2 and AMD). here there are the results:
win98(AMD) - 4.00 seconds
win2k(P2) - 2.00 seconds
winXP(P4) - 0.80 seconds
internet connection: T1 (all cases)
Admin
04-04-2002, 05:16 AM
Actually nakkid it has nothing to do with that. From the second the server gets a request for the PHP page the parser is doing all the work, not your computer.
this is wierd. i wonder why i got those stats. all pc's were connected to the same network.
thanks for the explanation firefly.
Legacy
04-07-2002, 04:14 AM
Page generated in 1,018,162,977.218 seconds(100.00% PHP - 0.00% MySQL) with 28 queries.
PHP version 4.1.2 (Debug mode) with GZIP library compression enabled (level 2). [details]
MySQL always comes up 0.00%...anyone know why??
yes. edit properly global.php
| 1. Find this code:
+--------------------------------------------------------------------------+
if (isset($showqueries)) {
$pagestarttime=microtime();
}
+--------------------------------------------------------------------------+
|
+-----------------------------------------------+
| Replace it with:
+--------------------------------------------------------------------------+
$pagestarttime=microtime();
+--------------------------------------------------------------------------+
Legacy
04-07-2002, 04:19 AM
Yup...just saw that thread.....thx
Originally posted by Legacy
Page generated in 1,018,162,977.218 seconds(100.00% PHP - 0.00% MySQL) with 28 queries.
PHP version 4.1.2 (Debug mode) with GZIP library compression enabled (level 2). [details]
MySQL always comes up 0.00%...anyone know why?? You modified admin/global.php instead of global.php in the forums root directory. Take the mods out of admin/global.php and add them to forums/global.php.
good point FWC. although.. is indicated in the install file clearly:+-----------------------------------------------+
| File: forum/global.php (2 changes) |
+-----------------------------------------------+
| 1. Find this code:
+--------------------------------------------------------------------------+
if (isset($showqueries)) {
$pagestarttime=microtime();
}
+--------------------------------------------------------------------------+
|
+-----------------------------------------------+
| Replace it with:
+--------------------------------------------------------------------------+
$pagestarttime=microtime();
+--------------------------------------------------------------------------+:)
Originally posted by nakkid
good point FWC. although.. is indicated in the install file clearly Yep. But, I made the same mistake so I know the cause of the symptom when I see it. :)
Legacy
04-07-2002, 04:41 AM
I Edited the correct file..Problem is what your file is telling me and what my 2 Global files say are Diffrent
im on 2.2.5 and I just re-dl the VB files..
if (isset($showqueries)) {
$pagestarttime=microtime();
}
is in the /admin/global.php
My /forum/global.php has this
if (isset($showqueries)) {
$pagestarttime = microtime();
} else {
$pagestarttime = 0;
}
Thes came straight from VB where i just DL the files from
vBulletin v2.2.5 Update
In the new VB version, there is a little minor change in forum/global.php.
Find the code:if (isset($showqueries)) {
$pagestarttime = microtime();
} else {
$pagestarttime = 0;
}Replace it with:$pagestarttime = microtime();
Viruseater
04-07-2002, 04:48 AM
Read back the rest of the thread.
You have to edit the global.php file if you've got 1.7 I don't think 1.6 instructs that.
FYI make sure you don't hack the one in the wrong directory, that's what I did.
Anyway, that's why it's giving yout those stats, like I said, read the thread, it's already been answered
Viruseater.. he's right. 225 changed. :ermm:
Legacy
04-07-2002, 04:50 AM
That did the trick nakkid
Great Hack...thx for the Support...
Page generated in 0.277 seconds(78.57% PHP - 21.43% MySQL) with 28 queries.
PHP version 4.1.2 (Debug mode) with GZIP library compression enabled (level 2). [details]
Viruseater
04-07-2002, 04:55 AM
Originally posted by nakkid
Viruseater.. he's right. 225 changed. :ermm:
Well crap.
Looks like I'm the one that needs to re-read the thread. Sorry.
:D
dont worry.. :) i did this mistake one zillion times.. :D
Originally posted by nakkid
dont worry.. :) i did this mistake one zillion times.. :D Damn, that's one more than me! :)
NTLDR
04-10-2002, 10:13 PM
Hi nakkid,
I've tried loads of times to install this hack, on both a fresh install of 2.2.5 and a hacked install of 2.2.4.
I've tried manually applying the hack... and creating a vbhacker file to make the changes, but I've yet to get it working, I know the hack works as its on so many other forums.
I've attached a screenshout of the output I get on a fresh unhacked (other than the vbmicrostats hack) 2.2.5 install, any ideas on what I'm doing wrong?
Thanks In Advance,
Lee
Xelation
04-10-2002, 11:12 PM
um nakkid, when I go to put the {getmicrostats} in the footer... this is what comes up...
Powered by: vBulletin Version 2.2.5
Copyright ©2000, 2001, Jelsoft Enterprises Limited.
{getmicrostats}
you know whats wrong?
Xanthine
04-10-2002, 11:18 PM
Sounds like you forgot to add something to your replacements?
*edit* Maybe not, I dont see a step to add them in the install file. Not sure now.
NTLDR
04-10-2002, 11:52 PM
Originally posted by Xelation
um nakkid, when I go to put the {getmicrostats} in the footer... this is what comes up...
Powered by: vBulletin Version 2.2.5
Copyright ?2000, 2001, Jelsoft Enterprises Limited.
{getmicrostats}
you know whats wrong?
Thats the same as what I get (see the screen shot on the last page), but my templates don't work properly either though :(
I don't think this hack likes me :p
i just installed the hack in v225, following at letter the instructions included in the text file. it works perfectly. please check your steps carefully, especially the files you have to edit (forum/global.php and NOT forum/admin/global.php)
NTLDR
04-11-2002, 01:06 PM
Hi nakkid,
I've tried installing it again, and I know I've edited the correct files, the part that is causing the error for me is replacing the follwoing in admin/fuctions.php:
This:
// ###################### Start dovars #######################
function dovars($newtext,$sendheader=1) {
// parses replacement vars
global $DB_site,$replacementsetid,$gzipoutput,$gziplevel, $newpmmsg;
static $vars;
if (connection_status()) {
exit;
}
if (!isset($vars)) {
$vars=$DB_site->query("SELECT findword,replaceword FROM replacement WHERE replacementsetid IN(-1,'$replacementsetid') ORDER BY replacementsetid DESC,replacementid DESC");
} else {
$DB_site->data_seek(0,$vars);
}
while ($var=$DB_site->fetch_array($vars)) {
if ($var['findword']!="") {
$newtext=str_replace($var['findword'],$var['replaceword'],$newtext);
}
}
With This:
// ###################### Start dovars #######################
function dovars($newtext,$sendheader=1) {
// parses replacement vars
global $DB_site,$replacementsetid,$gzipoutput,$gziplevel, $newpmmsg,$microstats;
static $vars;
if (connection_status()) {
exit;
}
if (!isset($vars)) {
$vars=$DB_site->query("SELECT findword,replaceword FROM replacement WHERE replacementsetid IN(-1,'$replacementsetid') ORDER BY replacementsetid DESC,replacementid DESC");
} else {
$DB_site->data_seek(0,$vars);
}
$findwords=array(0 => '{getmicrostats}');
$replacewords=array(0 => $microstats);
$i=1;
while ($var=$DB_site->fetch_array($vars) and $i++) {
if ($var['findword']!="") {
$findwords[$i]=$var['findword'];
$replacewords[$i]=$var['replaceword'];
}
}
$newtext=str_replace($findwords,$replacewords,$new text);
Which causes my templates not to work and my forums look like this https://vborg.vbsupport.ru/attachment.php?s=&postid=239359 (Screen Shot From Earlier Post).
I know I must be doing something stupid for it not to work!
it should not give you any trouble. there are several people who installed this hack and they didnt encountered any problem. check the install steps. i would compare the files and follow slowly the code to identify the problem. let me know if you found the bug. :)
hypedave
04-11-2002, 04:44 PM
okay I just installed this hack and I am stumped at this point
what does no templete mode mean ???
then where exactly do I place {getmicrostats}
forgive me, I have been up for quite some time, I think it time for me go to bed, lol. as a normal day I would have this figured out
+-----------------------------------------------+
| 'no template' Mod |
+-----------------------------------------------+
| Find this code:
+--------------------------------------------------------------------------+
eval("\$microstats = \"".gettemplate('home_microstats')."\";");
+--------------------------------------------------------------------------+
|
+-----------------------------------------------+
| Replace it with:
+--------------------------------------------------------------------------+
$microstats = "Page generated in $trimmedtime seconds ($percentphp - $percentsql) with $query_count queries.<br>
$adminstats";
+--------------------------------------------------------------------------+
|
|
+-----------------------------------------------+
| FINAL STEPS |
+-----------------------------------------------+
| To call your vbMicroStats, simply place the string {getmicrostats}
| anywhere you want in your templates (for example in footer).
|
| NOTE: The higher you place the string in your templates,
| the more inacurate your data will be.
|
| The variables you can use are:
|
| $digits - number of digits for microtime
| $trimmedtime - the time your page is loaded
| $query_count - number of queries executed
| $versionphp - PHP version
| $percentphp - PHP percent page usage
| $percentsql - MySQL percent page usage
| $gziptext - GZIP compression library
| $gziplevel - GZIP compression level
| $debugmode - script Debug mode
|
| NOTE: If you want to have more(less) then 7 digits in your microtime,
| change the value '7' to what ever suits better your forum.
|
|
| Upload the modified files. You are done.
+--------------------------------------------------------------------------+
NTLDR
04-11-2002, 04:49 PM
Well I've narrowed it down to being a problem with replacing
This Code:
while ($var=$DB_site->fetch_array($vars)) {
if ($var['findword']!="") {
$newtext=str_replace($var['findword'],$var['replaceword'],$newtext);
}
}
With This Code:
while ($var=$DB_site->fetch_array($vars) and $i++) {
if ($var['findword']!="") {
$findwords[$i]=$var['findword'];
$replacewords[$i]=$var['replaceword'];
}
}
$newtext=str_replace($findwords,$replacewords,$new text);
In particualr, removing this line:
$newtext=str_replace($var['findword'],$var['replaceword'],$newtext);
Which stops all my replacements working and I get what was in that screen shot.
The worst thing is I know this hack works as many other people use it!!
please install vbMicroStats in a unhacked test board. you will see it works. i always test my hacks on a unhacked board. let me know please how it went.
NTLDR
04-11-2002, 09:20 PM
Originally posted by nakkid
please install vbMicroStats in a unhacked test board. you will see it works. i always test my hacks on a unhacked board. let me know please how it went.
Hi nakkid,
Not sure if you were saything this to me or not, but that was what I got on a unhacked 2.2.5 board and the problem above was what I got :(
Thanks for your help,
Regards,
Lee
hypedave
04-11-2002, 09:27 PM
Originally posted by nakkid
please install vbMicroStats in a unhacked test board. you will see it works. i always test my hacks on a unhacked board. let me know please how it went.
okay I tryed this on my unhacked board
and my hacked board
is you instructions when it gets to this part here
| 'no template' Mod
thats where I am lost
from
| 'no template' Mod
on down
NTLDR
04-11-2002, 10:35 PM
Originally posted by hypedave
okay I tryed this on my unhacked board
and my hacked board
is you instructions when it gets to this part here
| 'no template' Mod
thats where I am lost
from
| 'no template' Mod
on down
You ahve 2 choices, either hard code the display into the fuctions.php file or add a template, if you have followed the instructions to that point, just create a template in your admin cp called home_microstats and put the following in it:
$microstats = "Page generated in $trimmedtime seconds ($percentphp - $percentsql) with $query_count queries.<br>
$adminstats";
Then hopefully it will work for you! Unlike mine, lol
correct. is up to you to chose the one you want. any of them will work. ;)
be aware please, you posted the information in the wrong way. if you do this and post the code you mentioned above:
$microstats = "Page generated in $trimmedtime seconds ($percentphp - $percentsql) with $query_count queries.<br>
$adminstats";your template will not be displayed properly. the code segment you listed is for the option that you have to hardcode into the forum/global.php file.
hypedave
04-11-2002, 11:02 PM
thankyou, thankyou
Page generated in 0.7612060 seconds (82.86% PHP - 17.14% MySQL) with 37 queries.
PHP version 4.0.6 (Debug mode) with GZIP library compression enabled (level 1). [details]
i'm glad you got it working. good luck with your site. :)
although, try to keep your queries under 40, if you dont want to see your host knocking at your door... :D
hypedave
04-11-2002, 11:08 PM
Originally posted by nakkid
i'm glad you got it working. good luck with your site. :)
although, try to keep your queries under 40, if you dont want to see your host knocking at your door... :D
heheh what you talking bout willis, im my own host hehehe\
but how would i keep queries under 40
reduce the number of queries by removing any unnecessary hacks.
vbPortals is known for adding a huge amount of queries to your main page. the optimal no. of queries for a board is max. 40. after that you start to get your server on the red side. immagine that you have 1000 users and they proccess 60queries at the same time. that's 60,000 queries in the same fraction of time. that can double easy if they do a mix between the frontpage (average 90 queries for vbPortal) and vBulletin.
wajones did an excellent job with the portal, but in my personal oppinion i think it puts alot of stress on the server.
try this, place {getmicrostats} in your homepage. let me know the results. ;)
also keep in mind that an unhacked board have only 17queries.
NTLDR
04-11-2002, 11:17 PM
I'm getting no where with this hack :(
Would it be posible for someone to send me the changed files so I could compare them with what I've got?
I know I'm doing something wrong, I just can see what! I've followed all the instructions and tried 20+ times to get this hack working on a non-hacked board.
Thanks In Advance,
Lee
hypedave
04-11-2002, 11:25 PM
Originally posted by nakkid
reduce the number of queries by removing any unnecessary hacks.
vbPortals is known for adding a huge amount of queries to your main page. the optimal no. of queries for a board is max. 40. after that you start to get your server on the red side. immagine that you have 1000 users and they proccess 60queries at the same time. that's 60,000 queries in the same fraction of time. that can double easy if they do a mix between the frontpage (average 90 queries for vbPortal) and vBulletin.
wajones did an excellent job with the portal, but in my personal oppinion i think it puts alot of stress on the server.
try this, place {getmicrostats} in your homepage. let me know the results. ;)
also keep in mind that an unhacked board have only 17queries.
that was my forums homepage
hypedave
04-11-2002, 11:31 PM
well this is what I got on the acutal main page ( vbportals )
Page generated in 0.5270550 seconds (92.09% PHP - 7.91% MySQL) with 9 queries.
PHP version 4.0.6 (Debug mode) with GZIP library compression enabled (level 1). [details]
wow.. that's great, wajones changed the code structure?? i used to see people here posting that they got 120queries... i never installed vbPortals.
NTLDR, add me to your messenger. i will help you. ;)
hypedave
04-11-2002, 11:41 PM
yeah vbportals has been nothing but succes for my site
hypedave
04-11-2002, 11:45 PM
ok I will add you to my buddy list
NTLDR
04-12-2002, 05:45 PM
Originally posted by nakkid
NTLDR, add me to your messenger. i will help you. ;)
Sorry its taken me so long to get back to you nakkid, I ended up falling asleep before I read your reply last night :)
If the offer of help still stands I've added you to my Messenger contact list.
Thank You
Lee
np lee. just contact me. i will help you install this hack. is my pleasure to give you a hand on this issue.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.