Icy Phoenix

     
 


Post new topic  Reply to topic 
Page 1 of 1
 
 
Reply with quote Download Post 
Post 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?
 



 
Gianni PBSend private messageVisit poster's website  
Back to topPage bottom
Icy Phoenix is an open source project, you can show your appreciation and support future development by donating to the project.

Support us
 
Reply with quote Download Post 
Post 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 
InformproSend private message  
Back to topPage bottom
Reply with quote Download Post 
Post 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
 



 
Gianni PBSend private messageVisit poster's website  
Back to topPage bottom
Post new topic  Reply to topic  Page 1 of 1
 


Display posts from previous:    

HideWas this topic useful?

Link this topic
URL
BBCode
HTML




 
Permissions List
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


  

 

  cron