vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   total thread views (https://vborg.vbsupport.ru/showthread.php?t=39037)

BaldNut 05-25-2002 12:02 PM

total thread views
 
what is the code i would add into my stats panel to have the total thread views info please.

Visionray 12-04-2002 02:50 AM

bump

Automated 03-28-2003 11:06 AM

i would like this too! Kinda like what they have here at VB.org

Xenon 03-28-2003 12:57 PM

open index.php
find:
PHP Code:

$countthreads=$DB_site->query_first('SELECT COUNT(*) AS threads FROM thread');
$totalthreads=number_format($countthreads['threads']); 

change to:
PHP Code:

$countthreads=$DB_site->query_first('SELECT COUNT(*) AS threads, SUM(views) AS views FROM thread');
$totalthreads=number_format($countthreads['threads']);
$totalviews=number_format($countthreads['views']); 

then put $totalviews to you templates :)

Darwinist 04-13-2003 01:38 AM

I got errors when I used the code. I fixed it with this...

$countthreads=$DB_site->query_first('SELECT COUNT(*) AS threads, SUM(views) AS views FROM thread');
$totalthreads=number_format($countthreads['threads']);
$totalviews=number_format($countthreads['views']);

..."number_format(" doesn't show up under the PHP vB Code statement.

Mijae 04-13-2003 02:42 AM

Would this add an extra query to forumhome?

Logician 04-13-2003 08:45 AM

Quote:

Today at 06:36 AM v0id said this in Post #6
Would this add an extra query to forumhome?
yes.. everytime you see a line "$DB_site->query" within a code, you can safely regard, you added a query to that page.

Darwinist 04-13-2003 11:49 AM

The "$DB_site->query" was there already... the line wasn't added, only changed.

Logician 04-13-2003 11:54 AM

Quote:

Today at 03:43 PM pgt91 said this in Post #8
The "$DB_site->query" was there already... the line wasn't added, only changed.
ok then reverse logic: since there is no new "$DB_site->query" line, there is no extra query added.. ;)

Xenon 04-13-2003 03:56 PM

even so it's a slow query, which will slow down loading forumhome a bit.

i'm not a fan of threadviews on forumhome because it isn't really usefull and just slows down the page....


All times are GMT. The time now is 01:37 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.01077 seconds
  • Memory Usage 1,737KB
  • 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_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (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