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
Views Don't Count If Done By Guest Or Thread Starter Unless Replying Details »»
Views Don't Count If Done By Guest Or Thread Starter Unless Replying
Version: 1.00, by 007 007 is offline
Developer Last Online: Apr 2020 Show Printable Version Email this Page

Version: 2.2.x Rating:
Released: 03-08-2003 Last Update: Never Installs: 15
 
No support by the author.

Views Don't Count If Done By Guest Or Thread Starter Unless Replying by 006

What this hack does:

This hack basically keeps your thread views down to only the legit views, and does not add a vew for each refresh unless you are viewing somebody elses thread and are not the last poster in the thread. When a guest views a thread this also does not add a view unless the guest is allowed to reply and does so. In that case one view will be added. This hack makes it easier to tell if somebody has viewed your threads, because after posting, even if you go look at your thread to make sure it "looks right," the view count will still be 0. Your own views will not count.

Benefits of this hack:

The main reason I made this hack was because of the Lesane "Store Hack." If you use the store hack, then you know that points can be awarded to people after so many views of their thread. Well, this hack creates the following variables when calculating the views for each thread:
  • Views by the thread starter don't count unless they are replying. This way people cannot view their own thread over and over to get points. If the thread starter replies, one view will be added. This was there isn't a possibility of more replies than views.
  • Views by guests don't count unless guest posting is enabled, then the views will only count when guests reply. This way thread starters cannot simply log in as guests to get their thread view numbers up. Guests can still view the threads of course (unless you have this disabled with the "Restrict Guest Viewing Threads in a Forum" hack by PPN), but their views will not be added to the total thread views.
Views Don't Count If Done By Guest Or Thread Starter Unless Replying

by 006

INSTALLATION:

It shouldn't take any more than 5 minutes to install. (3 steps, 2 file edits)

It has been tested and works fine in 2.2.9

Any questions? Feel free to ask in this thread.

If you use this hack, please click "INSTALL." Thanks

Show Your Support

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

Comments
  #12  
Old 05-05-2003, 12:50 AM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

006, in your first step in the showthread.php, the last 2 lines are wrong (they give a db error):

Instead of:

PHP Code:
elseif {
  
$DB_site->query("UPDATE thread SET views=views+1 WHERE threadid='$threadid'");} 
it should be:

PHP Code:
else {
  
$DB_site->query("UPDATE thread SET views=views+1 WHERE threadid='$threadid'");} 
shouldn't it?
Reply With Quote
  #13  
Old 05-05-2003, 03:23 AM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

For some reason, this hack is no longer working for me. The thread views are not updating even when I am not the thread starter or last poster.
Reply With Quote
  #14  
Old 05-05-2003, 04:24 AM
007's Avatar
007 007 is offline
 
Join Date: Jan 2003
Location: United States
Posts: 872
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

That's weird. That's what happened to me before I "fixed" it... which I thought I did. I haven't been having any problems with it. I'll check it tomorrow.

The code you mentioned above is set to -1 so it doesn't give you a view after posting your own topic.

You wouldn't want to change it to +1 because it is already adding one. I think that part is no longer necessary since I took out the disableing view count adding if you are the last poster option since that gave me trouble.

I will look into this tomorrow and let you know.
Reply With Quote
  #15  
Old 05-05-2003, 06:26 AM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

After you look at the file in post 1, let me know what you find out. I'd really like to get this working. Thanks.
Reply With Quote
  #16  
Old 05-05-2003, 04:07 PM
007's Avatar
007 007 is offline
 
Join Date: Jan 2003
Location: United States
Posts: 872
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ok, try cdownloading the file again. If it does not say "Updated 05/05/03" after "by 006" then you will need to clear your history and try opening it again.

What I did was remove some unecessary code in the 2nd step. This should have an effect on whether or not it works, but it makes the code cleaner.

The reason for the -1 as you mentioned before, is so after someone makes a post, usualy in VB by the time they finish posting it, there are already 2 views on it. This simply makes it so first of all they don't get a view as the thread poster, and second of all, the first view will be subtracted. This leaves new posts with 0 views.
Reply With Quote
  #17  
Old 05-05-2003, 05:13 PM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The code you updated was for the newreply, right? That's not where I was having the problem yesterday.
Reply With Quote
  #18  
Old 05-05-2003, 05:43 PM
007's Avatar
007 007 is offline
 
Join Date: Jan 2003
Location: United States
Posts: 872
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I know but are you sure you have the most recent file??? It works totally fine with the most recent.

The problem you are having sounds a lot like what I was having before I fixed it... The new file says Updated 05/05/03 near the top of it. Let me know. :ermm:
Reply With Quote
  #19  
Old 05-19-2003, 02:59 PM
007's Avatar
007 007 is offline
 
Join Date: Jan 2003
Location: United States
Posts: 872
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Does this work for you now Boofo?
Reply With Quote
  #20  
Old 07-14-2003, 03:18 PM
Pikok Pikok is offline
 
Join Date: Jul 2002
Posts: 53
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

There's an error in your code in step 3..

In "root/showthread.php" you say to replace:
PHP Code:
if ($noshutdownfunc) {
  
$DB_site->query("UPDATE thread SET views=views+1 WHERE threadid='$threadid'"); 
With
PHP Code:
//Start Views Don't Count based on Variables by 006
if ($noshutdownfunc) {
if (
$thread['postuserid']==$bbuserinfo['userid']) {
  
$DB_site->query("UPDATE thread SET views=views WHERE threadid='$threadid'");}
elseif (!
$bbuserinfo['userid']) {
  
$DB_site->query("UPDATE thread SET views=views WHERE threadid='$threadid'");}
elseif {
  
$DB_site->query("UPDATE thread SET views=views+1 WHERE threadid='$threadid'");}
//End Views Don't Count based on Variables by 006 
However, it should be replaced with:
PHP Code:
//Start Views Don't Count based on Variables by 006
if ($noshutdownfunc) {
if (
$thread['postuserid']==$bbuserinfo['userid']) {
  
$DB_site->query("UPDATE thread SET views=views WHERE threadid='$threadid'");}
elseif (!
$bbuserinfo['userid']) {
  
$DB_site->query("UPDATE thread SET views=views WHERE threadid='$threadid'");}
else {
  
$DB_site->query("UPDATE thread SET views=views+1 WHERE threadid='$threadid'");}
//End Views Don't Count based on Variables by 006 
The last elseif statement should be an else statement. Can't have an if statement with no condition to be checked against.
Reply With Quote
  #21  
Old 08-08-2003, 08:14 AM
Azhrialilu's Avatar
Azhrialilu Azhrialilu is offline
 
Join Date: Aug 2003
Location: Stretton, Derbyshire
Posts: 445
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Pikok.. I could kiss you LOL I was just on the verge of going back to my last backup after the third time of installing, then I finally spotted your post!!!

It works beautifully now

*Clicks install*
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 12:04 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.09619 seconds
  • Memory Usage 2,322KB
  • 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_php
  • (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
  • (2)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
  • (11)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