Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 2.x > vBulletin 2.x Full Releases
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Details »»

Version: , by SystemLogic SystemLogic is offline
Developer Last Online: Jan 2003 Show Printable Version Email this Page

Version: 2.2.x Rating:
Released: 04-19-2001 Last Update: Never Installs: 27
 
No support by the author.

This hack was done by Kier, just wanted to post it in its own thread

What It Does

Counts all the views for each thread and adds them together. Basically a sum of the pageviews for all of your threads.

How To Implement This

Copy and paste this code into index.php in the regular forum directory.

PHP Code:
// Total Thread Views

$boardviews $DB_site->query_first("
    SELECT SUM(views) AS threadviews FROM thread"
);
$totalviews number_format($boardviews[threadviews]); 
Then just print $totalviews anywhere you want.

Example: http://www.systemlogic.net/boards on the top left next to the number of posts/threads stats.

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #22  
Old 05-27-2001, 08:50 AM
Alwaysmefirst Alwaysmefirst is offline
 
Join Date: Oct 2001
Posts: 3
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Very cool hack
Thanks for posting it.

Olly
Reply With Quote
  #23  
Old 05-28-2001, 04:34 PM
max max is offline
 
Join Date: Oct 2001
Posts: 9
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks for the hack, very nice.
Is there any way to include this hack onto a Non-VB page?
I've added the correct code into my /forums/index.php..
and then I made a new file named totalthreadviews.inc.php with this code:
Code:
<?php

$font = "Verdana";
$fontsize = "8pt";

require("/home/max/public_html/forums/index.php");
$boardviews = $DB_site->query_first("
SELECT SUM(views) AS threadviews FROM thread");
$totalviews = number_format($boardviews[threadviews]);
echo "<font-family: $font; font-size: $fontsize\"><b>$totalviews</b> total thread views</font>";
?>
Then I opened up my non-vb page and tried to include that file.. but it didn't work at all..
Any ideas on this one?
Reply With Quote
  #24  
Old 05-29-2001, 12:54 PM
Martz's Avatar
Martz Martz is offline
 
Join Date: Oct 2001
Location: UK
Posts: 156
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Very nice and simple hack, appreciated
Reply With Quote
  #25  
Old 06-09-2001, 12:27 PM
Zorg
Guest
 
Posts: n/a
Default

That's a great hack, thanks alot

Any change of putting this into the "stats" in the VB control panel to give more of a per day/week/month effect listing?
Reply With Quote
  #26  
Old 06-11-2001, 07:22 PM
Streicher Streicher is offline
 
Join Date: Oct 2001
Location: Reinbek, Germany
Posts: 62
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

If you want the views displayed without a "," then use this code instead:

PHP Code:
$boardviews=$DB_site->query_first("SELECT SUM(views) AS threadviews FROM thread");
$totalviews=$boardviews['threadviews']; 
Reply With Quote
  #27  
Old 06-13-2001, 12:33 PM
webhost's Avatar
webhost webhost is offline
 
Join Date: Oct 2001
Location: St. Louis
Posts: 577
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks for the hack. Works Great

Joey
Reply With Quote
  #28  
Old 06-15-2001, 10:51 AM
ThomasP
Guest
 
Posts: n/a
Default

Quote:
Originally posted by Streicher
[B]If you want the views displayed without a "," then use this code instead (...)
Thanks - that was what I was looking for!

Gr??e nach Reinbek,
-Tom
Reply With Quote
  #29  
Old 06-16-2001, 09:29 AM
king98 king98 is offline
 
Join Date: Nov 2001
Location: alkhot
Posts: 17
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

i tried to post that code in the index.php file but it did not work .... can some body add this hack to that file and put it for downloading plz.
Reply With Quote
  #30  
Old 07-12-2001, 01:34 PM
webhost's Avatar
webhost webhost is offline
 
Join Date: Oct 2001
Location: St. Louis
Posts: 577
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hack works great.
How would someone also add under a members profile the total amount of page views that member has?
Reply With Quote
  #31  
Old 07-13-2001, 04:59 PM
Lukman
Guest
 
Posts: n/a
Default

I think im the only one who cant get this hack to work

I did two things as instructed - add that piece of code in my /forums/index.php file exactly the same way JJR512 did it

and I added <b>$totalviews</b> total thread views - in the forum home template

When I refreshed - all i saw was total thread view with no number next to it


Whats wrong?


Thanks in advance - im using v2.0.1 btw
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 06:19 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04418 seconds
  • Memory Usage 2,299KB
  • Queries Executed 25 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)bbcode_code
  • (2)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (8)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete