No Update View Counter If Viewer Is Last Viewer


Subject: No Update View Counter If Viewer Is Last Viewer
In my viewtopic.php I have:

Code: [Download] [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?

Subject: Re: No Update View Counter If Viewer Is Last Viewer
Code: [Download] [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 :).

Last edited by Informpro on Sun 28 Feb, 2010 20:54; edited 1 time in total
Profile PM  
Subject: Re: No Update View Counter If Viewer Is Last Viewer
there is an error....it should be:

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


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


Page 1 of 1


  
You cannot post new topics
You cannot reply to topics
You cannot edit your posts
You cannot delete your posts
You cannot vote in polls
You cannot attach files
You can download files
You cannot post calendar events

   

This is a "Lo-Fi" version of our main content. To view the full version with more information, formatting and images, please click here.

Powered by Icy Phoenix based on phpBB
Generation Time: 0.0916s (PHP: 19% SQL: 81%)
SQL queries: 11 - Debug Off - GZIP Enabled