| Author |  Topic  | 
              
                | NikkolForum Moderator
 
      
 
                USA6907 Posts
 | 
                    
                      |  Posted - 08 April 2003 :  17:31:26   
 |  
                      | As a result of a request from this topic, I've created the "Who Read Topic" MOD. 
 First off, let me say, it makes me very nervous to release a mod. I've tested it, but not on a busy forum, so I can't say how it will perform.  Also, I've done a lot of cutting and pasting from existing code, so hopefully I'm not misusing certain variables and such.  I also have no idea what this will do to the size of the database since a record is created for every member who reads a topic. So, maximum records in the new table = number of topics x number of members.
 
 Phew, now that I have that off my chest
  here's what the mod does.  It allows admins and moderators to view a list of members who have read a particular topic by clicking the binoculars icon.  Also, admins and individual members can view a listing of all non-archived topics that the member has read available through the member's profile. 
 Click here to grab the mod.  Please let me know if you encounter any problems!
 
 <edit>08 April 2003 18:29:04 - Zip files corrected as per Hamlin's post below.</edit>
 
 <edit>09 April 2003 13:59:28 - Zip files updated as per post with same time stamp below.</edit>
 
 <edit>14 April 2003 :  21:24:59 - Zip files updated as per post with same time stamp below.</edit>
 
 <edit>19 July 2003 :  19:21:06 - Zip files updated as per post with same time stamp below.</edit>
 
 
 |  
                      | Nikkol ~ Help Us Help You | ReadMe | 3.4.03 fixes | security fixes ~
 |  
                      | Edited by - Nikkol on 30 November 2003  17:40:03
 |  | 
              
                | Ez4arabJunior Member
 
   
 
                479 Posts |  | 
              
                | HamlinAdvanced Member
 
      
 
                United Kingdom2386 Posts
 | 
                    
                      |  Posted - 08 April 2003 :  18:02:25   
 |  
                      | Just a little change I had to make Nikkol, I'm using a mySQL database, and sql statement shown below was giveing me problems... 
 quote:
 UPDATE FORUM_READ_TOPICS SET LAST_READ_DATE = '20030408225104' WHERE MEMBER_ID = 1AND TOPIC_ID = 1
 
 
 I added a space after the 1, which means editing this piece of code in topic.asp...
 
 '===================================WHO READ MOD============================================
	'check for existance of record in table for this topic and member
	strSql = "SELECT COUNT(*) FROM " & strMemberTablePrefix & "READ_TOPICS " &_
		"WHERE MEMBER_ID = " & MemberID & " AND TOPIC_ID = " & Topic_ID
	set rsChkLR = my_Conn.execute(strSql)
	intChkLR = rsChkLR(0)
	rsChkLR.close
	set rsChkLR = Nothing
	if intChkLR > 0 then	'update record
		strSql = "UPDATE " & strMemberTablePrefix & "READ_TOPICS " &_
			"SET LAST_READ_DATE = '" & DateToStr(strForumTimeAdjust) & "' " &_
			"WHERE MEMBER_ID = " & MemberID &_
			"<space>AND TOPIC_ID = " & Topic_ID
	else	'insert record
		strSql = "INSERT INTO " & strMemberTablePrefix & "READ_TOPICS " &_
			"(MEMBER_ID, TOPIC_ID, LAST_READ_DATE) VALUES " &_
			"(" & MemberID & ", " & Topic_ID & ", '" & DateToStr(strForumTimeAdjust) & "')"
	end if                  
	my_Conn.execute(strSql)
'===========================================================================================
 EDIT - Very nice little mod though
   |  
                      | Edited by - Hamlin on 08 April 2003  18:04:14
 |  
                      |  |  | 
              
                | NikkolForum Moderator
 
      
 
                USA6907 Posts
 |  | 
              
                | NikkolForum Moderator
 
      
 
                USA6907 Posts
 | 
                    
                      |  Posted - 08 April 2003 :  18:26:03   
 |  
                      | Ez4arab, from the quick look I had at the other mod, there are some differences.  Namely, only admins and moderators can view the list of people who have read (to protect anonymity of members) and also members can pull up a list of the topics they have read (which I thought would be good since sometimes you want to follow a topic, but don't want to participate). |  
                      | Nikkol ~ Help Us Help You | ReadMe | 3.4.03 fixes | security fixes ~
 |  
                      |  |  | 
              
                | NikkolForum Moderator
 
      
 
                USA6907 Posts
 |  | 
              
                | spyordie007Junior Member
 
   
 
                USA408 Posts
 | 
                    
                      |  Posted - 09 April 2003 :  14:06:30     
 |  
                      | Nikkol- 
 Do you have a demo of your mod available anywhere for us to look at?
 
 -Spy
 |  
                      | 
 Power - The only narcotic controlled by the SEC, not the FDA.
 Prosperity without pollution!  The American Hydrogen Association - http://www.ahanw.org
 Questions about Hydrogen? Post them on our forum - http://www.ahanw.org/forum
 |  
                      |  |  | 
              
                | NikkolForum Moderator
 
      
 
                USA6907 Posts
 |  | 
              
                | spyordie007Junior Member
 
   
 
                USA408 Posts
 | 
                    
                      |  Posted - 09 April 2003 :  14:45:45     
 |  
                      | quote:Originally posted by Nikkol
 
 Sure.  Go to www.nikkol.net/forum
 
 To test as a regular user, logon as "Test Snitz User" (without the quotes) with the password snitzuser.  To test as a moderator, logon as "Test Snitz Mod" with the password snitzmod.
 
 
 I'm getting invalid username/password for both of these logins.
 
 -Spy
 |  
                      | 
 Power - The only narcotic controlled by the SEC, not the FDA.
 Prosperity without pollution!  The American Hydrogen Association - http://www.ahanw.org
 Questions about Hydrogen? Post them on our forum - http://www.ahanw.org/forum
 |  
                      |  |  | 
              
                | NikkolForum Moderator
 
      
 
                USA6907 Posts
 |  | 
              
                | spyordie007Junior Member
 
   
 
                USA408 Posts
 | 
                    
                      |  Posted - 09 April 2003 :  15:07:46     
 |  
                      | For the more visual people such as myself: 
 
  
 Nikkol-
 
 I noticed two columns of users who have viewed it, I'm assuming it just wraps between those two columns as more users view it?
 
 Also I was curious, is it possible to have guests listed to? (maybe not by default though since it could potentially kick a very large page out).
 
 Nice job, I think I may use this one.
 
 -Spy
 
 PS - If you want to keep that screenshot move it to another server, I'm only going to leave it up for a few days so I'm not killing bandwidth indefinetly.
 |  
                      | 
 Power - The only narcotic controlled by the SEC, not the FDA.
 Prosperity without pollution!  The American Hydrogen Association - http://www.ahanw.org
 Questions about Hydrogen? Post them on our forum - http://www.ahanw.org/forum
 |  
                      |  |  | 
              
                | NikkolForum Moderator
 
      
 
                USA6907 Posts
 | 
                    
                      |  Posted - 09 April 2003 :  15:28:33   
 |  
                      | Thanks for the image.  I might include it in the zip instead of here.  Users are added to the columns as it grows.  The number of columns is also customizable by hard-coding into who_read.asp.  I suppose it could be modified to include guests, but it would overwrite the guest entry everytime a different person viewed it, so I'm not sure it would be that handy.  Did you check out the profile page as well?  I'll show a couple of screen shots of that in a minute. 
 
  
 
  |  
                      | Nikkol ~ Help Us Help You | ReadMe | 3.4.03 fixes | security fixes ~
 |  
                      | Edited by - Nikkol on 09 April 2003  15:46:22
 |  
                      |  |  | 
              
                | ajhvdbJunior Member
 
   
 
                Netherlands392 Posts
 | 
                    
                      |  Posted - 14 April 2003 :  15:45:54   
 |  
                      | Thanks a lot, was thinking about making it myself, no time, how to do it, etc, and there it is, created by someone else :) |  
                      |  |  | 
              
                | spyordie007Junior Member
 
   
 
                USA408 Posts
 | 
                    
                      |  Posted - 14 April 2003 :  20:34:06     
 |  
                      | Alright I took the time today to try and impliment this on my forum and now I get this error when trying to view any topic.  This is running on a live instance of the forum DB but a test instance of the asp code using MySQL for the DB. 
 Microsoft VBScript compilation (0x800A03EA)
 Syntax error
 /forumtest/topic.asp, line 412, column 38
 
 Link to forum:
 http://ahanw.dhs.org/forumtest
 Link to topic.asp:
 http://ahanw.dhs.org/forumtest/topic.asp.txt
 
 -Spy
 |  
                      | 
 Power - The only narcotic controlled by the SEC, not the FDA.
 Prosperity without pollution!  The American Hydrogen Association - http://www.ahanw.org
 Questions about Hydrogen? Post them on our forum - http://www.ahanw.org/forum
 |  
                      |  |  | 
              
                | spyordie007Junior Member
 
   
 
                USA408 Posts
 | 
                    
                      |  Posted - 14 April 2003 :  20:35:55     
 |  
                      | just checked, that is the line within your code that reads: 
 		strSql = "UPDATE " & strTablePrefix & & "LAST_READ " &_ -Spy
 |  
                      | 
 Power - The only narcotic controlled by the SEC, not the FDA.
 Prosperity without pollution!  The American Hydrogen Association - http://www.ahanw.org
 Questions about Hydrogen? Post them on our forum - http://www.ahanw.org/forum
 |  
                      |  |  | 
              
                | NikkolForum Moderator
 
      
 
                USA6907 Posts
 | 
                    
                      |  Posted - 14 April 2003 :  20:47:38   
 |  
                      | quote:Take out the ampersand I highlighted in red.Originally posted by spyordie007
 
 just checked, that is the line within your code that reads:
 
 		strSql = "UPDATE " & strTablePrefix & & "LAST_READ " &_ -Spy
 
 
 |  
                      | Nikkol ~ Help Us Help You | ReadMe | 3.4.03 fixes | security fixes ~
 |  
                      |  |  | 
              
                
                |  Topic  |  |