vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   Views Don't Count If Done By Guest Or Thread Starter Unless Replying (https://vborg.vbsupport.ru/showthread.php?t=49867)

007 03-08-2003 10:00 PM

Views Don't Count If Done By Guest Or Thread Starter Unless Replying
 
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

Boofo 03-09-2003 11:30 PM

Will check it out. Sounds good. ;)

007 03-09-2003 11:51 PM

I found a bug in this. It works for a while and then stops. For no reason that I could see....

I posted a thread here if anyone knows what I should do. :ermm:

https://vborg.vbsupport.ru/showthrea...threadid=49874

Dean C 03-10-2003 04:11 PM

Interesting concept :)

- miSt

007 05-02-2003 02:03 PM

Well this is now working fine now. I found the problem.

Boofo 05-02-2003 02:44 PM

Quote:

Today at 10:03 AM 006 said this in Post #5
Well this is now working fine now. I found the problem.
Did you update the first post with the fix? If so, what is the update for those who already had it installed? ;)

007 05-02-2003 02:53 PM

Well, if someone DID have it installed, I just removed all the elseif lines where it referred to $lastposter['userid'] in the THIRD step, since that caused problems.

I don't think anyone installed it though since it didn't work.

And yes, I have updated the first post. :)

Boofo 05-02-2003 03:11 PM

Well, I had it installed but had to uninstall it when you reported the problem with it. I have re-installed it and it seems to be working fine so far. Good job! ;)

Edit: I was just looking at the file and the $lastposter['userid'] is still in there. Is this how it is supposed to be?

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'");}
else if (
$lastposter['userid'] != $bbuserinfo['userid']) {
  
$DB_site->query("UPDATE thread SET views=views WHERE threadid='$threadid'");}
else if (!
$bbuserinfo['userid']) {
  
$DB_site->query("UPDATE thread SET views=views WHERE threadid='$threadid'");}
else if (
$thread['postuserid'] <> $bbuserinfo['userid']) {
  
$DB_site->query("UPDATE thread SET views=views+1 WHERE threadid='$threadid'");}
//End Views Don't Count based on Variables by 006 


007 05-02-2003 03:45 PM

Found the problem. I renamed it. Try clearing your history and then opening it, or opening it by "SHIFT+Clicking."

The line to remove in the first part of step 3 looks like this:

PHP Code:

else if ($lastposter['userid'] != $bbuserinfo['userid']) {
  
$DB_site->query("UPDATE thread SET views=views WHERE threadid='$threadid'");} 

There is a similar line in the second part of step 3.

I also changed the last line. Just try opening the install file again and see if it is different.

There are NO changes to newreply.php

Hope that works. :)

Boofo 05-02-2003 04:14 PM

Ok, got it now. I will make the changes and let you know how it goes. Thank you, sir. ;)


All times are GMT. The time now is 06:09 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.01187 seconds
  • Memory Usage 1,749KB
  • 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
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)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