vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   vbMicroStats: page load time, queries, GZIP and PHP version (https://vborg.vbsupport.ru/showthread.php?t=35811)

TECK 05-25-2002 10:17 PM

Quote:

Originally posted by DWZ
Done that and its working fine now :D
i'm glad you got it working. congrats.

mtf169 05-26-2002 04:39 PM

Quote:

Originally posted by nakkid
ahh, the pic you show in the link was due to the PHP version. it was to old. what MySQL and PHP ver you run?
I'm running this on my test server on windows, which is using the following:

MySQL 3.23.32
PHP 4.0.4
Apache 1.3.14

What's the minimum I need to get this to run? If I need to upgrade my php is it an easy process? I installed a free server package for windows by Nusphere, which had everything bundled together that I needed. My actual website server, which is shared, uses php 4.0.6. Obviously, I have no way to modify that.

TECK 05-26-2002 05:59 PM

ya. it was his prob too. he ran PHP404. can you upgrade to PHP412 at least? i did test it to this version. i'm not sure what is the lowest version you can get it to work, but it's working for PHP 4.2.1-4.1.2 versions.

mtf169 05-26-2002 10:43 PM

I downloaded the newest php and installed it on my windows machine. Now the hack works flawlessly! Thanks for the help and the awesome hack. Now I just have to figure out if I can cut down some of the queries. :p

Keep up the good work!

Boofo 05-26-2002 11:11 PM

It works with PHP 4.0.6 just fine, too. :)

Quote:

Originally posted by nakkid
ya. it was his prob too. he ran PHP404. can you upgrade to PHP412 at least? i did test it to this version. i'm not sure what is the lowest version you can get it to work, but it's working for PHP 4.2.1-4.1.2 versions.

Smoothie 05-27-2002 06:30 AM

Excellent work. Installed and working fine.

TECK 05-27-2002 09:30 PM

Quote:

Originally posted by Boofo
It works with PHP 4.0.6 just fine, too. :)
Thanks alot Boofo. at least we know for sure that the lowest working version for this hack is PHP4.0.6.
This will be handy for some users. I will post it in the starting post.
Also, I will release later on the update for VB226.

Boofo 05-28-2002 01:48 AM

No problem, glad I can contribute in some way for such a great hack! :)

kennethj 05-28-2002 08:30 PM

Quote:

[i] I will release later on the update for VB226. [/B]
Works like a charm - tnks for the prommpt update :)

Erwin 06-01-2002 08:09 AM

Beautiful.

Works with 2.2.6 without a problem. Thanks!

nuno 06-01-2002 11:35 PM

Quote:

+-----------------------------------------------+
| FINAL STEPS |
+-----------------------------------------------+
| To call your vbMicroStats, simply place the string {getmicrostats}
| anywhere you want in your templates (for example in footer).
there's no need to call {getmicrostats} :confused:
replace
PHP Code:

$microstats='Page generated in '.$trimmedtime.' seconds ('.$percentphp.' - '.$percentsql.') with '.$query_count.' queries.<br>'.$adminstats

with
PHP Code:

$vartext .='<center><smallfont>Page generated in '.$trimmedtime.' seconds ('.$percentphp.' - '.$percentsql.') with '.$query_count.' queries.<br></smallfont></center>'.$adminstats

and no longer is needed template editing :paranoid:

Boofo 06-02-2002 07:53 AM

If you did it this way, you wouldn't be able to decide where it goes. :) And where would it show up with the way you have it here?

Quote:

Originally posted by nuno

there's no need to call {getmicrostats} :confused:
replace
PHP Code:

$microstats='Page generated in '.$trimmedtime.' seconds ('.$percentphp.' - '.$percentsql.') with '.$query_count.' queries.<br>'.$adminstats

with
PHP Code:

$vartext .='<center><smallfont>Page generated in '.$trimmedtime.' seconds ('.$percentphp.' - '.$percentsql.') with '.$query_count.' queries.<br></smallfont></center>'.$adminstats

and no longer is needed template editing :paranoid:


nuno 06-02-2002 10:07 AM

like this it goes below copyright text :)

Boofo 06-02-2002 06:18 PM

I tried it but couldn't get it to display right. The second line (for Admin only) was in normalfont and spaced an extra line below the first line. When I tried to moved the center and smallfont, if gave me a blank page when I tried to load my site. :)

TECK 06-03-2002 02:39 AM

nuno, the {getmicrostats} variable is useful to users who want more control over their html code.
for example, if you have vbPortal installed, it will show ur stats in every block, if you do it your way.

Henry-RS 06-05-2002 02:52 AM

Code:

$templatesused.=',pagenav,pagenav_curpage,pagenav_firstlink,pagenav_lastlink,pagenav_nextlink,pagenav_pagelink,pagenav_prevlink';
That code, is not even in /forum/global.php >=(

Ahh, nevermind. I was just having one of those moments. :) :embarrased:

Jadelit 06-06-2002 05:11 AM

I am getting this error..

Code:

Parse error:  parse error, expecting `','' or `';'' in C:\Inetpub\****\board\admin\functions.php</b> on line 474

Fatal error:  Call to undefined function:  iif() in C:\Inetpub\****\board\admin\functions.php on line 352

im using vb 2.2.6

The Piper 06-09-2002 08:53 PM

This script is really great, I have it working on my site and it's really useful. A suggestion I'd like to make: how about adding stats on the server loads as well?

Thanks a lot and congrats nakkid on an awesome script!

Paulo

TECK 06-10-2002 12:06 AM

thanks for your nice words. a quick thing.. i noticed you have 48queries on your main page. this is extremly high. over 40, your server goes on the red line, on a busy site.

The Piper 06-10-2002 01:42 AM

Thanks for the advice, nakkid. Yeah, I'm trying to lower that. I took the polls off but it's still pretty high. I'm planning on reinstalling vbIndex because I'm running an older version, so I'll be able to mess up with the code a bit to try and lower that.

TECK 06-10-2002 01:46 AM

you could also look at vbHome. is a hack i dont support anymore, but worth a shot.

TECK 06-22-2002 01:52 AM

version 2.1 released. i added the Server Load. check the screenshot...
sorry guys but i cant send the email update. the list is to big and the browser times out.
please let me know if everything is ok with the new mod.

Boofo 06-22-2002 02:05 AM

Can you list what code is updated in this release so we can just add the code we need for the new stuff if we already have it installed? :)

Quote:

Originally posted by nakkid
version 2.1 released. i added the Server Load. check the screenshot...
sorry guys but i cant send the email update. the list is to big and the browser times out.
please let me know if everything is ok with the new mod.


TECK 06-22-2002 02:10 AM

change the '## Start dooutput ##' hack section only. the changes are there. :)

Boofo 06-22-2002 02:24 AM

I did the section you said, but the server load doesn't show. :)

Quote:

Originally posted by nakkid
change the '## Start dooutput ##' hack section only. the changes are there. :)

TECK 06-22-2002 02:30 AM

did you do it on your live server? it wont work if you do it on intranet.
also make sure the file says at the top:
vbMicrostats 2.1, not 2.0

Boofo 06-22-2002 02:34 AM

What do you mean? Sorry, I guess I don't understand. :) Check out my site and you'll see what I mean.

My site

Quote:

Originally posted by nakkid
did you do it on your live server? it wont work if you do it on intranet.

TECK 06-22-2002 02:36 AM

ok. you did it on your live site. good. well, go to your admin CP and let me know if you see the server load stats there.

make sure the vbMicrostats file is v2.1. at the top of the text file you have the version marked.
i noticed that if you download a new file it will cache it in your browser as the old one. you will need to delete all your temp files and cookies.

TECK 06-22-2002 02:41 AM

Upgrade to Version 2.1
Change only the code segment listed below in your v2.0:

File: FORUM/admin/functions.php

FIND:
Code:

// ###################### Start dooutput #######################
function dooutput($vartext,$sendheader=1) {

  global $pagestarttime,$query_count,$showqueries,$querytime,$DB_site,$gzipoutput,$gziplevel,$bbuserinfo,$microstats;

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

  // time format (how many digits you want to show)
  $digits=8;

  $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';

  if ($bbuserinfo['usergroupid']==6) {
    if ($debug==1) {
      $debugmode='Debug Mode <font color="#E4630A">ON</font>';
    } else {
      $debugmode='Debug Mode OFF';
    }
    if ($gzipoutput==1) {
      $gziptext='GZIP <font color="#E4630A">enabled</font> - level '.$gziplevel;
    } else {
      $gziptext='GZIP disabled';
    }
    $versionnum=phpversion();
    $adminstats='<br>['.$debugmode.'] [PHP v'.$versionnum.'] ['.$gziptext.']';
  } else {
    $adminstats='';
  }

  if ($showqueries) {
    $vartext .= "<!-- Page generated in $totaltime seconds with $query_count queries -->";
  } else {
    eval("\$microstats = \"".gettemplate('home_microstats')."\";");
  }

REPLACE IT WITH:
Code:

// ###################### Start dooutput #######################
function dooutput($vartext,$sendheader=1) {

  global $pagestarttime,$query_count,$showqueries,$querytime,$DB_site,$gzipoutput,$gziplevel,$bbuserinfo,$microstats;

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

  // time format (how many digits you want to show)
  $digits=8;

  $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';

  if ($bbuserinfo['usergroupid']==6) {
    if ($debug==1) {
      $debugmode='Debug Mode <font color="{ hovercolor }">ON</font>';
    } else {
      $debugmode='Debug Mode OFF';
    }
    if ($gzipoutput==1) {
      $gziptext='GZIP <font color="{ hovercolor }">enabled</font> - level '.$gziplevel;
    } else {
      $gziptext='GZIP disabled';
    }
    $versionnum=phpversion();
    if ($stats=@exec('uptime')) {
      preg_match('/averages?: ([0-9\.]+),[\s]+([0-9\.]+),[\s]+([0-9\.]+)/',$stats,$regs);
      $serverload=' [Server Load: <font color="{ hovercolor }"><b>'.$regs[1].'</b></font> ? '.$regs[2].' : '.$regs[3].']';
    }
    $adminstats='<br>['.$debugmode.'] [PHP v'.$versionnum.'] ['.$gziptext.']'.$serverload;
  } else {
    $adminstats='';
  }

  if ($showqueries) {
    $vartext .= "<!-- Page generated in $totaltime seconds with $query_count queries -->";
  } else {
    eval("\$microstats = \"".gettemplate('home_microstats')."\";");
  }

Make sure you remove the spaces between the { hovercolor } brackets.

Boofo 06-22-2002 02:50 AM

Where in my admin cp would I see this? And I replaced the code you suggested below before I wrote you the first time. :)

Quote:

Originally posted by nakkid
ok. you did it on your live site. good. well, go to your admin CP and let me know if you see the server load stats there.

make sure the vbMicrostats file is v2.1. at the top of the text file you have the version marked.
i noticed that if you download a new file it will cache it in your browser as the old one. you will need to delete all your temp files and cookies.


TECK 06-22-2002 02:58 AM

ic. then your server doesnt allow you to view the stats. ask your host why.
you should see your server load on the main page where you see all the info and dev information.
vb is designed in a way that it will not show you the Average Server Load if your server is not set to do so.

here it is mine's (freddie's hack with server load integrated):

Boofo 06-22-2002 03:03 AM

You're using Quick Stats, right? My Quick Stats doesn't even have the server load option in it. I checked my /admin/index.php and it isn't even listed in it. That really doesn't tell us anything if I don't have it there does it? :)

Quote:

Originally posted by nakkid
ic. then your server doesnt allow you to view the stats. ask your host why.
you should see your server load on the main page where you see all the info and dev information.
vb is designed in a way that it will not show you the Average Server Load if your server is not set to do so.

here it is mine's (freddie's hack with server load integrated):


TECK 06-22-2002 03:04 AM

i know it doesnt. is me who add it there. but vB should have it separate. i just didnt like the way it looked so i made it compact.

Boofo 06-22-2002 03:06 AM

Can you give me the code for it so I can add it and see? I have never seen it in the admin CP (I am still running 2.2.5 if that makes any difference). :)

Quote:

Originally posted by nakkid
i know it doesnt. is me who add it there. but vB should have it separate. i just didnt like the way it looked so i made it compact.

TECK 06-22-2002 03:27 AM

there is nothing to add. is there the code, right below the quick stats table. it was always there in the admin panel since vb was created.

Boofo 06-22-2002 03:30 AM

All I have below the quick stats is the Useful Admin Stuff box, nothing else.

TECK 06-22-2002 04:10 AM

contact your host and open a ticket at vb.com.

Boofo 06-22-2002 04:16 AM

Why do I need to contact vb.com and make a ticket?

Quote:

Originally posted by nakkid
contact your host and open a ticket at vb.com.

Smoothie 06-22-2002 04:19 AM

Boofo-

When you first go to your admin index, you should see your server loads at the very top of the page, under useful admin stuff. Right in the middle of the page.

Boofo 06-22-2002 04:21 AM

To tell you the truth, I don't recall EVER seeing that. :)

Quote:

Originally posted by Smoothie
Boofo-

When you first go to your admin index, you should see your server loads at the very top of the page, under useful admin stuff. Right in the middle of the page.



All times are GMT. The time now is 03:18 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.02328 seconds
  • Memory Usage 1,845KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (4)bbcode_code_printable
  • (4)bbcode_php_printable
  • (15)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete