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 04-28-2002 03:51 PM

ok.. i added the code above.

b-b00gie 04-30-2002 04:37 AM

This hack is giving me so much trouble installing it... :-\


i'm getting the following error:

Code:

Parse error: parse error in /home2/public_html/forum/admin/functions.php on line 496

Fatal error: Call to undefined function: iif() in /home2/public_html/forum/admin/functions.php on line 351


I've gone over the install 20+ times. I verified that I made the correct changes and to the correct files.


If I undo the changes to functions.php (copy the text to replace from the install file) everything goes back to normal. When I replace the text I get the error again. :depressed:


I'm using 2.2.5 btw.

b-b00gie 04-30-2002 04:49 AM

additionally...


this is my line 351 in functions.php

PHP Code:

$usercache["$userid"]['showvbcode'] = iif(($usercache["$userid"]['options'])&SHOWVBCODE,1,0); 




this is my line 496 in functions.php

PHP Code:

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

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

  
$pageendtime=microtime();

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

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

  
$totaltime=$endtime[0]-$starttime[0]+$endtime[1]-$starttime[1];
  
$trimmedtime=number_format($totaltime,$digits);
  
$percentphp=number_format(((($totaltime-$querytime)/$totaltime)*100), 2)."% PHP";
  
$percentsql=number_format((($querytime/$totaltime)*100), 2)."% MySQL";

  if (
$bbuserinfo['usergroupid']==6) {
    if (
$gzipoutput==1) {
      
$gziptext="GZIP library compression enabled (level $gziplevel)";
    } else {
      
$gziptext="GZIP library compression disabled";
    }
    if (
$debug==1) {
      
$debugmode="(Debug mode)";
    } else {
      
$debugmode="";
    
$versionphp=phpversion();
    
$adminstats="PHP version $versionphp $debugmode with $gziptext. [<a href=\"$PHP_SELF?explain=1\" target=\"_blank\">details</a>]";
  } else {
    
$adminstats="";
  }

  if (
$showqueries) {
    
$vartext .= "<!-- Page generated in $totaltime seconds with $query_count queries -->";
  } else {
    
$microstats "Page generated in $trimmedtime seconds ($percentphp - $percentsql) with $query_count queries.<br> 
                   
$adminstats";
  } 


Line 494: } else {
Line 495: $adminstats="";
Line 496: }

TECK 04-30-2002 05:21 AM

remove $debug from the global.
then remove:
Code:

    if ($debug==1) {
      $debugmode="(Debug mode)";
    } else {
      $debugmode="";

also remove $debugmode variable from $adminstats line... is useless information. i will mod the hack right now. this debug thing gave me only problems.

b-b00gie 04-30-2002 06:42 PM

Quote:

Originally posted by nakkid
remove $debug from the global.
then remove:
Code:

    if ($debug==1) {
      $debugmode="(Debug mode)";
    } else {
      $debugmode="";

also remove $debugmode variable from $adminstats line... is useless information. i will mod the hack right now. this debug thing gave me only problems.


That did it! No more error. :classic: It works great now.

TECK 04-30-2002 07:49 PM

i'm glad. congrats... and sorry, it was my mistake that code. it will work only if you have $debug enabled in config.php

b-b00gie 04-30-2002 08:38 PM

Just a question... is there a way to limit the decimal places of the load time?

For example, I get something like: Page generated in .2973462 seconds...

Can I limit it to 2 or 3 decimal places somehow? not sure :\

TECK 04-30-2002 09:14 PM

Code:

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

change it to what value you want. if you want to show the last 4 digits, it should be $digits=4;
so it will look like: Page generated in 0.2973 seconds...

b-b00gie 04-30-2002 10:48 PM

Silly mistake! I didnt see the variable... Thanks again for all your help.
;)

TECK 05-01-2002 02:09 AM

firefly, i noticed something related to your code addon for this hack. in your site, the PHP % is always smaller then the MySQL %.
the normal way is: your PHP value should always be bigger then the MySQL one (like it's supposed to be in EXPLAIN=1). everyone's page does that, except here at vB.org. just letting you know. if i'm wrong, correct me please.


All times are GMT. The time now is 11:11 AM.

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.02061 seconds
  • Memory Usage 1,762KB
  • 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
  • (2)bbcode_php_printable
  • (1)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