vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=33)
-   -   VB3 MicroStats (https://vborg.vbsupport.ru/showthread.php?t=62173)

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:

PHP Code:

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

REPLACE it with:

PHP Code:

        $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

Quote:

Originally Posted by Boofo
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:
Code:

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

Quote:

Originally Posted by Boofo
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. :)


All times are GMT. The time now is 07:13 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.01227 seconds
  • Memory Usage 1,784KB
  • 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
  • (1)bbcode_code_printable
  • (2)bbcode_php_printable
  • (2)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
  • (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