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 and Reply Voyeur MOD for 3.3
 New Topic  Topic Locked
 Printer Friendly
Previous Page | Next Page
Author Previous Topic Topic Next Topic
Page: of 4

GauravBhabu
Advanced Member

4288 Posts

Posted - 20 November 2001 :  00:39:29  Show Profile
One way is to do the split and do for next.

The other is find the position of FirstComma and last Comma and then

1. Compare the member ID enclosed in commas starting from the postion of firstcomma-1 Instr(firstcomma-1,Topic_whoviewedView,"'" & memberid & "'")
2. Compare the memberID with comma in the beginning starting from the position of lastcomma - Instr(lastcomma,Topic_whoviewedView,memberid)
3. Compare the memberID starting at position of firstcomma - InstrRev(


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 20 November 2001 00:48:07

Edited by - GauravBhabu on 20 November 2001 00:53:19
Go to Top of Page

GauravBhabu
Advanced Member

4288 Posts

Posted - 20 November 2001 :  01:11:01  Show Profile
Checkout this, Hopefully this will be Okay.


***Removed Bad Code to avoid Confusion


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 20 November 2001 06:35:27
Go to Top of Page

suhern
Junior Member

186 Posts

Posted - 20 November 2001 :  01:59:46  Show Profile
quote:

Checkout this, Hopefully this will be Okay.


if IsNull(Topic_WhoViewed) or Topic_WhoViewed = "" or Topic_WhoViewed = "0" or Len(Trim(Topic_WhoViewed)) = 0 then
UpdateTview = MemberID
DOUpDate = true
else
Firstcomma = Instr(1,Topic_WhoViewed, ",",1)
LastComma = InstrRev(Topic_WhoViewed,",",-1,1)
if FirstComma = 0 then FirstComma = 1
if LastComma = 0 then LastComma = FirstComma
If Instr(FirstComma,Topic_WhoViewed, "," & MemberID & ",",1) > 0 or _
Instr(LastComma,Topic_WhoViewed, MemberID,1) > 0 or _
InstrRev(Topic_WhoViewed, MemberID,FirstComma,1) > 0 or _
(len(Topic_WhoViewed) + len(MemberID) = 255) or _
(len(Topic_WhoViewed) + len(MemberID) > 255) then
DOUpDate = false
else
DOUpDate = true
UpdateTview = Topic_WhoViewed & "," & MemberID
end if
end if


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 20 November 2001 01:12:42



Sorry I tried and it is still not working

Go to Top of Page

GauravBhabu
Advanced Member

4288 Posts

Posted - 20 November 2001 :  02:23:23  Show Profile
Okay This will work



***Removed Bad Code to avoid Confusion



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 20 November 2001 06:35:59
Go to Top of Page

suhern
Junior Member

186 Posts

Posted - 20 November 2001 :  03:08:11  Show Profile
quote:

Okay This will work



if IsNull(Topic_WhoViewed) or Topic_WhoViewed = "" or Topic_WhoViewed = "0" or Len(Trim(Topic_WhoViewed)) = 0 then
UpdateTview = MemberID
DOUpDate = true
else
Firstcomma = Instr(1,Topic_WhoViewed, ",",1)
LastComma = InstrRev(Topic_WhoViewed,",",-1,1)
if FirstComma = 0 then FirstComma = 1
if LastComma = 0 then LastComma = FirstComma
If Instr(FirstComma,Topic_WhoViewed, "," & MemberID & ",",1) > 0 or _
Instr(LastComma,Topic_WhoViewed,"," & MemberID,1) > 0 or _
InstrRev(Topic_WhoViewed,MemberID & "," ,FirstComma,1) > 0 or _
(Instr(Topic_WhoViewed,Member_ID) > 0 And Instr(Topic_WhoViewed,",")= 0) or _
(len(Topic_WhoViewed) + len(MemberID) = 255) or _
(len(Topic_WhoViewed) + len(MemberID) > 255) then
DOUpDate = false
else
DOUpDate = true
UpdateTview = Topic_WhoViewed & "," & MemberID
end if
end if



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 20 November 2001 02:30:30

Edited by - GauravBhabu on 20 November 2001 02:37:38



I afraid it is still not working, my id = 1. there is one topic that refuses to capture me.

Go to Top of Page

GauravBhabu
Advanced Member

4288 Posts

Posted - 20 November 2001 :  03:13:34  Show Profile
I tested it works Okay. Make sure the following three statements are exactly as below

 
Instr(LastComma,Topic_WhoViewed,"," & MemberID,1) > 0 or _
InstrRev(Topic_WhoViewed,MemberID & "," ,FirstComma,1) > 0 or _
(Instr(Topic_WhoViewed,Member_ID) > 0 And Instr(Topic_WhoViewed,",")= 0) or _




Okay, it will still fail under certain circumstances. I know where.

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 20 November 2001 03:14:02

Edited by - GauravBhabu on 20 November 2001 03:19:03
Go to Top of Page

Da_Stimulator
DEV Team Forum Moderator

USA
3373 Posts

Posted - 20 November 2001 :  03:23:07  Show Profile  Send Da_Stimulator an AOL message  Send Da_Stimulator a Yahoo! Message
Wow what I miss when Im busy :)

Thx GauravBhabu - I updated the zip with your changes.

----
-Eric | Mod Resource | Test Area
"A program is a device used to convert data into error messages."
http://phpscriptcenter.com -Quality PHP Scripts
Go to Top of Page

suhern
Junior Member

186 Posts

Posted - 20 November 2001 :  03:31:05  Show Profile
It is still not working this is the code and thanks for all the help.

quote:


'--------------- TOPIC AND REPLY VIEW
if MemberID = 0 or IsNull(MemberID) then
'dont update anything
else
strsql = "SELECT " & strActivePrefix & "TOPICS.T_WHOVIEWED FROM " & strActivePrefix & "TOPICS WHERE "
strsql = strsql & strActivePrefix & "TOPICS.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
DOUpDate = true
else
Firstcomma = Instr(1,Topic_WhoViewed, ",",1)
LastComma = InstrRev(Topic_WhoViewed,",",-1,1)
if FirstComma = 0 then FirstComma = 1
if LastComma = 0 then LastComma = FirstComma
If Instr(LastComma,Topic_WhoViewed,"," & MemberID,1) > 0 or _
InstrRev(Topic_WhoViewed,MemberID & "," ,FirstComma,1) > 0 or _
(Instr(Topic_WhoViewed,Member_ID) > 0 And Instr(Topic_WhoViewed,",")= 0) or _
(len(Topic_WhoViewed) + len(MemberID) = 255) or _
(len(Topic_WhoViewed) + len(MemberID) > 255) then
DOUpDate = false
else
DOUpDate = true
UpdateTview = Topic_WhoViewed & "," & MemberID
end if
end if


if DOUpdate = true then
strsql = "UPDATE " & strActivePrefix & "TOPICS "
strsql = strsql & "SET " & strActivePrefix & "TOPICS.T_WHOVIEWED = '" & UpdateTview & "' WHERE "
strsql = strsql & strActivePrefix & "TOPICS.TOPIC_ID = " & Topic_ID
my_conn.execute(strsql)
end if
end if
'--------------- END TOPIC AND REPLY VIEW



Go to Top of Page

suhern
Junior Member

186 Posts

Posted - 20 November 2001 :  03:34:19  Show Profile
Just to add there this id =131 in one topic and it is stopping me from getting capture.

Go to Top of Page

GauravBhabu
Advanced Member

4288 Posts

Posted - 20 November 2001 :  03:40:08  Show Profile
quote:

Just to add there this id =131 in one topic and it is stopping me from getting capture.



Yes, I also noticed. Here is the fix.

 
***Removed Bad Code to avoid Confusion


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 20 November 2001 06:36:53
Go to Top of Page

Classicmotorcycling
Development Team Leader

Australia
2084 Posts

Posted - 20 November 2001 :  03:43:56  Show Profile
This is a great little mod.. Went in first go and works great. I am having no issues with it and that's gotta be a good thing..

Great work Da_Stimulator..


Regards,

Webmaster @ Classic Motorycling Australia
Classic Motorcycling Australia

Edited by - Classicmotorcycling on 20 November 2001 03:45:02
Go to Top of Page

Da_Stimulator
DEV Team Forum Moderator

USA
3373 Posts

Posted - 20 November 2001 :  03:59:00  Show Profile  Send Da_Stimulator an AOL message  Send Da_Stimulator a Yahoo! Message
Thx CM - you may want to update it to GauravBhabu code though -

Zip is updated.

----
-Eric | Mod Resource | Test Area
"A program is a device used to convert data into error messages."
http://phpscriptcenter.com -Quality PHP Scripts
Go to Top of Page

GauravBhabu
Advanced Member

4288 Posts

Posted - 20 November 2001 :  04:17:10  Show Profile
stim, the code in my last post is a good fix. Just a minor issue in one condition but that is taken care in the other condition

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 - 20 November 2001 :  06:41:12  Show Profile
Finally A Good Fix. Hopefully without any Issues.


 
'--------------- TOPIC AND REPLY VIEW
if MemberID = 0 or IsNull(MemberID) or MemberID < 0 then
'dont update anything
else
strsql = "SELECT " & strActivePrefix & "TOPICS.T_WHOVIEWED FROM " & strActivePrefix & "TOPICS WHERE "
strsql = strsql & strActivePrefix & "TOPICS.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
DOUpDate = true
else
DoUpDate = True
LenWhoViewed = len(Topic_WhoViewed)
Firstcomma = Instr(1,Topic_WhoViewed, ",",1)
LastComma = InstrRev(Topic_WhoViewed,",",-1,1)
If FirstComma = 0 then
if (LenWhoViewed = len(MemberID) and Instr(Topic_WhoViewed,MemberID) > 0) then 'MatchFound
DOUpDate = false
end if
end if
if (FirstComma > 0 and LastComma >= FirstComma and DoUpdate = true) then
If Instr(FirstComma,Topic_WhoViewed, "," & MemberID & ",",1) > 0 then 'MatchFound
DOUpDate = false
end if
if (Instr(LastComma,Topic_WhoViewed, "," & MemberID ,1) > 0 and _
LenWhoViewed = LastComma + len(MemberID)) then 'MatchFound
DOUpDate = false
end if
if (InstrRev(Topic_WhoViewed, MemberID & "," ,FirstComma,1) > 0 and _
len(left(Topic_WhoViewed,FirstComma-1)) = len(MemberID)) then 'MatchFound
DoUpDate = false
end if
end if
if DoUpdate = True then
if (len(Topic_WhoViewed) + len(MemberID) = 255) or _
(len(Topic_WhoViewed) + len(MemberID) > 255) then 'Max Limit
DoUpDate = false
end if
end if
if DoUpDate = True then
UpdateTview = Topic_WhoViewed & "," & MemberID
end if
end if
if DOUpdate = true then
strsql = "UPDATE " & strActivePrefix & "TOPICS "
strsql = strsql & "SET " & strActivePrefix & "TOPICS.T_WHOVIEWED = '" & UpdateTview & "' WHERE "
strsql = strsql & strActivePrefix & "TOPICS.TOPIC_ID = " & Topic_ID
my_conn.execute(strsql)
end if
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 20 November 2001 16:15:27
Go to Top of Page

Da_Stimulator
DEV Team Forum Moderator

USA
3373 Posts

Posted - 20 November 2001 :  07:03:57  Show Profile  Send Da_Stimulator an AOL message  Send Da_Stimulator a Yahoo! Message
Zip reflects the changes

----
-Eric | Mod Resource | Test Area
Sleep: A completely inadequate substitute for caffeine
http://phpscriptcenter.com -Quality PHP Scripts
Go to Top of Page
Page: of 4 Previous Topic Topic Next Topic  
Previous Page | Next 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.17 seconds. Powered By: Snitz Forums 2000 Version 3.4.07