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
  #12  
Old 05-09-2001, 03:26 AM
Sarge
Guest
 
Posts: n/a
Default

easy dude

Just insert

$totalviews since 1-5-01 into where you want it on your forum home template
Reply With Quote
  #13  
Old 05-09-2001, 03:27 AM
JJR512's Avatar
JJR512 JJR512 is offline
 
Join Date: Oct 2001
Location: Glen Burnie, MD, USA
Posts: 710
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Well, it's very simple. Where ever you stick the $totalviews, just put the text by that. For example, if you put it in your forumhome template, so it's below your total threads and total posts, as I did, like this:
Code:
<b>$totalviews</b> total thread views
You could just change it to this:
Code:
<b>$totalviews</b> total thread views since May 7, 2001
(Or use whatever date it was when you converted from UBB to vB.)
Reply With Quote
  #14  
Old 05-09-2001, 04:31 AM
TimberLand
Guest
 
Posts: n/a
Default

Where do you paste the code at, in the index.php? Anywhere special.

Can someone give an example of placement.

Thanks
Dan
Reply With Quote
  #15  
Old 05-09-2001, 04:35 AM
Sarge
Guest
 
Posts: n/a
Default

in the forum home template

Put it under launch buddy list or wherever
Reply With Quote
  #16  
Old 05-09-2001, 04:42 AM
JJR512's Avatar
JJR512 JJR512 is offline
 
Join Date: Oct 2001
Location: Glen Burnie, MD, USA
Posts: 710
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by JJR512
Well, it's very simple. Where ever you stick the $totalviews, just put the text by that. For example, if you put it in your forumhome template, so it's below your total threads and total posts, as I did, like this:
Code:
<b>$totalviews</b> total thread views
You could just change it to this:
Code:
<b>$totalviews</b> total thread views since May 7, 2001
(Or use whatever date it was when you converted from UBB to vB.)
Reply With Quote
  #17  
Old 05-09-2001, 05:01 AM
TimberLand
Guest
 
Posts: n/a
Default

Thanks very much,

What about the index.php file I need to edit. Where should I put the code it's says in the above post. It say cut and paste this code into the index.php file.
Reply With Quote
  #18  
Old 05-09-2001, 05:03 AM
Sarge
Guest
 
Posts: n/a
Default

just find a place... like under total posts in index.php
Reply With Quote
  #19  
Old 05-09-2001, 11:46 AM
TimberLand
Guest
 
Posts: n/a
Default

I can't find total posts in the index.php file. Can someone cut out a small part of this file were they have this code placed in the index.php file?

// Total Thread Views

$boardviews = $DB_site->query_first("
SELECT SUM(views) AS threadviews FROM thread");
$totalviews = number_format($boardviews[threadviews]);
Reply With Quote
  #20  
Old 05-09-2001, 04:40 PM
JJR512's Avatar
JJR512 JJR512 is offline
 
Join Date: Oct 2001
Location: Glen Burnie, MD, USA
Posts: 710
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

In index.php, look for this:
Code:
// get newest member
Place the code for this hack above this line.

This is how mine looks:
PHP Code:
// get total posts
$countposts=$DB_site->query_first('SELECT COUNT(*) AS posts FROM post');
$totalposts=$countposts['posts'];
if (
$totalposts=='') {
  
$totalposts=0;
}
$countthreads=$DB_site->query_first('SELECT COUNT(*) AS threads FROM thread');
$totalthreads=$countthreads['threads'];
if (
$totalthreads=='') {
  
$totalthreads=0;
}

// Total Thread Views
$boardviews $DB_site->query_first("
    SELECT SUM(views) AS threadviews FROM thread"
);
$totalviews number_format($boardviews[threadviews]);

// get newest member
$getnewestusers=$DB_site->query_first("SELECT userid,username FROM user WHERE userid=$numbersmembers[max]");
$newusername=$getnewestusers['username'];
$newuserid=$getnewestusers['userid']; 
Reply With Quote
  #21  
Old 05-10-2001, 04:09 AM
TimberLand
Guest
 
Posts: n/a
Default

Worked like a charm. I was getting messed up because I didn't realize at first there are two index files.
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 09:38 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.04781 seconds
  • Memory Usage 2,301KB
  • 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
  • (5)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
  • (3)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
  • (4)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