Author |
Topic  |
|
Sparty
Starting Member
USA
45 Posts |
Posted - 12 August 2000 : 03:47:28
|
The users of my forum wanted to know whose reading posts so that if a normal user gained access to the private forums by someone giving up a password they would know. So here is what I did, if anyone is interests
First you will need to add a Column in the Forum Topics table called T_LAST_READBY and let it allow a Zero Length.
Then, in topics.asp add the following line of code into the update statement around line 485, it should go inbetween the Update and Where lines.
strSql = strSql & ", " & strTablePrefix & "TOPICS.T_LAST_READBY = ('" & Request.Cookies("User")("Name") & "')"
then,
in forum.asp change the line 218 to the following
<td bgcolor="<% =strForumCellColor %>" valign="top" align="center"><font face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>" color="<% =strForumFontColor %>"><% =rs("T_VIEW_COUNT") %> <%if rs("T_LAST_READBY") > "" then%> <br><font size=-2 color=<% =strForumFontColor %>>by:<font size=-2 color=white><% =rs("T_LAST_READBY")%></font> <%end if%> </td>
this will now tell you who read the post last.
Sparty I have tested this and it works well, sorry I didn't do an Alter statement...but I'm tired and want to goto bed.
Sparty -----------------------
She turned me into a Newt..
A Newt?
I got betta!
Edited by - Sparty on 12 August 2000 04:11:27 |
|
Kal Corp
Average Member
  
USA
878 Posts |
|
davemaxwell
Access 2000 Support Moderator
    
USA
3020 Posts |
Posted - 18 August 2000 : 08:20:15
|
I'm not sure this is the best approach for the users requirement, Sparty. All this code does for you is allow someone to see the last person reading a post. Someone would need to sit there and watch this field constantly to find out who's been reading a post (and what happens if 2 people happen to read a post at the same time?)
I think an approach which would better get what your users want is to create a new table (like FORUM_READ). On it would need to be 2 fields, TOPIC_ID and MEMBER_ID (you could add a date/time field if you'd want). In topic.asp, where T_VIEW_COUNT is added to, you'd want to add a check for this member_id on the new table. If it is not on the new table, then you'd want to add it. You could then just add an icon to this topic which would take you to a page which lists all users who have read a topic.
I think this might give your users what they want a little more....
Dave Maxwell -------------- When's the next meeting of Snitzaholics Anonymous<img src=icon_smile_question.gif border=0 align=middle> |
 |
|
Sparty
Starting Member
USA
45 Posts |
Posted - 18 August 2000 : 12:04:41
|
There are only 11 people who are authorized to use the forum in question. So these 11 people all know who can and can't be in that forum. So if any one of them comes in a sees a name that isn't supposed to be there reading posts, they can take care of it. So it did fit the needs of the user in this instance. I just thought I'd share it with you guys. I like Kal's Idea were it keeps track and allows a listing of users who have read it.
Sparty -----------------------
She turned me into a Newt..
A Newt?
I got betta!
|
 |
|
|
Topic  |
|