PDA

View Full Version : VB3 MicroStats


Pages : [1] 2

TECK
03-04-2004, 10:00 PM
You asked for... but it was available for VB2 only (https://vborg.vbsupport.ru/showthread.php?t=35811)? There you go, you have it now. ;)

Looking for 3.5.4 version? Get it here (https://vborg.vbsupport.ru/showthread.php?t=116027).

VERSION 1.2 RELEASED
Basically the only difference you will notice is a dropdown menu that will display the unchached templates.
In this way, you can add it to the cache and save one or more queries.

THIS HACK WAS TESTED IN A DEFAULT, CODE UNMODIFIED BOARD.

This hack will add at the bottom of each vBulletin(powered) page the following stats:
REGULAR USERS STATS
- load time of specified page in microseconds (with custom no. of digits to show)
- percentages of PHP/MySQL usage
- number of queries executed

ADMINISTRATOR STATS
- number/name of uncached templates (name highlighted in blue, for uncached template)
- vBulletin DEBUG mode status
- server GZIP library compression status
- average Server Loads

This is not only estethic, it will also help you troubleshoot any wierd queries that you have in your scripts.

IMPORTANT
If you get results like:
Page generated in 3.35731196 seconds (9.05% PHP - 90.95% MySQL) with 17 queries
You probably use a bad piece of code, because vBulletin will never generate those extreme results.
Imagine this: the code uses only 10% the resources to read the actual PHP code and the rest of 90% is used only to scan the tables... WOW!
That means the code forces to read into the database for each user who visits the site at this percentage... if you have 1000 users viewing the page in the same time.. you can get a picture of it...
If you compare this with vBulletin, the software does the opposite, 90% PHP and 10% MySQL... the right way.

DIVISION BY ZERO ERROR? Read this (https://vborg.vbsupport.ru/showpost.php?p=490143&postcount=74).
INVALID STATS IF MYSQL COMPILED IN A NON-ENGLISH LANGUAGE? Read this (https://vborg.vbsupport.ru/showpost.php?p=537546&postcount=180).

NOTE: The blue highlighting is not working in Opera 7.23 version. (Thanks Christine)

Have fun. :)

Gary King
03-05-2004, 01:28 AM
Nice job on this hack TECK :)

Gio Takahashi
03-05-2004, 01:55 AM
Been waiting for this hack. Will install when Gold is out.

Good job, Teck!

TECK
03-05-2004, 02:35 AM
The part of code that needs to be edited is final. ;)
Feel free to install it now.

Natch
03-05-2004, 02:46 AM
Can I ask - how to implement it ? I don't see how to actually layout the items for the same output I used to get for your previous hack ...

TECK
03-05-2004, 03:27 AM
Can I ask - how to implement it ? I don't see how to actually layout the items for the same output I used to get for your previous hack ...
I'm sorry, I don't understand your question?
You mean: How to display the options the same way like the previous hack? Through a template? You can simply edit the html code to suit your needs...

I didn't want to create any templates do to the RC stage.
Also, I think is better to have it hard coded...
$ms = '<tr align="right">' . "\n";
$ms .= ' <td class="tcat"><div class="smallfont">';
$ms .= 'Page generated in ' . $totaltime . ' seconds (' . $msphp . ' - ' . $mssql . ') with ';
$ms .= $query_count . ' queries</div></td>' . "\n";
$ms .= '</tr>' . "\n";
$ms .= '<tr align="right">' . "\n";
$ms .= ' <td class="alt1"><div class="smallfont">';
$ms .= $mstemplates . $msdebug . $msgzip . $msserver . '</div></td>' . "\n";
$ms .= '</tr>' . "\n";
Look at the code, is all there...

assassingod
03-05-2004, 05:32 AM
Cool hack:):)

Zelda-King
03-05-2004, 05:52 AM
Oh yes! I've been waiting for this. This is safe for the server, yes? I mean having the options that AREN'T for admins only. Well, I know you know about that old issue so I assume the answer's yes.

Logician
03-05-2004, 07:05 AM
One of my favorites hack is back! :)

AlexanderT
03-05-2004, 09:54 AM
Works very well here (v3.0rc4)!

PitchouneN64ngc
03-05-2004, 10:50 AM
Thanks for this great hack, it's useful :)

But when you have the quick style chooser enabled, your hack deforms a little bit the footer.

For repair this, you must to do these modifications into ./includes/functions.php:

$ms .= ' <td class="tcat"><div class="smallfont">';
$ms .= ' <td class="tcat" colspan="2"><div class="smallfont">';
And:

$ms .= ' <td class="alt1"><div class="smallfont">';
$ms .= ' <td class="alt1" colspan="2"><div class="smallfont">';
And all is correct ;)

TECK
03-05-2004, 11:19 AM
Thanks for mentioning, PitchouneN64ngc. I uploaded a new file with the fix.
Now is done automatically, so if you ever disable that option, you don't have to edit the code... ;)

TheComputerGuy
03-05-2004, 11:58 AM
awesome hack. Installing in a bout 5 minutes ;)

djohn
03-05-2004, 11:58 AM
I get a parse error when i go to the Template manager:
Parse error: parse error in /home/site/public_html/board/includes/functions.php on line 2463

Fatal error: Call to undefined function: exec_nocache_headers() in /home/site/public_html/board/admincp/global.php on line 37

Boofo
03-05-2004, 12:38 PM
I don't see the server load with this installed. It isn't in your screenshot either. ;)

Red Blaze
03-05-2004, 01:13 PM
<a href="https://vborg.vbsupport.ru/showthread.php?t=59700" target="_blank">https://vborg.vbsupport.ru/showthread.php?t=59700</a>

Doesn't that do pretty much the same thing? Only admins can see Erwin's version though. But I think that can be changed.

PitchouneN64ngc
03-05-2004, 01:25 PM
I get a parse error when i go to the Template manager:
Have you edited your functions.php file with Dreamweaver?

TECK
03-05-2004, 02:14 PM
https://vborg.vbsupport.ru/showthread.php?t=59700

Doesn't that do pretty much the same thing? Only admins can see Erwin's version though. But I think that can be changed.
Unfortunatelly, it does not do the same thing.
Erwin knows the difference:
Okay, the original was by TECK. This is NOT based on his code - it is based on vB3's native code. If TECK wants me to remove this, I will do so. This is just my version that I use for my private forums.
I don't see the server load with this installed. It isn't in your screenshot either. ;)
You need to have enabled the exec('uptime') in your server, in order to see the average server loads.
Contact your host for more details.
I know that Windows has no uptime binary, that could be executed with exec functions. Only Unix does this.

Boofo
03-05-2004, 02:40 PM
I got it working. ;)

I had to change this:
if (preg_match("/averages?: ([0-9\.]+), [\s]+([0-9\.]+), [\s]+([0-9\.]+)/", $stats, $regs))

to this:

preg_match("/averages?: ([0-9\.]+), [\s]+([0-9\.]+), [\s]+([0-9\.]+)/", $stats, $regs);

For some reason there was an if in that line. I know I have exec('uptime') enabled on the server because it was working fine before. And after taking the if out, it works fine now again. Thank you, Teck, for converting this to vB3. ;) I added a couple of things to mine, in case anyone wants to see it. ;)

TECK
03-05-2004, 03:09 PM
The IF should not change anything, except avoid proccesing any not needed functions, while increasing performance.
Do you run a UNIX box? Also, something is wrong there with your server. You cannot have 0 for all average loads, or make it work on Windows, from what I know (if anyone knows a way, please let me know, since I'm not good at server configuration ;)).

Leave the code as it is (that's why you get zero's)... and check with your host.
Let us all know the results.

Cheers.

djohn
03-05-2004, 03:11 PM
Have you edited your functions.php file with Dreamweaver?
No, I've used internal FlashFXP editor. However, now everything is fine, that problem accured only once.

Boofo
03-05-2004, 03:26 PM
The IF should not change anything, except avoid proccesing any not needed functions, while increasing performance.
Do you run a UNIX box? Also, something is wrong there with your server. You cannot have 0 for all average loads, or make it work on Windows, from what I know (if anyone knows a way, please let me know, since I'm not good at server configuration ;)).

Leave the code as it is (that's why you get zero's)... and check with your host.
Let us all know the results.

Cheers.
They are running Linux and the server load has always worked correctly before. It has always flucuated in the past.

TECK
03-05-2004, 03:39 PM
They are running Linux and the server load has always worked correctly before. It has always flucuated in the past.
Thanks for clearing this up. It beats me why the IF would not work, because it should.
Please post the full IF change so others could see it and paste it properly. :)
If it's working better your way, the hell with the code performance, we will use what's better, right? :D

Cheers.

Boofo
03-05-2004, 03:45 PM
Here's what I did. I changed:

if ($stats = @exec('uptime 2>&1') AND trim($stats) != '')
{
if (preg_match("/averages?: ([0-9\.]+), [\s]+([0-9\.]+), [\s]+([0-9\.]+)/", $stats, $regs))

to:

if ( $stats = @exec( 'uptime' ) )
{
preg_match( '/averages?: ([0-9\.]+),[\s]+([0-9\.]+),[\s]+([0-9\.]+)/' , $stats , $regs );

and it works right now. Here is a fresh screenshot of my server load (so you can see that it is working).

Sorry about this Floren. ;)

TECK
03-05-2004, 03:52 PM
Here's what I did. I changed:

if ($stats = @exec('uptime 2>&1') AND trim($stats) != '')
{
if (preg_match("/averages?: ([0-9\.]+), [\s]+([0-9\.]+), [\s]+([0-9\.]+)/", $stats, $regs))

to:

if ( $stats = @exec( 'uptime' ) )
{
preg_match( '/averages?: ([0-9\.]+),[\s]+([0-9\.]+),[\s]+([0-9\.]+)/' , $stats , $regs );

and it works right now. Here is a fresh screenshot of my server load (so you can see that it is working).

Sorry about this Floren. ;)
Try this for me please:
if ($stats = @exec('uptime 2>&1') AND trim($stats) != '')
{
Let me know if it's working. It should display the stats if the values are not 0 only. Thanks.

Boofo
03-05-2004, 03:55 PM
Yes, that works, too. ;)

TECK
03-05-2004, 04:00 PM
Ok, let's leave it then this way, what do you think?
Basically, we will remove only the IF in front of PREG_MATCH function... I'm still persistent with the IF... Leave the IF and try to refresh several times the page so you can create a server load. Let me know if it'S displaying the stats. Sorry to bother you but I don't have access to a UNIX server now.

I will update the file when I get back from work.

Boofo
03-05-2004, 04:02 PM
Looks good to me. ;)

If I don't remove the IF, the server load doesn't show at all. ;)

TECK
03-05-2004, 04:06 PM
Looks good to me. ;)

If I don't remove the IF, the server load doesn't show at all. ;)
Try this line?
if (preg_match("/averages?: ([0-9\.]+),[\s]+([0-9\.]+),[\s]+([0-9\.]+)/", $stats, $regs))
{
Let me know please Bob.
PS. Damn I deleted by accident the image, instead of the file, no more screenshot till tonight... We have one from Bob anyway, heh.

Boofo
03-05-2004, 04:11 PM
This is wierd. I re-downloaded your file and put the if code in like you have it in your file and for some reason, it is showing the server load now (with the IF statement). I swear to you that it wasn't working before. I don't know what happened. You have any ideas? ;)

gmarik
03-05-2004, 04:17 PM
Nice one!

TECK
03-05-2004, 04:21 PM
This is wierd. I re-downloaded your file and put the if code in like you have it in your file and for some reason, it is showing the server load now (with the IF statement). I swear to you that it wasn't working before. I don't know what happened. You have any ideas? ;)
My secret :D. Heh.
I made a little mistake, added a space in the wrong space. :p

Boofo
03-05-2004, 04:34 PM
So it wasn't me messing up? Come on, you have to tell me. PM if you don't want to spill it here. I have to know now, especially after all we went through together on this, BUDDY! . ;)

TECK
03-05-2004, 05:01 PM
So it wasn't me messing up? Come on, you have to tell me. PM if you don't want to spill it here. I have to know now, especially after all we went through together on this, BUDDY! . ;)
No, it was REALLY me. :)
I added a space in the wrong place into preg_match() function.
Sorry guys, error fixed, thanks to Bob. The file is uploaded with the right code.

Boofo
03-05-2004, 05:58 PM
What a team! What a team! ;)

I guess the file I downloaded had the fixed code in it already? Or do I need to re-download it?

It's working like a charm, by the way. Great work, Floren! ;)

TECK
03-05-2004, 06:12 PM
Ya, the file you downloaded is the most recent one.

Boofo
03-05-2004, 07:57 PM
Thank you, sir. ;)

ChuanSE
03-05-2004, 08:19 PM
I don't know what to do with the footer template :/

I had this
{ms}
$ms = '<tr align="right">' . "\n";
$ms .= '<td class="tcat"><div class="smallfont">';
$ms .= 'Page generated in ' . $totaltime . ' seconds (' . $msphp . ' - ' . $mssql . ') with ';
$ms .= $query_count . ' queries</div></td>' . "\n";
$ms .= '</tr>' . "\n";
$ms .= '<tr align="right">' . "\n";
$ms .= ' <td class="alt1"><div class="smallfont">';
$ms .= $mstemplates . $msdebug . $msgzip . $msserver . '</div></td>' . "\n";
$ms .= '</tr>' . "\n";


and it gave me this : (see attachment)

= ' ' . "\n"; .= ' '; .= 'Page generated in ' . . ' seconds (' . . ' - ' . . ') with '; .= 8 . ' queries ' . "\n"; .= '
' . "\n"; .= ' ' . "\n"; .= ' '; .= . . . . '

any idea's? :ermm:

Boofo
03-05-2004, 08:23 PM
This is all you add to your footer template:

{ms}

The rest stays in the functions.php

ChuanSE
03-05-2004, 09:04 PM
then it does nothin'

but where do i remove the "if" from the pragma thingie?

Boofo
03-05-2004, 09:59 PM
You don't need to remove the if now. It has been fixed. Get the file from the first post.

ChuanSE
03-07-2004, 02:11 PM
what should i do with this then?

+-----------------------------------------------+
| FINAL STEPS |
+-----------------------------------------------+
| The variables you can use are:
|
| $query_count - number of queries executed (defined in VB)
| $msdecimal - number of digits for microtime
| $msphp - PHP percent page usage
| $mssql - MySQL percent page usage
| $msdebug - vBulletin DEBUG mode status
| $msgzip - GZIP compression library
| $msserver - average server loads


i kinda dunno what to do with it
{ms} just doesn't do a thing, i modified like i should :/
* ChuanSE is a php n00b :p

Gary King
03-07-2004, 02:19 PM
what should i do with this then?

+-----------------------------------------------+
| FINAL STEPS |
+-----------------------------------------------+
| The variables you can use are:
|
| $query_count - number of queries executed (defined in VB)
| $msdecimal - number of digits for microtime
| $msphp - PHP percent page usage
| $mssql - MySQL percent page usage
| $msdebug - vBulletin DEBUG mode status
| $msgzip - GZIP compression library
| $msserver - average server loads


i kinda dunno what to do with it

* ChuanSE is a php n00b :p
Don't worry about it.

ChuanSE
03-07-2004, 02:22 PM
well ok, but it doesn't work :(

Gary King
03-07-2004, 02:25 PM
It doesn't show up?

ChuanSE
03-07-2004, 02:36 PM
nope, see here http://puredj.net

Martin64
03-07-2004, 03:32 PM
Works great, thanks a lot TECK. :)

Martin64
03-07-2004, 04:11 PM
This one does as well, you can only blame yourself for not following the instructions carefully.

Gary King
03-07-2004, 04:29 PM
This one does as well, you can only blame yourself for not following the instructions carefully.
Agreed.

stan68
03-07-2004, 04:54 PM
installed :)
nice one

Boofo
03-08-2004, 12:38 AM
Agreed.
It's great to know that you and Martin64 have never made a mistake while installing a hack and had anyone criticize you guys for it.

Martin64
03-08-2004, 01:02 AM
It's great to know that you and Martin64 have never made a mistake while installing a hack and had anyone criticize you guys for it.
Hello Boofo, long time. You probably don't remember me, it's been like a year since I was posting here regulary. What a nice welcome back. ;)

My point was just that he shouldn't bash the hack author and hint that the hack isn't working when it's actually an error on his end. Read his post above (#49) and you will see my reasoning for it.

We've all made mistakes when installing hacks, but before claiming something is wrong with a hack, try it once again. I try to help people as often as I can, or well I did back when I was active. Bye.

Boofo
03-08-2004, 01:13 AM
Hello, my friend. Sure I rememeber you. It HAS been a while. I've missed you posting. Glad to have you back. ;)

That message was not directed at you mostly. And I understand what you are saying. And I also remember when I first started here, I made mistakes and blamed the author, and I was also wrong in doing that. But when you are first starting out hacking vBulletin, we all have done that, in one way or the other.

All I'm saying is that we need to remember back when we were newbies and give these new guys a break. It's better to say nothing than to criticize, you know what I mean? There's too much newbie-bashing going on here anymore. ;)

TECK
03-08-2004, 02:52 AM
nope, see here http://puredj.net
It's working now. :)
Nice to see that you fix it... however, 14 queries of frontpage? Instead of 8?
Have you added several hacks? Make sure you don't have any uncached templates...

Martin64
03-08-2004, 06:44 AM
Hello, my friend. Sure I rememeber you. It HAS been a while. I've missed you posting. Glad to have you back. ;)

That message was not directed at you mostly. And I understand what you are saying. And I also remember when I first started here, I made mistakes and blamed the author, and I was also wrong in doing that. But when you are first starting out hacking vBulletin, we all have done that, in one way or the other.

All I'm saying is that we need to remember back when we were newbies and give these new guys a break. It's better to say nothing than to criticize, you know what I mean? There's too much newbie-bashing going on here anymore. ;)
No worries Boofo, just wanted to point out my intentions of that message. :)

And I'm glad you got the hack working, ChuanSE. :D

Boofo
03-08-2004, 03:20 PM
Teck, do the server load averages measure what my site is doing to the server or the overall server load of all accounts on it? Because my server load has jumped up to 1.10 in the last day or two. ;)

TECK
03-09-2004, 12:39 AM
Teck, do the server load averages measure what my site is doing to the server or the overall server load of all accounts on it? Because my server load has jumped up to 1.10 in the last day or two. ;)
http://www.vbulletin.com/forum/showthread.php?s=&action=showpost&postid=291831

Boofo
03-09-2004, 01:16 AM
I already read that. I was just wondering why it would jump from .08 to 1.10 in just a day. It has never been that high. And also, do those server loads just mean my site or do the server loads represent all the sites that are on the server?

ChuanSE
03-09-2004, 05:25 AM
I think it is a overall serverload, not only the board running on it if you installed more...

ChuanSE
03-09-2004, 05:27 AM
No worries Boofo, just wanted to point out my intentions of that message. :)

And I'm glad you got the hack working, ChuanSE. :D

Thx Teck & Martin, i figured it out in the end, this was the first hack that din't work from the first time :/ So sorry 'bout me naggin' on you guyz... , allthough boofo made a interesting point. I thank him for that reminder to you code guru's :p

But what do you mean with the uncached templates? What can i do about it?
I think there is one on the mainpage, but indeed, several other hacks are installed :)


Page generated in 0.40060806 seconds (54.97% PHP - 45.03% MySQL) with 24 queries
1 Uncached Templates | DEBUG Mode OFF | GZIP ON (level 5) | 0.09 : 0.08 : 0.20


again, thx guyz ;)

TECK
03-09-2004, 11:07 PM
Little esthetic change, to display the number of unchached templates...
Change this code part:
if ($_TEMPLATEQUERIES)
{
$mstemplates = '<b>' . sizeof($_TEMPLATEQUERIES) . '</b> Uncached ';
$mstemplates .= iif(sizeof($_TEMPLATEQUERIES) != '1', 'Templates', 'Template') . ' | ';
}
New file uploaded...

ChuanSE
03-10-2004, 05:26 AM
Hey Teck,

I don't really understand what i should change? the code to change is the code that i allready have changed 3 days ago.... Unless i'm not seeing the difference ofcourse

this is what i have:

$mstemplates = 'NO Uncached Templates | ';
if ($_TEMPLATEQUERIES)
{
$mstemplates = '<b>' . sizeof($_TEMPLATEQUERIES) . '</b> Uncached ';
$mstemplates .= iif(sizeof($_TEMPLATEQUERIES) != '1', 'Templates', 'Template') . ' | ';
}

TECK
03-10-2004, 04:14 PM
If you have this already in your functions.php, you are set to go. :)
No need to change anything...

About your site:
1 Uncached Templates | DEBUG Mode OFF | GZIP ON (level 5) | 0.09 : 0.08 : 0.20

You have one template, not cached, that means you perform one query extra because the template name is not part of the cache array.
Also, I would switch the GZIP to level 1, 5 will slow down your server, IMO.
Server load averages gives me the hint you are on a dedicated server, that means you are rich... :D

ChuanSE
03-11-2004, 05:14 AM
Ah Teck,

thx for this tip mate... I'm gonna try to find which template isn't in the cache aray allright.
ABout the gzip level. It seems logic indeed that 5 would slow down the server a little, but i was wondering.... it speeds up the page for the users then?
I always wondered what the best setting would be, so i took the middle :)
Gonna try it with level one now and will see if it improves the speed...

And yeah, it is a dedicated server allright :D
I have the forums / gallery / pphlogger / webmail / irc eggdrop and some other small things running there... But me rich? Naaah :p
Good sponsors, yes ;)

TECK
03-12-2004, 03:02 PM
I'm gonna try to find which template isn't in the cache aray allright.
Look at the new hacked code you added, there is your template name. Add it at the top of the file, in the templates array list.

ChuanSE
03-14-2004, 06:21 AM
Problem is: i added like 20 hacks in the last week
Which one would it be then :?

Boofo
03-14-2004, 03:01 PM
Turn on DEBEG and it will show you which template isn't cached.

TECK
03-18-2004, 04:10 PM
Problem is: i added like 20 hacks in the last week
Which one would it be then :?
Review the index.php file, since only there you get one uncached template, right?

sabret00the
03-24-2004, 03:22 PM
sorry to be a pain, but i'm encountering an error on line 1843 $ms .= ' <td class="tcat"' . iif($vboptions['allowchangestyles'], ' colspan="2"') . '><div class="smallfont">';


the error is Parse error: parse error, unexpected T_STRING in K:\Network\xampp\htdocs\forums\includes\functions. php on line 1843

Fatal error: Call to undefined function: exec_nocache_headers() in K:\Network\xampp\htdocs\forums\admincp\global.php on line 37

Detomah
03-25-2004, 01:31 AM
Excellent. :)

I've been looking for something like this for ages and missed this somehow, found it now though and installed perfectly first time. :D

Oblivion Knight
03-25-2004, 11:22 AM
Thanks TECK.. :)
Erwin's version just didn't feel right without the MySQL and PHP percentage.. Heh.

Tarion
03-25-2004, 02:47 PM
Thanks TECK.. :)
Erwin's version just didn't feel right without the MySQL and PHP percentage.. Heh.
I get an error division by zero from this two lines in the code, and i can't find out what's wrong.


$msphp = vb_number_format(((($totaltime - $querytime) / $totaltime) * 100),2) . '% PHP';
$mssql = vb_number_format((($querytime / $totaltime) * 100),2) . '% MySQL';


Please help me

TECK
03-25-2004, 04:27 PM
sorry to be a pain, but i'm encountering an error on line 1843 $ms .= ' <td class="tcat"' . iif($vboptions['allowchangestyles'], ' colspan="2"') . '><div class="smallfont">';


the error is Parse error: parse error, unexpected T_STRING in K:\Network\xampp\htdocs\forums\includes\functions. php on line 1843

Fatal error: Call to undefined function: exec_nocache_headers() in K:\Network\xampp\htdocs\forums\admincp\global.php on line 37
You made a little mistake while editing the code, please check your steps.
I get an error division by zero from this two lines in the code, and i can't find out what's wrong.


$msphp = vb_number_format(((($totaltime - $querytime) / $totaltime) * 100), 2) . '% PHP';
$mssql = vb_number_format((($querytime / $totaltime) * 100), 2) . '% MySQL';


Please help me
One of your values has to be returned as zero somewhere, or as a value that PHP will convert to a zero when it converts it to an integer.
Something is wrong with the code, you cannot have either the $totaltime or $querytime as zero.

Tarion
03-25-2004, 09:43 PM
Ok i got it to work i edit this line


$totaltime = number_format($endtime[0] - $starttime[0] + $endtime[1] - $starttime[1], $msdecimal);


as i delet the vb_ prefix for the vb_number_format funktion it work, wenn i add this prefix the error returns.

TECK
03-25-2004, 11:42 PM
Hmm, really wierd.
The vb_number_format() is the same like number_format(), except with a little cleanup/replace in chars... use it this way if it's working for you. :)

JoergZ
03-28-2004, 04:23 PM
I confirm, that I have the same division by 0 error. After changing the code as suggested by Tarion it works.

Anyway: Installed :)

TECK
03-28-2004, 05:33 PM
Thanks for the input JoergZ.
Let's see if other people will have the same problem... I will post a link to his fix (link added to first post). :)

Thanks for helping.

Christine
03-28-2004, 07:05 PM
Hi Tech, and thanks for porting this. One of my alltime favorites!

Edit: Nevermind -- I got it working. :)

r.cakir
03-30-2004, 07:55 AM
Installed and double checked the modifications, but still getting wrong result in PHP and MySQL percentage:

Page generated in 0,24497795 seconds (0,00% PHP - 0,00% MySQL) with 11 queries
4 Uncached Templates | DEBUG Mode OFF | GZIP ON (level 1)

I know, I made a mistake somewhere. Maybe someone can put me in the right direction.

Thanks!

r.cakir

Gary King
04-02-2004, 01:31 AM
Installed and double checked the modifications, but still getting wrong result in PHP and MySQL percentage:

Page generated in 0,24497795 seconds (0,00% PHP - 0,00% MySQL) with 11 queries
4 Uncached Templates | DEBUG Mode OFF | GZIP ON (level 1)

I know, I made a mistake somewhere. Maybe someone can put me in the right direction.

Thanks!

r.cakir
I think it might be a server configuration problem; first question: are you on Windows?

r.cakir
04-02-2004, 04:17 AM
No, it's a Apple Xserve running Mac OS X Server 10.3.3 operating system (Darwin 7.3.0). The microstats for vB 2.x worked perfect on the same server previously.

Gary King
04-02-2004, 11:17 AM
Wow, Apple for a server? Is it a production server? :eek: Anyhow, I'm not too sure, maybe TECK could bring in some insight? :)

TECK
04-02-2004, 02:26 PM
Installed and double checked the modifications, but still getting wrong result in PHP and MySQL percentage:

Page generated in 0,24497795 seconds (0,00% PHP - 0,00% MySQL) with 11 queries
4 Uncached Templates | DEBUG Mode OFF | GZIP ON (level 1)

I know, I made a mistake somewhere. Maybe someone can put me in the right direction.

Thanks!

r.cakir
Please turn the DEBUG Mode ON and let us know if you see the classic message: "Doing xxxx PHP and xxxx MySQL things...". If you get value 0 for both, then is definitelly the server.
The code was tested also on the final version of VB3. :)

Gary King
04-02-2004, 06:56 PM
Microstats works fine for me on vB3 Gold, nice job TECK :)

Bon travaille la, eh? ;)

Boofo
04-02-2004, 06:58 PM
Then how come you didn't click install? ;)

Gary King
04-02-2004, 07:10 PM
Then how come you didn't click install? ;)
Are you happy now? ;)

Boofo
04-02-2004, 07:25 PM
You have no idea the joy you've just brought to me. ;)

neocorteqz
04-03-2004, 08:56 PM
Works Great

Page generated in 0.19956589 seconds (90.55% PHP - 9.45% MySQL) with 13 queries on
Forum Home.

TECK
04-04-2004, 10:49 PM
Version 1.2 released... check the first post for more info.

PitchouneN64ngc
04-04-2004, 10:53 PM
Will update, thanks ^^

neocorteqz
04-05-2004, 03:37 AM
Thanks for the update, Now i don't have any uncached templates, but if i did, how would i go about adding it to the list of cached templates?? Just asking for a push in the right direction, not the outright answer, unless it really is that simple. :)

thanks again.

Oblivion Knight
04-05-2004, 05:50 AM
Thanks for the update TECK, however your instructions still say Version 1.1 ;)

djohn
04-05-2004, 08:34 AM
TECK, how can I update from version 1.1?

TECK
04-05-2004, 11:29 AM
The change is listed in file: FORUM/includes/functions.php (1 change more exacly).
Look at the old 1.1 file and replace the code with the new one.

Cheers.

Boofo
04-05-2004, 11:44 AM
To update from v1.1 to v1.2, do the following:

In functions.php, find:

$mstemplates = 'NO Uncached Templates | ';
if ($_TEMPLATEQUERIES)
{
$mstemplates = '<b>' . sizeof($_TEMPLATEQUERIES) . '</b> Uncached ';
$mstemplates .= iif(sizeof($_TEMPLATEQUERIES) != '1', 'Templates', 'Template') . ' | ';
}

REPLACE it with:

$mstemplates = '<select size="1" style="font-size: 10px">' . "\n";

if ($_TEMPLATEQUERIES)
{
$mstemplates .= '<option>' . sizeof($_TEMPLATEQUERIES) . ' Uncached Template';
$mstemplates .= iif(sizeof($_TEMPLATEQUERIES) != '1', 's') . '</option>';

if (is_array($tempusagecache))
{
global $vbcollapse;

ksort($tempusagecache);
foreach ($tempusagecache AS $tempname => $times)
{
if ($_TEMPLATEQUERIES["$tempname"])
{
$mstemplates .= '<option class="alt2">' . $tempname . ' (' . $times . ')</option>';
}
else
{
$mstemplates .= '<option>' . $tempname . ' (' . $times . ')</option>';
}
}
}
}
else
{
$mstemplates .= '<option>NO Uncached Templates</option>';
}
$mstemplates .= '</select>';

Thanks, Floren, for the update. I only posted this to help you out with all of the messages you'll get wanting to know how to update this great hack. ;)

Zelda-King
04-05-2004, 03:12 PM
Using the code Boofo posted there is no space between the dropdown and the DEBUG status. Just a little thing but I think a space there would make it look better.

Boofo
04-05-2004, 03:51 PM
All I did was post what was changed in the file. ;)

TECK
04-05-2004, 04:06 PM
Thanks, Floren, for the update. I only posted this to help you out with all of the messages you'll get wanting to know how to update this great hack. ;)
Bob, be aware, there are some other changes in the functions.php code beside the code you posted, like for example you need to globalize certain new variables...
Look at the global line there.
If I would be you, I would replace, in functions.php, the first block of code (first change) to make sure there is no confusion:
function print_output($vartext, $sendheader = 1)
{
global $pagestarttime, $query_count, $querytime, $DB_site, $bbuserinfo;
global $vbphrase, $vboptions, $stylevar, $_REQUEST, $_TEMPLATEQUERIES, $tempusagecache, $debug, $nozip, $ms;

$pageendtime = microtime();

// Number of decimals to show for microtime (ex 0.15227890)
$msdecimal = '8';

if ($vboptions['addtemplatename'])
{
if ($doctypepos = strpos($vartext, $stylevar['htmldoctype']))
{
$comment = substr($vartext, 0, $doctypepos);
$vartext = substr($vartext, $doctypepos + strlen($stylevar['htmldoctype']));
$vartext = $stylevar['htmldoctype'] . "\n" . $comment . $vartext;
}
}

$starttime = explode(' ', $pagestarttime);
$endtime = explode(' ', $pageendtime);
$totaltime = vb_number_format($endtime[0] - $starttime[0] + $endtime[1] - $starttime[1], $msdecimal);

$msphp = vb_number_format(((($totaltime - $querytime) / $totaltime) * 100), 2) . '% PHP';
$mssql = vb_number_format((($querytime / $totaltime) * 100), 2) . '% MySQL';

$ms = '<tr align="right">' . "\n";
$ms .= ' <td class="tcat"' . iif($vboptions['allowchangestyles'], ' colspan="2"') . '><div class="smallfont">';
$ms .= 'Page generated in ' . $totaltime . ' seconds (' . $msphp . ' - ' . $mssql . ') with ';
$ms .= $query_count . ' queries</div></td>' . "\n";
$ms .= '</tr>' . "\n";

if ($bbuserinfo['usergroupid'] == '6')
{
$mstemplates = '<select size="1" style="font-size: 10px">' . "\n";

if ($_TEMPLATEQUERIES)
{
$mstemplates .= '<option>' . sizeof($_TEMPLATEQUERIES) . ' Uncached Template';
$mstemplates .= iif(sizeof($_TEMPLATEQUERIES) != '1', 's') . '</option>';

if (is_array($tempusagecache))
{
global $vbcollapse;

ksort($tempusagecache);
foreach ($tempusagecache AS $tempname => $times)
{
if ($_TEMPLATEQUERIES["$tempname"])
{
$mstemplates .= '<option class="alt2">' . $tempname . ' (' . $times . ')</option>';
}
else
{
$mstemplates .= '<option>' . $tempname . ' (' . $times . ')</option>';
}
}
}
}
else
{
$mstemplates .= '<option>NO Uncached Templates</option>';
}
$mstemplates .= '</select>';

$msdebug = 'DEBUG Mode OFF | ';
if ($debug)
{
$msdebug = 'DEBUG Mode ON | ';
}

$msgzip = 'GZIP OFF | ';
if ($vboptions['gzipoutput'] AND !$nozip)
{
$msgzip = 'GZIP ON (level ' . $vboptions['gziplevel'] . ') | ';
}

$msserver = '';
if ($stats = @exec('uptime 2>&1') AND trim($stats) != '')
{
if (preg_match("/averages?: ([0-9\.]+),[\s]+([0-9\.]+),[\s]+([0-9\.]+)/", $stats, $regs))
{
$regs[1] = vb_number_format($regs[1], 2);
$regs[2] = vb_number_format($regs[2], 2);
$regs[3] = vb_number_format($regs[3], 2);

$msserver = '<b>' . $regs[1] . '</b> : ' . $regs[2] . ' : ' . $regs[3] . ' | ';
}
}

$ms .= '<tr align="right">' . "\n";
$ms .= ' <td class="alt1"' . iif($vboptions['allowchangestyles'], ' colspan="2"') . '><div class="smallfont">';
$ms .= $msdebug . $msgzip . $msserver . $mstemplates . '</div></td>' . "\n";
$ms .= '</tr>' . "\n";
}

if (DB_QUERIES)
{
$ms = '';
$vartext .= "<!-- Page generated in " . $totaltime . " seconds with $query_count queries -->";
}

// ################################################## ##################
// temporary code
global $DEVDEBUG, $_SERVER;
if ($debug)
{
That will fix the space issue mentioned before by other people as well globalize the templates cache, $tempusagecache.
Let me know if that makes sense. Thanks Bob.

Boofo
04-05-2004, 04:12 PM
Ok, thanks. I was just trying to help. I guess I should have looked for more changes. ;)

TECK
04-05-2004, 04:14 PM
Ok, thanks. I was just trying to help... ;)
And I hope you will keep on doing this.
You helped me several times in my threads with bugs, etc. as well others. :)

Boofo
04-05-2004, 04:17 PM
Thank you, sir. That's kind of you to say. I enjoy doing what I can, although it isn't much at times. ;)

Zelda-King
04-05-2004, 06:54 PM
Boofo: It was a good gesture. Upgrade instructions are good.

Bad Bunny
04-05-2004, 07:22 PM
Installed! Thanks! Works like a charm.

heynurse
04-06-2004, 05:32 AM
Great Hack and Upgrade! Thanks Floren!

Nj?rd Eriksson
04-07-2004, 05:13 PM
You need to have enabled the exec('uptime') in your server, in order to see the average server loads.
Contact your host for more details. I have my own dedicated server. Can someone please tell me how to enable this? :)

Nj?rd Eriksson
04-08-2004, 02:36 AM
SafeMode is off, by the way, but I still can't see the average server loads.

If I enter uptime via SSH2 with root I get a result. If I enter it with my website's account via SSH2 I get uptime: command not found, just in case it shouldn't be like this.

djohn
04-08-2004, 11:29 AM
I have a question. How can i "cache" an "uncached" template without installing an update?

Boofo
04-08-2004, 12:03 PM
Turn DEBUG on to find out what template is cached and put it in the templates section at the top of the file for the page it isn't cached on.

The easiest way is to install Teck's update for this great hack and you won't need to enable DEBUG to find out which template isn't cached. The drop down box for the Uncached templates (in the update) will show you the template that isn't cached. ;)

djohn
04-08-2004, 12:27 PM
Turn DEBUG on to find out what template is cached and put it in the templates section at the top of the file for the page it isn't cached on.
Didn't quite get that. I should turn on debug mode, and then edit it, but save without making any changes?

TECK
04-10-2004, 12:46 AM
I have a question. How can i "cache" an "uncached" template without installing an update?
You need to know what templates are performing an extra query for their uncached name. You can do this with the latest version of this hack, it will take you 30 seconds to upgrade it (https://vborg.vbsupport.ru/showpost.php?p=496012&postcount=98).
Once you know the name of the uncached templates, simply add it to $globaltemplates array, present at the top of each .php file in vBulletin.

So if in your index.php file, you have 2 unchached templates, look at the top of index.php file and find:
$globaltemplates = array(
'FORUMHOME',
...,
and add the end the template name you missed to add.

Cheers.

PS. Upgrade, is really easy the change. ;)

djohn
04-10-2004, 11:26 AM
Right, I've updated, but I can't figure out what template is uncashed, there's a 1 next to all of them. See screenshot.

BarBeQue
04-10-2004, 12:34 PM
Thanks Teck.
I just removed Erwins' stats and installed yours... much more info :D

* BarBeQue clicks install

sabret00the
04-10-2004, 01:09 PM
$ms .= ' <td class="tcat"' . iif($vboptions['allowchangestyles'], ' colspan="2"') . '><div class="smallfont">';
still getting an error on that line

Christine
04-10-2004, 01:15 PM
Right, I've updated, but I can't figure out what template is uncashed, there's a 1 next to all of them. See screenshot.It is your board_inactive_warning -- note the blue highlighting on it.

:):

neocorteqz
04-10-2004, 07:01 PM
It is your board_inactive_warning -- note the blue highlighting on it.

:):
I was just about to say that. :)

I noticed that without the update installed, only cause i had the board inactive, and when the board is active i have no uncached templates.

TECK
04-11-2004, 12:33 AM
Right, I've updated, but I can't figure out what template is uncashed, there's a 1 next to all of them. See screenshot.
The number in parenthesis (1), for example, indicates how many times the template is called by the script. This is just a reference for your code. Look at the "forumhome_forumbit_levelX".. I bet you have 3 categories and 9 forums (with 2 sub-forums) displayed on your front page... and there are only 2 forums where you got replies. ;)

As Christine mentioned, the uncached template is highlighted in blue.

The "board_incative_warning" template is not cached for server performace matter, and is not something the VB devs forgot.
Let me explain the way it works with the memory server cache so you understand a little better the process.

VB software uses/creates a cache, like a sort of temp folder where is stored important information that is used several times, same like in Windows. :)
All this information is stored temporarily in the VB database (that is also sanitized on a regular basis by the VB software), so it eliminates the need to scan the tables several times for the same information resulting an increase of the server load.
For example, on the forum frontpage, if you open it for the first time, there will be far more queries performed instantly (14 instead of 8), then when you visit it for the second time, due to the cache process, all temporary information is stored in the "temp" database.

Now, why all templates are NOT cached? The VB devs created a balance between the software and server. In other words, they used this aproach:
If an information is used less then 95% of the cases, there is no need to store it in the server memory/database, because most likely is not very often used, like your "board closed" template. They prefered to trade it for a query, instead of loading it into a temp process, when you use it only once every 500 cases...

That's why you will notice some uncached templates sometimes.

I hope this information helped you to understand better the cache process. :)

TECK
04-11-2004, 12:44 AM
nope, see here http://puredj.net
Chuan, what portal you use?
Is extremly intense on the table scans... Holly molly...
Page generated in 0.60059810 seconds (43.99% PHP - 56.01% MySQL) with 16 queries

The number of queries is ok, but the code is not very strong, IMO.
Compare it yourself with any forums page. As soon as you go over 20% MySQL, you got to ask yourself what bad code you added there to perform table scans that generate those results...

Christine
04-11-2004, 01:19 AM
Teck -- So you know, the blue highlighting isn't working in Opera 7.23. It is fine in IE 6 and FireFox 0.8.

Just in case you get any questions from folks who aren't seeing which template is the issue -- it may be their browser.

:)

neocorteqz
04-11-2004, 05:51 AM
Chuan, what portal you use?
Is extremly intense on the table scans... Holly molly...


The number of queries is ok, but the code is not very strong, IMO.
Compare it yourself with any forums page. As soon as you go over 20% MySQL, you got to ask yourself what bad code you added there to perform table scans that generate those results...


it looks like the vBindex portal, but he has no copywrite info at the bottom, so i dont know.

as for the vBindex portal, this is what i get on portal home,

Page generated in 6.73733711 seconds (5.21% PHP - 94.79% MySQL) with 17 queries
NO Uncached Templates | DEBUG Mode OFF | GZIP ON (level 1) | 0.31 : 0.13 : 0.09

The slow loadtime is only because of the weather block i have on the portal home.

if I remove it.

Page generated in 3.35731196 seconds (9.05% PHP - 90.95% MySQL) with 17 queries
NO Uncached Templates | DEBUG Mode OFF | GZIP ON (level 1) | 1.11 : 0.31 : 0.15

is what i get. I'm sure NTLDR's code is fine. :p but I'm no coder, so i wouldn't know. :D

djohn
04-11-2004, 11:47 AM
Thank you very much TECK, that did help a great deal. You were, I do have 3 categories and 9 forums with 2 sub-forums :)

Thanks a lot again :)

TECK
04-12-2004, 01:23 AM
Page generated in 3.35731196 seconds (9.05% PHP - 90.95% MySQL) with 17 queries
It's totally extreme, I can't believe it that the code generate this kind of stress on the server.
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.

I would like to know if other coders who use those portals have the same results... could be a server issue also??? Thanks guys for sharing.
Teck -- So you know, the blue highlighting isn't working in Opera 7.23. It is fine in IE 6 and FireFox 0.8.
Thanks for the info Christine, I will make sure it's linked to the first post. :)
Thank you very much TECK, that did help a great deal. You were, I do have 3 categories and 9 forums with 2 sub-forums :)
Glad that helped you... my little VB speech. :D

Guys, if you have any questions, feel free to ask them.

Just as an off-topic subject, I just got off the hospital, after a very bad infection that knocked me off the real world for almost a week... my sinuses started to be really inflamated then my lungs got filled with infection, follwed by the ears... it was really bad...
But, with a lot of care from my wife and mom, I was able to get back today on my feet and walk outside of the house a little...
Glad to see you all ok, here, in our little family, and share this with you.

Boofo
04-12-2004, 01:29 AM
Just as an off-topic subject, I just got off the hospital, after a very bad infection that knocked me off the real world for almost a week... my sinuses started to be really inflamated then my lungs got filled with infection, follwed by the ears... it was really bad...
But, with a lot of care from my wife and mom, I was able to get back today on my feet and walk outside of the house a little...
Glad to see you all ok, here, in our little family, and share this with you.

I think it's in the rules somewhere where you're allowed to go off-topic in you're own thread, Floren. ;)

Sorry to hear about you being down. I hope you're feeling better, my friend. We need you aorund here so take care of yourself and get healthy. Boofo's orders. ;)

TECK
04-12-2004, 01:29 AM
$ms .= ' <td class="tcat"' . iif($vboptions['allowchangestyles'], ' colspan="2"') . '><div class="smallfont">';
still getting an error on that line
What is the error? Thanks for posting.
I think it's in the rules somewhere where you're allowed to go off-topic in you're own thread, Floren. ;)

Sorry to hear about you being down. I hope you're feeling better, my friend. We need you aorund here so take care of yourself and get healthy. Boofo's orders. ;)
Thanks for the info and... the kind words, Bob. Cheers.

Christine
04-12-2004, 02:18 AM
What is the error? Thanks for posting.

Thanks for the info and... the kind words, Bob. Cheers.
Sorry to hear that Floren. Feel better soon!!

ChuanSE
04-12-2004, 06:02 AM
Chuan, what portal you use?
Is extremly intense on the table scans... Holly molly...


The number of queries is ok, but the code is not very strong, IMO.
Compare it yourself with any forums page. As soon as you go over 20% MySQL, you got to ask yourself what bad code you added there to perform table scans that generate those results...


Oops, i missed this post hehehe, same reason btw.
I was knocked out for a week by the same kind of infection :(

But hey, all beter now :D

I'm using vBadvanced Teck.

Page generated in 1.03972507 seconds (31.84% PHP - 68.16% MySQL) with 19 queries
NO Uncached Templates | DEBUG Mode OFF | GZIP ON (level 2) | 0.22 : 0.90 : 0.62

OMG indeed, how can this happen? allthough the page is generated in 1 sec :|

Anything I can do 'bout this?

ChuanSE
04-12-2004, 06:04 AM
btw, i attached the php file...

TECK
04-12-2004, 01:28 PM
Oops, i missed this post hehehe, same reason btw.
I was knocked out for a week by the same kind of infection :(

But hey, all beter now :D

I'm using vBadvanced Teck.

Page generated in 1.03972507 seconds (31.84% PHP - 68.16% MySQL) with 19 queries
NO Uncached Templates | DEBUG Mode OFF | GZIP ON (level 2) | 0.22 : 0.90 : 0.62

OMG indeed, how can this happen? allthough the page is generated in 1 sec :|

Anything I can do 'bout this?
Same here my friend, I was dead sick also for a week...

About your problem, I guess is all in how you write the code. Take a look at my portal, how the results are for MySQL:
https://vborg.vbsupport.ru/attachment.php?attachmentid=18003

The MySQL usage is around 10% as it should be normally (not to mention that the page is generated only in 0.2 seconds), the server likes it. ;)

neocorteqz
04-13-2004, 03:27 AM
It's totally extreme, I can't believe it that the code generate this kind of stress on the server.
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.

I would like to know if other coders who use those portals have the same results... could be a server issue also??? Thanks guys for sharing.

<snip>

Just as an off-topic subject, I just got off the hospital, after a very bad infection that knocked me off the real world for almost a week... my sinuses started to be really inflamated then my lungs got filled with infection, follwed by the ears... it was really bad...
But, with a lot of care from my wife and mom, I was able to get back today on my feet and walk outside of the house a little...
Glad to see you all ok, here, in our little family, and share this with you.


Maybe it's a server issue, but without knowing any other results from other users who have installed vBindex. I couldn't tell you one way or another.

here's what it reads right now.

Page generated in 1.65803409 seconds (31.48% PHP - 68.52% MySQL) with 17 queries

and here's what it reads with just the newsbit and welcome Panel options enabled.

Page generated in 1.21568489 seconds (16.95% PHP - 83.05% MySQL) with 9 queries

and it's pulling Topics from two forums, with a limit of 5 Total threads listed.

I really don't know. I suppose i will ask in his thread. and I will ask my host about any tweaks to MySQL.

edit: good to see your well again. Or at least hoping you are. :)

TECK
04-13-2004, 11:03 AM
I would like to know also if other users experience those type of percentages (for portals like vbIndex, vbAdvanced, etc. only).
Guys, let us know please.

PitchouneN64ngc
04-13-2004, 11:14 AM
I would like to know also if other users experience those type of percentages.
Guys, let us know please.
I can't say for my forum actually but into my forum test, I have:

Page generated in 0.29032302 seconds (83,48% PHP - 16,52% MySQL) with 8 queries
So, no problem for me :)

TECK
04-13-2004, 11:19 AM
I was not clear, sorry... for portals like vbIndex, vbAdvanced, etc. only. :)
The forums are always ok...

Guys, let me know if you have any portal software installed that give you those weird results. Thanks.

BarBeQue
04-13-2004, 11:22 AM
Don't like portals much, i want to see the forums right away.
Which is why i installed the sidebar hack, so it shows a nice left sidebar with some links, rss feeds and arcade news (and a poll as soon as i find out how to add one there) and all my forums to the right next of it.

Mysql % never goes above 15%, most of the time it's like 11-12 %.

Page generated in 0.43167710 seconds (94.18% PHP - 5.82% MySQL) with 10 queries
DEBUG Mode OFF | GZIP ON (level 1) | Server load AVG 0.83 : 1.16 : 1.42

Reeve of shinra
04-15-2004, 03:43 AM
$ms .= ' <td class="tcat"' . iif($vboptions['allowchangestyles'], ' colspan="2"') . '><div class="smallfont">';
still getting an error on that line
I am recieving the same error. I am running vbIndex dunno if thats an issue here or not.

Parse error: parse error in /home/nytalk/domains/nytalk.net/public_html/board/includes/functions.php on line 1941

Fatal error: Call to undefined function: exec_nocache_headers() in /home/nytalk/domains/nytalk.net/public_html/board/admincp/global.php on line 37

TECK
04-21-2004, 05:40 PM
Reeve, the code posted above simply adds a colspan, if you have enabled the style dropdown.
The code was tested in a unhacked board. Please try it in a unmodified board and you will see there are no problems.
If vbIndex creates any problems, I would recommend you to contact the hack author for a workaround.

In the same time, I recommend to all portal users to ask the authors how to reduce the usage of MySQL database.
I saw people using VBportals (like vbIndex, vbAdvanced, etc) who stress to server up to 90% usage... Is really intense. A normal MySQL usage should be around 10-15%.

Is all in how you write the code, IMO... and you can have the same results... it doesn't have to be intense for the server.
Take a look at those results (https://vborg.vbsupport.ru/attachment.php?attachmentid=18003) and let me know what you think.

Regards,
Floren.

Natch
04-21-2004, 11:25 PM
Ive just started to get a problem with this showing 100.00% PHP - 0.00% MySQL ..., but with x queries ... anyone seen this problem before ?

EDIT:// Apologies - my bad - I had forgotten to re-edit db_mysql.php after the 3.0.1 upgrade ...

Boofo
04-21-2004, 11:44 PM
Ive just started to get a problem with this showing 100.00% PHP - 0.00% MySQL ..., but with x queries ... anyone seen this problem before ?

EDIT:// Apologies - my bad - I had forgotten to re-edit db_mysql.php after the 3.0.1 upgrade ...

My goodness. ;)

Where you been, my friend? ;)

Natch
04-22-2004, 12:12 AM
I know I know ;)

* Natch eats some more humble pie for breakfast

Been busy busy d00d .... trying to survive while not making money is not the easiest thing :)

Pseudomizer
04-22-2004, 11:26 AM
Hello,

after reading the first page and the description i am a little bit concerned. When a guest visits my VBindex portal page i have stats like: 30,23% PHP - 69,77% MySQL.

When i log in as the admin i got stats like 25,72% PHP - 74,28% MySQL.

So i have 2 questions:

1. Any experiences with vbindex portal so far why the MySQL stats are so high ? I know that this should not be placed in this thread but i would like to know if someone has got the same experience with this portal ?

2. which is clearly related to this hack: Why do my stats increase when i log in as admin ? The number of queries stay the same with 16 queries as before.

My loading time for the portal is always 0.7 seconds which i would say is fine.

Any help would be appreciated.

Cheers,

TECK
04-22-2004, 04:15 PM
Hi Pseudomizer,
From my experience with this type of portals, I could explain why the MySQL is high.
Normally, the MySQL % is a lot higher then the vBulletin pages because the intense table scans.

VB is very intelligent in this area, it avoids to do full table scans and also it uses a very judicious system cache. All this results in a very low database usage and, indirectly a very low server usage.

Let me be more explicit.
For every option you enable in those portals, you perform extra queries, for each member that access instantly the page. The more members view in the same time the front page, the higher is the stress on the server.
So, if I enter your portal site, in an instance, the software will perform several queries that scan FULLY the hole tables in your database.

A good rule to keep in mind for coders is this: ALWAYS avoid full table scans, is the worst thing in the world.
If you have a very small forum with 200-300 posts, that will not really count, since your database is very small, but what do you do with huge forums who have 1 million posts?
Let's take as example "the x latest threads". The query will perform a full scan from ALL forums and ALL threads. I'm sure you understand why the MySQL % will raise to the sky... for an instance the server will be suffocated with the flood of information it has to compile, in order to display the results, and that?s only for ONE person... imagine what will happen when 500 users will visit in the same time your front page.
What vBulletin does is this: it puts a time/date limit, limits the search for 30 threads and also it separates it only for one forum, not all. So instead of scanning the hole forum/thread tables, it selects a very small portion of it.
The result is obvious, a very small server usage... ;)

I hope that help you understand better the % usage.

Regards,
Floren.

PS. When I have time, I will release my portal version that have a very low MySQL usage.
I posted a screenshot, few posts above, so people can see that is possible to have good MySQL results. ;)

Pseudomizer
04-22-2004, 04:19 PM
Hi Teck,

if you should go for your own portal please add me to your list. I would be more then happy to help if you need any help. Meanwhile i will try to limit the SQL queries on my current board.

Thanks for your detailed explanation. If i am successfull i will post my results for crosschecking.

Cheers,

TECK
04-22-2004, 06:39 PM
Thanks for the offer, Pseudo. :)
I should be able to make a little room in my schedule to post all the procedure... but I will tell you that is very simple... it involves no database modifications, only a bunch of new templates and few minor edits in vBulletin files.

Natch
04-23-2004, 01:00 AM
Thanks for the offer, Pseudo. :)
I should be able to make a little room in my schedule to post all the procedure... but I will tell you that is very simple... it involves no database modifications, only a bunch of new templates and few minor edits in vBulletin files.
Very much looking forward to this kind of Portal ... I am and have been a vBIndex user, and have been happy with it - but I have noticed more server load with greater traffic (only have 2100+ threads, 25,000+ posts, and maybe 30-50 active users a day ...)

por4x4
04-28-2004, 05:51 PM
Great hack!

But I would like to move the location of the information to below the copyright notice... How do I go about doing this?

TECK
04-28-2004, 07:20 PM
Place {ms} in any template and anywhere you want. :)

por4x4
04-28-2004, 07:48 PM
Place {ms} in any template and anywhere you want. :)

When I tried that, it screwed up my templates... I will play with it a little more. Thanks!

TECK
04-28-2004, 08:14 PM
You are right, there are some table rows inside the php code...
Post a screenshot when done. ;)

por4x4
04-28-2004, 08:17 PM
ok, I placed it in a table, and it works now. Thanks!

ChrisLM2001
05-06-2004, 05:49 PM
Like to ask one question about this wonderful mod (a must to install!): How does one center it like the copyright info?

Someone is bound to want this, so I'm asking.

Chris

TECK
05-08-2004, 11:59 AM
There is no table class that allow you to do this, in VB css.
Don't use align="center", it's deprecated. ;)

If you have a CSS editor (TopStyle Pro is very good), it will be very easy to make a class for Netscape/IE 4 and add it into your headincludes.

Boofo
05-08-2004, 12:07 PM
Floren, what does this mean?

Don't use align="center", it's deprecated.
I don't know that word deprecated, I guess. Sorry. ;)

TECK
05-08-2004, 12:25 PM
Hi Bob,
"Deprecated" is a term, used most of the time in programming, that is considered obsolete and in the process of being phased out in favor of a specified/better replacement.
The best example is this: certain PHP functions were replaced by better ones, in newer versions. Their names changed. However, some programmers still like to use the old ones, taking the chance to have their program fail.

Boofo
05-08-2004, 12:47 PM
Ahhh, I see now. Thanks for explaining that. ;)

You said not to use align="center". What would you use instead then? ;)

TECK
05-08-2004, 01:05 PM
The best way is to use a class. Here it is an example:
.txtcenter {
text-align: center;
}
Then you could simply use:
<table>
<tr>
<td class="txtcenter">Centered text will be here</td>
</tr>
</table>
You could also use:
<div class="txtcenter">Centered text will be here</div>
or:
<span class="txtcenter">Centered text will be here</span>
to obtain the same results.

Boofo
05-08-2004, 02:30 PM
Ok, thanks. I guess I never knew that was the new way to do the align="center". But wouldn't you use this for td instead of class?


<td style="txtcenter">Centered text will be here</td>
Because you might want to add something like class="thead", too. ;)

TECK
05-08-2004, 06:37 PM
You can apply the class="txtcenter" anywhere in a TD, TR or TABLE.
If you apply it in a TABLE line, it will make the hole table centered.
In a TR (column), all child rows will be centered.
In a TD, that specific row will have the text centered.

If you currently have a class present, you cannot use style="txtcenter".
Instead, use:
style="text-align: center", beside class="thead"...
Although, I don't like this way to write code for the reason mentioned few lines above... In certain versions of XHTML (for example Strict 1.1) the "style" is deprecated also... it's getting hard to code huh? ;)

The best way is this:
Edit the actual class and add the text-align: center; line into it.

Boofo
05-08-2004, 06:52 PM
You can aply the class="txtcenter" anywhere in a TD, TR or TABLE.
If you aply it in a TABLE line, it will make the hole table centered.
In a TR (column), all child rows will be centered.
In a TD, that specific row will have the text centered.

If you curently have a class present, you cannot use style="txtcenter".
Instead, use:
style="text-align: center", beside class="thead"...
Although, I don't like this way to write code for the reason mentioned few lines above... In certain versions of XHTML (for example Strict 1.1) the "style" is deprecated also... it's getting hard to code huh? ;)

The best way is this:
Edit the actual class and add the text-align: center; line into it.That's very interesting. I didn't know this before. ;)

The only thing about editing the current class is that in some areas you might not want it to center something. Right now I have it as:

<td colspan="4" style="text-align: center;" class="thead">

and it seems to be working fine. But this isn't XHTML compliant, then, right?

You're definately right about it being hard to keep up with the coding changes. ;)

TECK
05-08-2004, 07:06 PM
Do this:
Create a new class called "theadcenter"
.theadcenter {
text-align: center;
... the rest of thead class contents ...
}
Then stick the new class only where you need it, in your html code... in this way you remain code compliant... :p

lifesourcerec
05-09-2004, 10:55 AM
I have a problem. This:
Page generated in 2.72278 seconds with 14 queries [Server Loads: 6.36 4.98 : 3.55]

is at the top and bottom of the forum. even when I remove the {ms}, it's still there. And server load is high

ChrisLM2001
05-10-2004, 04:06 AM
Do this:
Create a new class called "theadcenter"
.theadcenter {
text-align: center;
... the rest of thead class contents ...
}
Then stick the new class only where you need it, in your html code... in this way you remain code compliant... :p
Thanks, Teck and Boofo about this issue. ;) Spent months learning XHTML, and this is a reminder to hit the books again (nevermind remembering how whitespace is handled in XHTML....thunk, thunk, thunk....me bad!).

Love this mod, Teck. First one I installed and rightly so!

Chris

TECK
05-10-2004, 02:15 PM
I have a problem...
Please check the way you mod the files, make sure you use a good php/text editor, for example TextPad.
Thanks, Teck and Boofo about this issue. ;) Spent months learning XHTML, and this is a reminder to hit the books again (nevermind remembering how whitespace is handled in XHTML....thunk, thunk, thunk....me bad!).
I'm glad this tip was useful for you. :)

Regards,
Floren.

Nj?rd Eriksson
05-16-2004, 12:29 PM
Please check the way you mod the files, make sure you use a good php/text editor, for example TextPad.

I'm glad this tip was useful for you. :)

Regards,
Floren.
TECK, there is a problem with your hack if one uses it with the German language system offered by vBulletin (works fine with default US English, of course):

Warning: Division by zero in /var/www/html/forum/includes/functions.php on line 1839

Warning: Division by zero in /var/www/html/forum/includes/functions.php on line 1840

This seems to happen, whenever a page is generated in less than 1 second.

These are the lines 1839 and 1840 in functions.php

$msphp = vb_number_format(((($totaltime - $querytime) / $totaltime) * 100), 2) . '% PHP';
$mssql = vb_number_format((($querytime / $totaltime) * 100), 2) . '% MySQL';


Results for pages generated in less than 1 second:

Page generated in 0,36060596 seconds (0,00% PHP - 0,00% MySQL) with 11 queries

The php warning doesn't appear if a page is generated in more than one second but the results still are inaccurate:

Page generated in 6,94200397 seconds (-10,53% PHP - 110,53% MySQL) with 11 queries

I assume this could be caused by the fact that German uses "," where English uses a "." and vice versa. Do you have a fix for this, please? One that works regardless if one selects English or German as language, preferrably? :)

PitchouneN64ngc
05-16-2004, 12:36 PM
For the division by zero, see the link about that in the first post :)

Intex
05-22-2004, 01:06 PM
Installed and works fine with 3.0.1. Good job Tech :).

* Intex clicks INSTALL

WEForums
05-22-2004, 10:06 PM
Nice. I had Erwin's installed thinking he was referring to your vB2 release (which I also had installed), but then I found this post. Might be a good idea to have it linked (in your first post) to this hack as this is a bit better.

Oh, I do have a question, though. I understand the caching part but I am a little confused about a little problem I am having. What if I add the template name to the cached list but it's still showing up as uncached? What could be the issue there?

Just so you know, the template is actually a hack template, so that's probably it. I'm just wanting confirmation. (It's Gary's "Who has been online today" hack. (separate page than the index, though))

Onkel_Tom
06-05-2004, 09:33 PM
Nice. I had Erwin's installed thinking he was referring to your vB2 release (which I also had installed), but then I found this post. Might be a good idea to have it linked (in your first post) to this hack as this is a bit better.

Oh, I do have a question, though. I understand the caching part but I am a little confused about a little problem I am having. What if I add the template name to the cached list but it's still showing up as uncached? What could be the issue there?

Just so you know, the template is actually a hack template, so that's probably it. I'm just wanting confirmation. (It's Gary's "Who has been online today" hack. (separate page than the index, though))

same for me ;)
First installed Erwin's version and then installed TECK's much better version !
I've also the problem of the uncached "forumhome_todayloggedinuser" Template from Gary's Who was online today Hack.

Kohhal
06-17-2004, 01:20 PM
Great hack, had it on vB2, much easier install on vB3 though :D

Below are some stats from my site from the last few minutes using vBindex3 - guess it's time to cut some of the info pulled to the front portal page to cut down on that SQL load!

Page generated in 0.35776806 seconds (55.02% PHP - 44.98% MySQL) with 11 queries
Page generated in 0.62210989 seconds (47.07% PHP - 52.93% MySQL) with 11 queries
Page generated in 0.20080590 seconds (74.33% PHP - 25.67% MySQL) with 11 queries
Page generated in 0.30024004 seconds (84.11% PHP - 15.89% MySQL) with 11 queries
Page generated in 2.15881801 seconds (25.50% PHP - 74.50% MySQL) with 11 queries :eek:

neocorteqz
06-17-2004, 02:37 PM
Great hack, had it on vB2, much easier install on vB3 though :D

Below are some stats from my site from the last few minutes using vBindex3 - guess it's time to cut some of the info pulled to the front portal page to cut down on that SQL load!

Page generated in 0.35776806 seconds (55.02% PHP - 44.98% MySQL) with 11 queries
Page generated in 0.62210989 seconds (47.07% PHP - 52.93% MySQL) with 11 queries
Page generated in 0.20080590 seconds (74.33% PHP - 25.67% MySQL) with 11 queries
Page generated in 0.30024004 seconds (84.11% PHP - 15.89% MySQL) with 11 queries
Page generated in 2.15881801 seconds (25.50% PHP - 74.50% MySQL) with 11 queries :eek:

I had the same problem. But it's fine within the forums its self. so i don't think it should really matter, unless you have tons hitting up your portal page at one time.

The Realist
06-17-2004, 03:43 PM
I have the following problem:

Page generated in 75498605 seconds (10000% PHP - 0% MySQL) with 12 queries

Any help or ideas why?

neocorteqz
06-17-2004, 05:19 PM
I have the following problem:

Page generated in 75498605 seconds (10000% PHP - 0% MySQL) with 12 queries

Any help or ideas why?
Try rehacking the files. start clean.

The Realist
06-17-2004, 05:50 PM
Checked code and all is 100%.

Anyone?

freakyshiat
07-06-2004, 08:34 PM
Is it possible to add the hostname at the bottom? I am running mutiple web servers, it would help me out :)

Deska
07-07-2004, 07:23 AM
This hack seems not work for vb 3.0.3
Any update for this?

Thank's...

Onkel_Tom
07-07-2004, 10:34 AM
I use also vB3.0.3 and have still this hack installed and works fine.

Colin F
07-07-2004, 10:37 AM
I don't have any problems with vB3.0.3 and this Hack either
What error are you getting?

Deska
07-07-2004, 11:49 AM
I solved my problem.
Sorry for that, :D

TTG
07-15-2004, 12:22 PM
Installed and works fine with 3.0.1. Thanks Tech .. clicked Install

Page generated in 0.25623298 seconds (90.58% PHP - 9.42% MySQL) with 12 queries on main page .. No uncached templates

Page generated in 0.29059601 seconds (81.53% PHP - 18.47% MySQL) with 25 queries on CMPS v1.0.0 portal .. 2 uncached templates

bilco105
07-16-2004, 11:12 AM
I am coming to my wits end with this script now,
Parse error: parse error, unexpected T_STRING in /home/dislexik/public_html/forum/includes/functions.php on line 1865

Heres a quote of lines surround 1865, any advice would be good.

$ms = '<tr align="right">' . "\n";
$ms .= ' <td class="tcat"' . iif($vboptions['allowchangestyles'], ' colspan="2"') . '><div class="smallfont">';
$ms .= 'Page generated in ' . $totaltime . ' seconds (' . $msphp . ' - ' . $mssql . ') with ';
$ms .= $query_count . ' queries</div></td>' . "\n";
$ms .= '</tr>' . "\n";

MickDoneDee
07-17-2004, 11:45 AM
Thanks very much Teck. Have installed and clicked Install.

Using vB3.0.3 and had no problems following the version 1.2 text instructions.

I edited using EditPad Lite. It uses Tabs so that you can have two files open and tab between them for easy comparison.

I don't use a portal and the stats produced on the forum home page with 6 users and 2 spiders online were:

Page generated in 0.13130212 seconds (83.33% PHP - 16.67% MySQL) with 9 queries
DEBUG Mode OFF | GZIP ON (level 1) | 0.04 : 0.13 : 0.17 No uncached templates

That looks relatively normal for a lightly hacked site without a portal and using a shared server.

On one of the Forum Display pages with 6 users online:

Page generated in 0.19516301 seconds (79.20% PHP - 20.80% MySQL) with 14 queries

Server load: 0.06 : 0.23 : 0.21 No uncached templates

You can see that 5 extra queries has increased the server load slightly.

The Members List seems to be more server intensive still:
Server load: 0.33 : 0.31 : 0.24 with only 9 queries.

But still quick loading: Page generated in 0.16052389 seconds (81.20% PHP - 18.80% MySQL)

Logician
07-27-2004, 08:07 PM
Apparently the hack produces invalid stats if MYSQL is compiled in a non-english language. This happens because MYSQL can be configured to use different 'lang_decimalsep' and 'lang_thousandsep' variable values which bothers the number formating through vb_number_format() function.

To fix it, I suggest to find:

$totaltime = vb_number_format($endtime[0] - $starttime[0] + $endtime[1] - $starttime[1], $msdecimal);

in the hack code inside functions.php

and BEFORE that add:

$bbuserinfo['lang_decimalsep']='.'; $bbuserinfo['lang_thousandsep']=',';


This fix forces to use English seperators which the hack code depends so regardless of MYSQL configuration the formatting works fine. ;)

HuangA
07-27-2004, 08:39 PM
On forum home (Admin):
Page generated in 0.11859798 seconds (93.17% PHP - 6.83% MySQL) with 9 queries
Page generated in 0.11566091 seconds (92.98% PHP - 7.02% MySQL) with 9 queries
On forum home (Guest):
Page generated in 0.12545395 seconds (92.30% PHP - 7.70% MySQL) with 9 queries
Page generated in 0.11924601 seconds (93.99% PHP - 6.01% MySQL) with 9 queries
On vBAdvanced Homepage (Admin):
Page generated in 0.16185904 seconds (86.56% PHP - 13.44% MySQL) with 9 queries
Page generated in 0.09283090 seconds (91.52% PHP - 8.48% MySQL) with 9 queries
On vBAdvanced Homepage (Guest):
Page generated in 0.08898401 seconds (93.35% PHP - 6.65% MySQL) with 7 queries
Page generated in 0.10263205 seconds (93.28% PHP - 6.72% MySQL) with 7 queries

Looks pretty good so far... Let's see how this works later when I add more hacks to it ^^

TECK
07-28-2004, 10:36 PM
Apparently the hack produces invalid stats if MYSQL is compiled in a non-english language. This happens because MYSQL can be configured to use different 'lang_decimalsep' and 'lang_thousandsep' variable values which bothers the number formating through vb_number_format() function.

To fix it, I suggest to find:

$totaltime = vb_number_format($endtime[0] - $starttime[0] + $endtime[1] - $starttime[1], $msdecimal);

in the hack code inside functions.php

and BEFORE that add:

$bbuserinfo['lang_decimalsep']='.'; $bbuserinfo['lang_thousandsep']=',';


This fix forces to use English seperators which the hack code depends so regardless of MYSQL configuration the formatting works fine. ;)
Thanks Logician, I added a link in the fist post. :)

Regards,
Floren.

Natch
07-29-2004, 12:44 AM
Should we install this modification regardless of server config ? or only in certain situations ?

TECK
08-13-2004, 02:05 AM
Only if MYSQL is compiled in a non-english language.

Kalakov
08-26-2004, 07:24 AM
I just installed RPG Integration Hack v2.5.1

and this is what I get

Page generated in 8.47130704 seconds (1.54% PHP - 98.46% MySQL) with 26 queries

O_o not good I gues =) full site is going slow

is there a way to check where the problem is ?

MickDoneDee
08-26-2004, 08:19 AM
is there a way to check where the problem is ?
I suggest you need to look at each query in detail to see which ones are taking up most of the time. To do that you need to turn debug mode on as I did. Refer to my post: https://vborg.vbsupport.ru/showpost.php?p=534343&postcount=39

Kalakov
08-26-2004, 09:13 AM
I dint found anything with debug on
I uninstalled the hack but its still pretty high

Page generated in 26.25595188 seconds (1.57% PHP - 98.43% MySQL) with 26 queries

maybe a problem with my host ? :/

deathemperor
08-26-2004, 09:26 AM
nice hack as always
*click install*

Kalakov
08-26-2004, 12:38 PM
Everything running fine now seems it wasnt a problem with a script but with the host =)

venomx
09-11-2004, 08:02 AM
I am getting

Parse error: parse error in /home/forum/public_html/forums/includes/functions.php on line 3876

Fatal error: Call to undefined function: devdebug() in /home/forum/public_html/forums/includes/functions.php on line 957


:((( Someone want to let me know what I have done wrong? I followed everything to a T...

venomx
09-11-2004, 08:30 AM
Fixed LOL Cant believe I made that error.... Works great!

venomx
09-11-2004, 08:34 AM
vBadvanced CMPS v1.0.0
Page generated in 0.35274100 seconds (85.77% PHP - 14.23% MySQL) with 25 queries
DEBUG Mode OFF | GZIP ON (level 1) | 0.11 : 0.24 : 0.30 | NO Uncached Templates

Forum home
Page generated in 0.15533590 seconds (87.42% PHP - 12.58% MySQL) with 17 queries
DEBUG Mode OFF | GZIP ON (level 1) | 0.18 : 0.25 : 0.30 | NO Uncached Templates

theArchitect
09-20-2004, 05:20 AM
Very cool.

*Clicks Install*

venomx
09-21-2004, 03:57 AM
After I moved to my new server...
Page generated in 0.33385205 seconds (49.31% PHP - 50.69% MySQL) with 17 queries
DEBUG Mode OFF | GZIP ON (level 1) | 0.13 : 0.31 : 0.27 | NO Uncached Templates

Jumps from 17 to 32 queries.. This is odd and the mysql % scares me.

Wolf42
09-23-2004, 01:09 PM
I've just installed the hack on my vB 3.0.3 and with Logician's tip its running very well. Thanks for hack TECK!

/me clicks INSTALL

sfowler39
09-24-2004, 12:54 PM
I get this for an error .

Parse error: parse error, unexpected T_STRING in c:\inetpub\wwwroot\vb\includes\functions.php on line 1865

Fatal error: Call to undefined function: is_browser() in c:\inetpub\wwwroot\vb\global.php on line 93

Bhuwan
10-17-2004, 01:55 PM
Great hack man! But how can i remove the admin info (gzip and such)? I tried and could manage to remove only the text and not the listbox.
thanks agian

ChuanSE
11-02-2004, 03:53 AM
Is this hack adapted for vB303? Caus the code modification is not up2date with the files on vB303

thx

neocorteqz
11-02-2004, 04:26 AM
Is this hack adapted for vB303? Caus the code modification is not up2date with the files on vB303

thx
I'm running it on vB3.0.3, with no problems.

ChuanSE
11-02-2004, 05:17 AM
Yes, perfectly possible :)

i want to point out that the txt file with instructions is not up to date...

Search for and replace with... can't replace what can't be searched. the code was ok in previous versions of vB, where I installed the hack myself without problems.

But now mysql_db.php seems to be changed in this version, and i want to be sure to have an updated instruction file, before i start replacing :)

thx if ya wanna update it Teck ;)

TECK
11-03-2004, 04:05 AM
I don't have the 303 update, sorry.
I need to pay the VB update fee, soon next week.

If anyone have the step by step for the new code, post it here so I can update the txt file. Thanks guys.

neocorteqz
11-03-2004, 04:16 AM
I don't have the 303 update, sorry.
I need to pay the VB update fee, soon next week.

If anyone have the step by step for the new code, post it here so I can update the txt file. Thanks guys.
hmmm. as far as i remember, i used your current available instrutions to install it.

when i get the chance, I'll either give the updated instructions, or maybe if it's allowed (seeing as it's only two files afaik) i can send my files to you and you can see for yourself?

I'm about to try and install gentoo, so I'll be unavailable for a bit. :)

venomx
11-03-2004, 04:20 AM
I installed this with the instructions in the current file... worked fine here...

SVTOA
11-28-2004, 11:07 PM
I guess I'm doing ok...

Page generated in 0.16333103 seconds (93.02% PHP - 6.98% MySQL) with 12 queries

TECK
11-29-2004, 05:16 AM
I installed this with the instructions in the current file... worked fine here...
Good to know no update is needed. I was surprised, since the VB3 code should not change...

Guy G
01-25-2005, 04:46 PM
will this by any chance work on 3.0.6

|Jordan|
01-28-2005, 07:06 PM
Works for me in 3.0.6 :D

nso
01-29-2005, 07:02 PM
After applying the hack (correctly, I might add) my forum became nothing more than a blank page. No errors, no nothing. Not even a mention of the event in the mysql logs.

Have anyone experienced anything similar to this?

dfdems
02-20-2005, 10:03 PM
Dumb Question, how do I cache the 3 I have uncached?

Forumhome_stats_Member
Forumhome_stats_Poster
Forumhome_stats_Thread

Page generated in 0.21421003 seconds (90.33% PHP - 9.67% MySQL) with 16 queries

MickDoneDee
02-20-2005, 11:57 PM
There are two Microstats hacks: Teck's and Erwin's. Sites with hacks will usually show uncached templates after installing the Microstats hack. Your question is, therefore, common and the answer can be found by reading through the thread. References I found on Erwins thread (https://vborg.vbsupport.ru/showthread.php?t=59700) are here (https://vborg.vbsupport.ru/showpost.php?p=504110&postcount=130), here (https://vborg.vbsupport.ru/showpost.php?p=504191&postcount=135), here (https://vborg.vbsupport.ru/showpost.php?p=592549&postcount=217), and here (https://vborg.vbsupport.ru/showpost.php?p=592682&postcount=218).

The last reference is: You need to add those templates at the beginning of the php page that you saw the message on. It will speed up the page and reduce the number of queries to the database which will be good for all of your vb installation.If you look in the URL for the page you are displaying when those uncached templates appear you'll see the php file within the address. Index.php usually deals with forumhome templates. Open the index.php file and find:
// pre-cache templates used by all actions
$globaltemplates = array(
'FORUMHOME',
'forumhome_event',
'forumhome_forumbit_level1_nopost',
'forumhome_forumbit_level1_post',
'forumhome_forumbit_level2_nopost',
'forumhome_forumbit_level2_post',
'forumhome_lastpostby',
'forumhome_loggedinuser',
'forumhome_moderator',
'forumhome_pmloggedin',
'forumhome_subforumbit_nopost',
'forumhome_subforumbit_post',
'forumhome_subforumseparator_nopost',
'forumhome_subforumseparator_post'Add your templates to this list. Alternatively, I use the global.php file which is used for every page loaded. There, you'll find:
// templates to be included in every single page...
$globaltemplates = array_merge($globaltemplates, array(
// the really important ones
'header',
'footer',
'headinclude',
'phpinclude_start',
'phpinclude_end',
// new private message script
'pm_popup_script',
// navbar construction
'navbar',
'navbar_link',
// forumjump and go button
'forumjump',
'gobutton',
'option',
// multi-page navigation
'pagenav',
'pagenav_curpage',
'pagenav_pagelink',
'threadbit_pagelink',
// misc useful
'spacer_open',
'spacer_close',
'username_loggedout',
'username_loggedin',
'timezone',
'STANDARD_ERROR',
'STANDARD_REDIRECT'
//'board_inactive_warning'
));Add your templates to that list and it should also cache them. No need to add your templates to both files. Choose one or the other.

kall
03-06-2005, 06:56 PM
Yes, perfectly possible :)

i want to point out that the txt file with instructions is not up to date...

Search for and replace with... can't replace what can't be searched. the code was ok in previous versions of vB, where I installed the hack myself without problems.

But now mysql_db.php seems to be changed in this version, and i want to be sure to have an updated instruction file, before i start replacing :)

thx if ya wanna update it Teck ;)
Well, upgrade to 3.0.7.

The instructions for installing this hack match the code in the stock files to the very last character.

greenhybrid
04-10-2005, 05:45 PM
I'm getting the following error. Any idea?Parse error: parse error, unexpected ']' in /home/gh/public_html/discuss/includes/functions.php on line 1997

venomx
04-10-2005, 06:55 PM
My site seems to use like 80%+ mysql.. that scares me and I dunno why it does :(

TECK
04-11-2005, 04:10 AM
Using some of those vb3 'portals', as frontpage? Is normal, they are known for killing your server with a large number of queries that scan the hole tables, instead of small to the point sections.
Remove the portal and stick with the normal vb3 forumhome.

ChrisLM2001
04-12-2005, 04:13 PM
Teck,

Can you add an option of memory used per page (like vB's debug mode) for Admins? Finding it useful in tracking down bloat, and it'll be a handy addition for Admins who are monitoring their memory limits.

Love this mod. Comes in so handy monitoring day-to-day performance at a glance.

Chris

greenhybrid
04-23-2005, 06:35 PM
It's been weeks and still no help? :(

PitchouneN64ngc
04-24-2005, 12:37 PM
It's been weeks and still no help? :(

This hack has no problem during the installation. What is the code on the line 1997 in ./includes/functions.php (include 4-5 lines before and after the line 1997)?

greenhybrid
04-24-2005, 04:13 PM
I made the replacements again so I could find the line. $ms = '<tr align="right">' . "\n";
$ms .= ' <td class="tcat"' . iif($vboptions['allowchangestyles'], ' colspan="2"') . '><div class="smallfont">';
$ms .= 'Page generated in ' . $totaltime . ' seconds (' . $msphp . ' - ' . $mssql . ') with ';
$ms .= $query_count . ' queries</div></td>' . "\n";
$ms .= '</tr>' . "\n"; What was 1997 before I think is 1996 now. That would be $ms .= ' <td class="tcat"' . iif($vboptions['allowchangestyles'], ' colspan="2"') . '><div class="smallfont">';

greenhybrid
04-24-2005, 04:17 PM
This time when I installed AGAIN I got this error: Parse error: parse error, unexpected T_STRING, expecting '{' in /home/gh/public_html/discuss/includes/db_mysql.php on line 188 Line 188 is the last {
function shutdown_query($query_string, $arraykey = 0)
{
global $shutdownqueries;

if (NOSHUTDOWNFUNC AND !$arraykey)
{
return $this->query($query_string);
}
elseif ($arraykey)
{
$shutdownqueries["$arraykey"] = $query_string;
}
else
{
$shutdownqueries[] = $query_string;
}
} function query($query_string, $query_type = 'mysql_query')
{
global $query_count, $querytime, $pagestarttime;

$pageendtime = microtime();
$starttime = explode(' ', $pagestarttime);
$endtime = explode(' ', $pageendtime);

PitchouneN64ngc
04-24-2005, 04:23 PM
Place the line :

function query($query_string, $query_type = 'mysql_query')

At the next line, maybe PHP confuses with the } before.

greenhybrid
04-24-2005, 04:35 PM
Then we get a Parse error: parse error, unexpected ')', expecting ',' or ';' in /home/gh/public_html/discuss/includes/db_mysql.php on line 50
// connect to db server

global $querytime;
// do query

PitchouneN64ngc
04-24-2005, 04:42 PM
You have these errors when you try to view your pages during the installation of this hack or totally after ?

greenhybrid
04-24-2005, 04:50 PM
What do you mean? "Installation" is simply editing the 2 files, which I did. I didn't change the templates yet, but that should have nothing to do with the code.

greenhybrid
04-24-2005, 04:54 PM
I even added {ms} the template and I'm still getting Parse error: parse error, unexpected T_STRING in /home/gh/public_html/discuss/includes/functions.php on line 1996 ;)

Mosh
04-25-2005, 08:45 AM
I even added {ms} the template and I'm still getting Parse error: parse error, unexpected T_STRING in /home/gh/public_html/discuss/includes/functions.php on line 1996 ;)
It would probably help if you quoted lines 1990 to 2010 from your functions.php file, this may help someone to narrow down your problem.

greenhybrid
04-25-2005, 06:20 PM
Something weird is going on. I don't know if it's a Dreamweaver bug or not, but when I open up functions.php again, that same line 1996 is now $ms .= ' <td class="tcat"' . iif($vboptions['allowchangestyles'], '],'],'],' colspan="2"') . '><div class="smallfont">'; The same thing had happened before, so I redid the edits. It keeps happening, though!

1990-2010 are $totaltime = vb_number_format($endtime[0] - $starttime[0] + $endtime[1] - $starttime[1], $msdecimal);

$msphp = vb_number_format(((($totaltime - $querytime) / $totaltime) * 100), 2) . '% PHP';
$mssql = vb_number_format((($querytime / $totaltime) * 100), 2) . '% MySQL';

$ms = '<tr align="right">' . "\n";
$ms .= ' <td class="tcat"' . iif($vboptions['allowchangestyles'], '],'],'],' colspan="2"') . '><div class="smallfont">';
$ms .= 'Page generated in ' . $totaltime . ' seconds (' . $msphp . ' - ' . $mssql . ') with ';
$ms .= $query_count . ' queries</div></td>' . "\n";
$ms .= '</tr>' . "\n";

if ($bbuserinfo['usergroupid'] == '6')
{
$mstemplates = '<select size="1" style="font-size: 10px">' . "\n";

if ($_TEMPLATEQUERIES)
{
$mstemplates .= '<option>' . sizeof($_TEMPLATEQUERIES) . ' Uncached Template';
$mstemplates .= iif(sizeof($_TEMPLATEQUERIES) != '1', 's') . '</option>';

if (is_array($tempusagecache))

TECK
04-26-2005, 11:15 AM
Dreamweaver is known for issues like that. Use the Textpad.com editor instead.
You will never have a problem again editing files...

yinyang
04-26-2005, 06:25 PM
teck, i really want to install this, but the codes you indicate to replace are different in vb3.07. can we trouble you in updating this to 3.07? please?

greenhybrid
04-26-2005, 06:26 PM
They are different, but they're similar. Of course, I'm the one who had the problems before ;) But, you should be able to find the right code.

greenhybrid
04-26-2005, 06:42 PM
Then again, maybe that's why I was getting my errors.

TECK
04-27-2005, 10:49 PM
I don't have the upgrade available, I will need to pay the 30$ fee in order to do download the latest version...
As soon I can spare a little money, it will be done. :)

venomx
04-27-2005, 11:01 PM
I believe I have this running on 3.0.7

greenhybrid
04-27-2005, 11:10 PM
How did you install it without identical code?

TECK
06-02-2005, 03:06 AM
The code should not change at all... when v3.5 is out, I will make sure this hack is compatible with the renovated version. :)

Oblivion Knight
06-02-2005, 04:42 AM
There's only a line or 2 that has changed in that block of code for 3.0.7 and is easy enough to install.. ;)

neocorteqz
06-02-2005, 11:19 AM
The code should not change at all... when v3.5 is out, I will make sure this hack is compatible with the renovated version. :)
Looking forward to it, well the hack too. :p :)

shadiguy1
06-02-2005, 01:33 PM
whenever i try and cache templates i always get parse errors why is this.

TECK
06-03-2005, 03:16 AM
I promise that I will renew my license soon. :)
I want to get back on the forums and make many people happy with a very elegant front page that will not kill the server, as well few other cool VB hacks. vbHome at it's shine place. :)

Talk to you soon guys.

RaceJunkies
07-02-2005, 03:35 AM
Anyone have updated code for 3.0.7 or have it working?

Let me know.... :rolleyes:

Bad Bunny
07-02-2005, 12:37 PM
I promise that I will renew my license soon. :)
I want to get back on the forums and make many people happy with a very elegant front page that will not kill the server, as well few other cool VB hacks. vbHome at it's shine place. :)

Talk to you soon guys.
Sounds good, Tech. I missed your frontpage for vb3.

futureal
07-04-2005, 10:52 PM
Anyone have updated code for 3.0.7 or have it working?
It worked for me in 3.0.7 with no problems. What problem are you having?

RaceJunkies
07-05-2005, 09:30 PM
Got it working now.... :devious:

NxTek
07-15-2005, 09:17 PM
REGULAR USERS
- load time of specified page in microseconds
- number of queries executed
- PHP percent page usage
- MySQL percent page usage

How can I display MicroStats only to Administrators? Call me crazy but do you really think members in Registered Users really care about this? :)

Pseudomizer
07-15-2005, 10:01 PM
How can I display MicroStats only to Administrators? Call me crazy but do you really think members in Registered Users really care about this? :)

In your template: if bbusergroupid = 6 bla bla before the {ms} entry and an endif after and all set all done.

Cheers,

NxTek
07-16-2005, 04:25 PM
I'll give that a try. Thanks.

I'm using vB, vBadvanced, and a custom PHP/MySQL application within vBadvanced. Will MicroStats report ALL the stats?

ManagerJosh
07-19-2005, 07:06 AM
Hey Teck:

Any ETA on the 3.5 Version :p? :)

csidlernet
07-20-2005, 07:28 AM
/me installed this hack in 0.1seconds

NxTek
07-24-2005, 08:59 PM
I'll give that a try. Thanks.

I'm using vB, vBadvanced, and a custom PHP/MySQL application within vBadvanced. Will MicroStats report ALL the stats?

Anyone? :)

Wrestling-Freek
08-02-2005, 02:40 AM
Awesome hack!!

Just what I've been looking for!

Thanks. :cool: :cool: :cool:

bjs144
08-24-2005, 04:21 PM
Top mod.

Thanks alot

Mikecp421
09-12-2005, 05:08 AM
I have been having a slowdown on my site all day. I installed this hack to get info on it and could someone tell me what this means.

Page generated in 28.27157903 seconds (0.86% PHP - 99.14% MySQL) with 12 queries

THat was the result of posting a message.

and this was the loading of my index

Page generated in 2.80730700 seconds (9.32% PHP - 90.68% MySQL) with 10 queries

although it was fast this time would those numbers point towards a potential bad code somewhere? I did some editing, thats why I ask, Thanks.