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 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.



All times are GMT. The time now is 03:53 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.02068 seconds
  • Memory Usage 1,752KB
  • 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
  • (2)bbcode_code_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (3)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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