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)
-   -   Forum statisctics at the top of each forum (https://vborg.vbsupport.ru/showthread.php?t=52215)

Boofo 05-15-2003 12:26 AM

grog6, any more fixes or updates for this hack?

Boofo 05-16-2003 08:06 AM

Well, since no one else seems to be supporting this hack now, I have an update that will knock 2 queries off of the stats.

Find these 3 queries and delete them:

PHP Code:

$nbeposts=$DB_site->query_first("SELECT SUM(replycount) AS reply FROM `thread` WHERE forumid=$forumid");
$nbepost=number_format($nbeposts['reply']);

$nbemesss=$DB_site->query_first("SELECT COUNT(*) AS nbe FROM thread WHERE forumid=$forumid");
$nbemess=$nbemesss['nbe'];
$numthreads number_format($nbemess);

$vues=$DB_site->query_first("SELECT SUM(views) AS vu FROM thread WHERE forumid='$forumid'");
$vue=number_format($vues['vu']); 

Use this single query instead:

PHP Code:

$nbeposts=$DB_site->query_first("SELECT COUNT(*) AS nbe, SUM(replycount) AS reply, SUM(views) AS vu FROM `thread` WHERE forumid=$forumid");
$nbepost=number_format($nbeposts['reply']);
$numthreads number_format($nbeposts['nbe']);
$vue=number_format($nbeposts['vu']); 

You will also need to find:

PHP Code:

$avgposteur=(($avgposteuri/$nbemess)*100); 

and change it to:

PHP Code:

$avgposteur=(($avgposteuri/$nbeposts['nbe'])*100); 

for the average poster stat to work with the new query.

Crazy Pete 05-16-2003 11:58 AM

Thanks for the update, Boofo! Any way to save a few queries, I'm all over it. :)

Boofo 05-16-2003 03:52 PM

You're very welcome. ;)

grog6 05-16-2003 08:26 PM

Sorry :(

I really have too work for the moment, and can't provide any support for this hack.

As soon as possible, I'll look, udpate the hack with your work Boofo, and try to help for support here.
Sorry but I can't now :(

Boofo 05-19-2003 08:07 PM

Since Grog6 has not had time to support this hack, an updated (with his permission) and expanded version of this has been released in this thread:

https://vborg.vbsupport.ru/showthrea...threadid=53138

CRego3D 05-20-2003 01:20 AM

excellent .. :)


All times are GMT. The time now is 05:09 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.01859 seconds
  • Memory Usage 1,734KB
  • 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_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (7)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