The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
Total Thread Views Counting Wrong
Can anyone please help me figure out why the $totalviews always add 1 or 2 to the thread view count whenever someone views a thread? It should only be adding 1 for each view but it is adding between 2 and 3 for every thread view, for some reason.
Code:
$countthreads=$DB_site->query_first('SELECT count(*) AS threads, SUM(views) AS views FROM thread'); $totalthreads=number_format($countthreads['threads']); $totalviews=number_format($countthreads['views']); |
#2
|
||||
|
||||
i'd say looking into showthread.php would help you more
|
#3
|
||||
|
||||
Any idea where?
|
#4
|
||||
|
||||
search for the term views=views+1, it should appear just twice
if it appearse moretimes, theres the problem. if it's there just twice everything is ok. rembember whnever you refresh a page or go to anotherpage of the thread the views increses also |
#5
|
||||
|
||||
Well it only appears in there twice in this section of code:
Code:
if ($noshutdownfunc) { $DB_site->query("UPDATE thread SET views=views+1 WHERE threadid='$threadid'"); } else { $shutdownqueries[]="UPDATE LOW_PRIORITY thread SET views=views+1 WHERE threadid='$threadid'"; } if ($bbuserinfo[cookieuser]) { set_bbarraycookie('threadview', $threadid, time()); } |
#6
|
||||
|
||||
Here is the block of code (not sure if it the same as Boofo's):
PHP Code:
Satan |
#7
|
||||
|
||||
^^Hmmm...
It looks like I have 2 blocks of code doing almost the same thing Satan |
#8
|
||||
|
||||
Chris: well on block to much
delete the last if block and it's correct @Boofo: Well then everything works correct, maybe you are just a bit paranoid |
#9
|
||||
|
||||
Hmmm...
Both blocks have slightly different info though... The last block matches Boofo's, even down to the next lines being: PHP Code:
Satan |
#10
|
||||
|
||||
Really, I'm not paranoid (shhh...did you hear that? I told you they were after me!) Since I am one of one users that even visits my board, I viewed a thread and went straight back to the forumhome and the number really was 3 higher than when I went to view the thread. How can that be possible? I'm not doubting you, Stefan, I'm just baffled on this is all.
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|