Author |
Topic |
suhern
Junior Member
186 Posts |
Posted - 30 November 2001 : 06:57:34
|
quote:
hmmm, I replied and viewed a topic but the views popup does not show me as viewing the topic. I made all the latest and greatest updates that was applied to 3.3
____________ dayve http://www.nineinchnailz.com/forum
Apparenttly, the code still does not solve the problem for certain id having 1 in it. I am having the same problem.
|
|
|
dayve
Forum Moderator
USA
5820 Posts |
Posted - 30 November 2001 : 11:07:19
|
quote:
quote:
hmmm, I replied and viewed a topic but the views popup does not show me as viewing the topic. I made all the latest and greatest updates that was applied to 3.3
____________ dayve http://www.nineinchnailz.com/forum
Apparenttly, the code still does not solve the problem for certain id having 1 in it. I am having the same problem.
my id number is 2 though. but I feel strongly that there is a bug, I haven't had time to look through the code yet. Stim? got any ideas?
____________ dayve http://www.nineinchnailz.com/forum |
|
|
GauravBhabu
Advanced Member
4288 Posts |
Posted - 30 November 2001 : 11:34:11
|
I did not see any such problem, but may be I missed something. I will check it out.
GauravBhabu There is only one miracle...That is LIFE! | It is difficult to IMPROVE on Perfection, There is no harm in Keep Trying. |
|
|
GauravBhabu
Advanced Member
4288 Posts |
Posted - 30 November 2001 : 11:44:53
|
This is what I have in topic.asp. Change strTablePrefix to strActivePrefix if you are using version 3.3.
'============= TOPIC AND REPLY VIEW Dim LenWhoViewed,Topic_WhoViewed,DoUpdate,TmpWhoViewed,UpdateTview,IDToDiscard if MemberID = 0 or IsNull(MemberID) or MemberID < 0 then 'dont update anything else DoUpdate = True strsql = "SELECT T.T_WHOVIEWED FROM " & strTablePrefix & "TOPICS T WHERE " strsql = strsql & "T.TOPIC_ID=" & Topic_ID set tviewRS = Server.CreateObject("ADODB.RecordSet") tviewRS.open strsql, my_conn, 3 Topic_WhoViewed = tviewRS("T_WHOVIEWED") tviewRS.close set tviewRS = nothing if IsNull(Topic_WhoViewed) or Topic_WhoViewed = "" or Topic_WhoViewed = "0" or Len(Trim(Topic_WhoViewed)) = 0 then UpdateTview = MemberID else LenWhoViewed = len(Topic_WhoViewed) arrWhoViewed = split(Topic_WhoViewed,",",-1,1) 'Check if the memberID already exists if IsArray(arrWhoViewed) then If Instr(1,Topic_WhoViewed, "," & MemberID & ",",1) > 0 or _ Trim(arrWhoViewed(lbound(arrWhoViewed))) = Trim(MemberID) or _ Trim(arrWhoViewed(ubound(arrWhoViewed))) = Trim(MemberID) then DoUpDate = false end if else if Trim(Topic_WhoViewed) = Trim(MemberID) then DoUpdate = false end if 'Check if the Field is Full. If Full then discard the Oldest ID if DoUpdate = True then if (LenWhoViewed + len(MemberID) = 255) or _ (LenWhoViewed + len(MemberID) > 255) then 'Max Limit IDToDiscard = left(Topic_WhoViewed,(instr(len(MemberID),Topic_WhoViewed,",",1))) if IDToDiscard <> MemberID & "," then TmpWhoViewed = Replace (Topic_WhoViewed,IDToDiscard,"",1,1,1) Topic_WhoViewed = TmpWhoViewed DoUpdate = True else DoUpdate = false end if end if end if if DoUpDate = True then UpdateTview = Topic_WhoViewed & "," & MemberID end if end if 'Update the Database if DOUpdate = true then strsql = "UPDATE " & strTablePrefix & "TOPICS " strsql = strsql & "SET " & strTablePrefix & "TOPICS.T_WHOVIEWED = '" & UpdateTview & "' WHERE " strsql = strsql & strTablePrefix & "TOPICS.TOPIC_ID = " & Topic_ID my_conn.execute(strsql) end if LenWhoViewed = "" end if '============= END TOPIC AND REPLY VIEW
GauravBhabu There is only one miracle...That is LIFE! | It is difficult to IMPROVE on Perfection, There is no harm in Keep Trying.
Edited by - GauravBhabu on 30 November 2001 12:08:24 |
|
|
dayve
Forum Moderator
USA
5820 Posts |
Posted - 30 November 2001 : 22:19:27
|
G, I made those changes and there is definately a problem, but I have not been able to pinpoint it yet.
____________ dayve http://www.nineinchnailz.com/forum |
|
|
GauravBhabu
Advanced Member
4288 Posts |
Posted - 01 December 2001 : 00:35:06
|
Can you tell me which ID is not being added or updated.
GauravBhabu There is only one miracle...That is LIFE! | It is difficult to IMPROVE on Perfection, There is no harm in Keep Trying. |
|
|
dayve
Forum Moderator
USA
5820 Posts |
Posted - 01 December 2001 : 12:00:23
|
quote:
Can you tell me which ID is not being added or updated.
GauravBhabu There is only one miracle...That is LIFE! | It is difficult to IMPROVE on Perfection, There is no harm in Keep Trying.
quote: my id number is 2 though. but I feel strongly that there is a bug, I haven't had time to look through the code yet. Stim? got any ideas?
I posted this earlier in the thread because someone else mentioned it didn't work for them with an id having the number 1
____________ dayve http://www.nineinchnailz.com/forum |
|
|
GauravBhabu
Advanced Member
4288 Posts |
Posted - 01 December 2001 : 12:11:59
|
I have experienced no problem with ID = 1 or any ID containing 1.
GauravBhabu There is only one miracle...That is LIFE! | It is difficult to IMPROVE on Perfection, There is no harm in Keep Trying. |
|
|
dayve
Forum Moderator
USA
5820 Posts |
Posted - 01 December 2001 : 13:27:52
|
quote:
I have experienced no problem with ID = 1 or any ID containing 1.
GauravBhabu There is only one miracle...That is LIFE! | It is difficult to IMPROVE on Perfection, There is no harm in Keep Trying.
it is intermittent but it does happen.. please trust me on this one. and my id is 2, another person reporting the problem at a different forum (see threads above) reported having a 1 in the id.
____________ dayve http://www.nineinchnailz.com/forum
Edited by - dayve on 01 December 2001 13:29:21 |
|
|
GauravBhabu
Advanced Member
4288 Posts |
Posted - 01 December 2001 : 13:35:29
|
Hmmm! The code compares the memberId with existing ID's as below:
(More than one ID in the column)
Logic Compares the memberId with the ID:
1. at the begining
Trim(arrWhoViewed(lbound(arrWhoViewed))) = Trim(MemberID)
2. at the end Trim(arrWhoViewed(ubound(arrWhoViewed))) = Trim(MemberID)
3. between fisrtId and last ID
Instr(1,Topic_WhoViewed, "," & Trim(MemberID) & ",",1) > 0
If there is only one ID in the Column
Logic Compares the memberId with the value in the Column: if Trim(Topic_WhoViewed) = Trim(MemberID) then DoUpdate = false
Modify the statement in red as shown: or Try doing a cint(Trim(Topic_WhoViewed))= cint(Trim(MemberID))
GauravBhabu There is only one miracle...That is LIFE! | It is difficult to IMPROVE on Perfection, There is no harm in Keep Trying. |
|
|
Raichelle
Junior Member
370 Posts |
Posted - 17 January 2002 : 09:55:12
|
Hi dayve I haven't had time to implement this mod on my forum since my site been down but I did now
but im having a problem. When I view a topic when am not logged in I keep getting this error
Microsoft VBScript runtime error '800a000d' Type mismatch: '[string: ""]'
/forum/topic2.asp, line 1167
Dim LenWhoViewed,Topic_WhoViewed,DoUpdate,TmpWhoViewed,UpdateTview,IDToDiscard if MemberID = 0 or IsNull(MemberID) or MemberID < 0 then 'dont update anything
but it w orks fine if am logged in i don't know why any help?
|
|
|
Topic |
|