Author |
Topic  |
Wildland
New Member

USA
74 Posts |
Posted - 07 January 2009 : 12:17:15
|
Is there a way to count only unique reads so that if the same person clicks on the same topic 10 times it only counts it as 1 read for that topic?
Thanks in advance< |
|
HuwR
Forum Admin
    
United Kingdom
20595 Posts |
Posted - 07 January 2009 : 12:21:35
|
no.< |
 |
|
Wildland
New Member

USA
74 Posts |
Posted - 07 January 2009 : 12:36:37
|
Oh well I was hoping it would be as simple as changing a line of code to assign a vale to the cookie, but if it can't be done, it can't be done, thanks for your quick answer.< |
 |
|
SiSL
Average Member
  
Turkey
671 Posts |
|
AnonJr
Moderator
    
United States
5768 Posts |
Posted - 07 January 2009 : 13:10:28
|
Most things are possible... but just because you can do something doesn't mean you should.
While it is technically possible, you're going to add a fair amount of processing overhead to the forum.< |
 |
|
Wildland
New Member

USA
74 Posts |
Posted - 07 January 2009 : 13:20:48
|
I guess that makes since because the server would have to keep a list of everyone who has looked at each topic and check it before making a count.< |
 |
|
Shaggy
Support Moderator
    
Ireland
6780 Posts |
Posted - 07 January 2009 : 13:28:44
|
A quick, slimline way to do it, while not exactly what you're looking for is to create a session variable that holds the ID of the last topic viewed and then check that against the current topic ID before updating the view count. This prevents people from hammering away on the refresh button and bumping up the view count. Also, returning to a topic after posting a reply will not count as an additional view.
< |
Search is your friend “I was having a mildly paranoid day, mostly due to the fact that the mad priest lady from over the river had taken to nailing weasels to my front door again.” |
 |
|
Wildland
New Member

USA
74 Posts |
Posted - 07 January 2009 : 13:34:51
|
That would defiantly be useful and very much along the line of what I am interested in. I just got no idea how to do it.< |
 |
|
Carefree
Advanced Member
    
Philippines
4217 Posts |
Posted - 07 January 2009 : 18:19:51
|
Keeping a table of topics viewed (by topic) with records of every member who viewed each? Can you imagine how fast the database would grow ... and how much the forum would slow down with all those additional calls to verify/write?< |
 |
|
SiSL
Average Member
  
Turkey
671 Posts |
|
Shaggy
Support Moderator
    
Ireland
6780 Posts |
Posted - 08 January 2009 : 04:28:18
|
quote: Originally posted by Wildland That would defiantly be useful and very much along the line of what I am interested in. I just got no idea how to do it.
Find the following beginning on line 477 of topic.asp: '## Forum_SQL
strSql = "UPDATE " & strActivePrefix & "TOPICS "
strSql = strSql & " SET T_VIEW_COUNT = (T_VIEW_COUNT + 1) "
strSql = strSql & " WHERE (TOPIC_ID = " & Topic_ID & ")"
my_conn.Execute (strSql),,adCmdText + adExecuteNoRecords And replace it with the following: if session("lasttopic") <> Topic_ID then
'## Forum_SQL
strSql = "UPDATE " & strActivePrefix & "TOPICS "
strSql = strSql & " SET T_VIEW_COUNT = (T_VIEW_COUNT + 1) "
strSql = strSql & " WHERE (TOPIC_ID = " & Topic_ID & ")"
my_conn.Execute (strSql),,adCmdText + adExecuteNoRecords
session("lasttopic") = Topic_ID
end if If you wanted, you could add an additional check to that if statement so that views by admins (and moderators) are never counted.
< |
Search is your friend “I was having a mildly paranoid day, mostly due to the fact that the mad priest lady from over the river had taken to nailing weasels to my front door again.” |
 |
|
Wildland
New Member

USA
74 Posts |
Posted - 08 January 2009 : 14:10:41
|
I will try this as soon as I get home tonight.
Just a thought, doesn't the forum have a way to keep track of things you have read already? whenever you log on it tells you which posts are new to you, or dose this work in a completely different way?< |
 |
|
Wildland
New Member

USA
74 Posts |
Posted - 08 January 2009 : 18:55:46
|
count still goes up every time and when you hit refresh.< |
 |
|
Carefree
Advanced Member
    
Philippines
4217 Posts |
Posted - 08 January 2009 : 20:38:50
|
That's not possible with the way Shaggy changed it. Post a link to your "topic.asp" in .txt format and we'll have a look.< |
 |
|
Wildland
New Member

USA
74 Posts |
|
Carefree
Advanced Member
    
Philippines
4217 Posts |
Posted - 08 January 2009 : 23:02:55
|
You modified the wrong bit of code. In your file, you should have modified lines 639-643 (as it is now).< |
 |
|
Topic  |
|