No Update View Counter If Viewer Is Last Viewer »  Show posts from    to     

Icy Phoenix


Old Support Topics - No Update View Counter If Viewer Is Last Viewer



Gianni PB [ Sat 27 Feb, 2010 16:30 ]
Post subject: No Update View Counter If Viewer Is Last Viewer
In my viewtopic.php I have:

Code: [Hide] [Select]
// Don't update the topic view counter if viewer is poster
if (!($postrow[0]['user_id'] == $userdata['user_id']) && ($userdata['bot_id'] == false))


I'd like it doesn't update the topic view counter if viewer is last viewer (lots of page refresh).

how is it possible?


Informpro [ Sun 28 Feb, 2010 11:30 ]
Post subject: Re: No Update View Counter If Viewer Is Last Viewer
Code: [Hide]
  1. //!($a == $b) is equal to $a != $b :p - Count return the index but the array begin at 0, so decrease it.
  2. if ($postrow[count($postrow) - 1]['user_id'] != $userdata['user_id'] && $userdata['bot_id'] == false)
Try this :).


Gianni PB [ Sun 28 Feb, 2010 11:40 ]
Post subject: Re: No Update View Counter If Viewer Is Last Viewer
there is an error....it should be:

Code: [Hide] [Select]
$postrow[count($postrow) - 1]['user_id']


but I tried an echo and it gives the user_id of last poster




Powered by Icy Phoenix