vb.org Archive

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

Jakub03 01-15-2012 01:02 AM

total thread views
 
In statistics on bottom of page it shows like total threads, and total posts. Is there a way to show total thread views?

Boofo 01-15-2012 01:38 AM

Yes, but you would have to run a query to get that info.

Jakub03 01-15-2012 01:45 AM

Is that hard to do?

Boofo 01-15-2012 01:58 AM

Not at all. I do it for my forumhome stats cache mod on my site. Here is the query I use:

PHP Code:

$threadviews $vbulletin->db->query_first("
    SELECT SUM(views) AS tviews
    FROM " 
TABLE_PREFIX "thread
"
); 


Jakub03 01-15-2012 03:04 AM

does this take a lot of server usage? and sorry im such a nub lol where do i input the query?

Boofo 01-15-2012 03:13 AM

You would put it in the forumhome_complete hook as a plugin and use {vb:raw threadviews.tviews} in the forumhome template where you want it to show. Make sure you pre-regsiter the variable in the forumhome template.

Jakub03 01-15-2012 07:15 PM

Is it possible to make the total thread views appear only on specific forums?
https://vborg.vbsupport.ru/external/2012/01/49.png

Like for it to count the total views that the individual threads get, not the forums. :P
http://mypokerhub.com/forumdisplay.p...y-Poker-Hub-TV is the link to the page i want to display total views.


All times are GMT. The time now is 09:00 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.01005 seconds
  • Memory Usage 1,719KB
  • 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_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete