Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Snitz Forums 2000 MOD-Group
 MOD Add-On Forum (W/Code)
 Topic View & Reply Voyeur MOD for v3.1
 New Topic  Topic Locked
 Printer Friendly
Previous Page
Author Previous Topic Topic Next Topic
Page: of 2

suhern
Junior Member

186 Posts

Posted - 30 November 2001 :  06:57:34  Show Profile
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.

Go to Top of Page

dayve
Forum Moderator

USA
5820 Posts

Posted - 30 November 2001 :  11:07:19  Show Profile  Visit dayve's Homepage
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
Go to Top of Page

GauravBhabu
Advanced Member

4288 Posts

Posted - 30 November 2001 :  11:34:11  Show Profile
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.
Go to Top of Page

GauravBhabu
Advanced Member

4288 Posts

Posted - 30 November 2001 :  11:44:53  Show Profile
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
Go to Top of Page

dayve
Forum Moderator

USA
5820 Posts

Posted - 30 November 2001 :  22:19:27  Show Profile  Visit dayve's Homepage
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
Go to Top of Page

GauravBhabu
Advanced Member

4288 Posts

Posted - 01 December 2001 :  00:35:06  Show Profile
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.
Go to Top of Page

dayve
Forum Moderator

USA
5820 Posts

Posted - 01 December 2001 :  12:00:23  Show Profile  Visit dayve's Homepage
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
Go to Top of Page

GauravBhabu
Advanced Member

4288 Posts

Posted - 01 December 2001 :  12:11:59  Show Profile
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.
Go to Top of Page

dayve
Forum Moderator

USA
5820 Posts

Posted - 01 December 2001 :  13:27:52  Show Profile  Visit dayve's Homepage
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
Go to Top of Page

GauravBhabu
Advanced Member

4288 Posts

Posted - 01 December 2001 :  13:35:29  Show Profile
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.
Go to Top of Page

Raichelle
Junior Member

370 Posts

Posted - 17 January 2002 :  09:55:12  Show Profile
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?

Go to Top of Page
Page: of 2 Previous Topic Topic Next Topic  
Previous Page
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.2 seconds. Powered By: Snitz Forums 2000 Version 3.4.07