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 DEV-Group
 DEV Discussions (General)
 Subsribe when posting
 New Topic  Topic Locked
 Printer Friendly
Next Page
Author Previous Topic Topic Next Topic
Page: of 5

smoutc
Starting Member

4 Posts

Posted - 12 November 2001 :  11:54:00  Show Profile
Hello,

I am interested in allowing users to subscribe to a topic at the stage of posting (either a new post or a reply). Probably the easiest way would be to just have a check box appear if the user is not already subscribed that says "subscribe to this topic". They could optionally just put a check in the box if they wanted notification on the topic.

Has anyone done this already? If so, could you post your code? If it hasn't been done, any tips would be helpful. Primarily, which .ASP pages would I need to modify.

Chris Smout

fatum
Junior Member

Belgium
281 Posts

Posted - 12 November 2001 :  13:37:22  Show Profile  Visit fatum's Homepage
You want a real checkbox ? (because then we have to check if the user is subscribed every time the user posts something).
Or is the popup also ok ?

<-- Edit -->
Started thinking about it, I think this can be done
I'll have a look at it this evening.

Fatum
-------------------
To b33r or to pron,
little-gamers.com

Edited by - fatum on 12 November 2001 13:39:13
Go to Top of Page

HuwR
Forum Admin

United Kingdom
20584 Posts

Posted - 12 November 2001 :  13:57:30  Show Profile  Visit HuwR's Homepage
Yes I implemented this at my test forum, i will try to sort out the required changes and post them.

Go to Top of Page

HuwR
Forum Admin

United Kingdom
20584 Posts

Posted - 12 November 2001 :  15:09:54  Show Profile  Visit HuwR's Homepage
Ok, here are the changed files. ( These are standard 3.03 files) all changes are clearly marked for those who can't replace the standard files.

http://www.magicmushroom.org.uk/subscribe.zip

Go to Top of Page

smoutc
Starting Member

4 Posts

Posted - 12 November 2001 :  17:22:23  Show Profile
Thanks!!

I updated the files, and it seems to work great with everything expect new posts. New posts fail on line 133 of inc_subscription.asp because there is no topic number on new posts. Any ideas??

Chris

Go to Top of Page

HuwR
Forum Admin

United Kingdom
20584 Posts

Posted - 12 November 2001 :  20:14:49  Show Profile  Visit HuwR's Homepage
Oops, sorry missed a bit of code

in post_info.asp, look for this code

NewTopicID = rs9("NewTopicId")
rs9.close
set rs9 = nothing
ProcessSubscriptions rs("Member_ID"), Cat_ID, Forum_ID, NewTopicID
end if

Now insert the code in red as follows

NewTopicID = rs9("NewTopicId")
rs9.close
set rs9 = nothing
ProcessSubscriptions rs("Member_ID"), Cat_ID, Forum_ID, NewTopicID
'-- Subscribe checkbox -----
if request.form("TNotify") <> "" then
if request.form("TNotify") = "1" then
AddSubscription "TOPIC", rs("MEMBER_ID"), Cat_ID, Forum_ID, NewTopicID
elseif request.form("TNotify") = "0" then
DeleteSubscription "TOPIC", getnewMemberNumber(), Cat_ID, Forum_ID, NewTopicID
end if
end if
'-- Subscribe checkbox end -


end if



Go to Top of Page

Da_Stimulator
DEV Team Forum Moderator

USA
3373 Posts

Posted - 17 November 2001 :  20:45:22  Show Profile  Send Da_Stimulator an AOL message  Send Da_Stimulator a Yahoo! Message
Huw I get an error on this line...


<% '-- Subscribe checkbox -----
if strSubscription > 0 and postCat_Subscription > 0 and postForum_Subscription > 0 then
CheckSubscription "TOPIC", getNewMemberNumber(), strRqCatID, strRqForumID, strRqTopicID, "<br>", "<br>"
end if
'-- Subscribe checkbox end - %>


Type Mismatch...

----
-Eric (da_stimulator)
Stims Snitz Test area
Snitz Mod Resource
PHP Script Center -Quality PHP Scripts
Go to Top of Page

Da_Stimulator
DEV Team Forum Moderator

USA
3373 Posts

Posted - 19 November 2001 :  13:01:42  Show Profile  Send Da_Stimulator an AOL message  Send Da_Stimulator a Yahoo! Message
I just looked through the code and didnt catch anything offhand... of course Im awake about 30 hours now so...

----
-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

HuwR
Forum Admin

United Kingdom
20584 Posts

Posted - 19 November 2001 :  13:20:12  Show Profile  Visit HuwR's Homepage
Did you replace your inc_subscription.asp ?

Go to Top of Page

Da_Stimulator
DEV Team Forum Moderator

USA
3373 Posts

Posted - 19 November 2001 :  13:28:10  Show Profile  Send Da_Stimulator an AOL message  Send Da_Stimulator a Yahoo! Message
Yes

----
-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

HuwR
Forum Admin

United Kingdom
20584 Posts

Posted - 19 November 2001 :  13:38:56  Show Profile  Visit HuwR's Homepage
did you add this code in the correct place

'-- Subscribe checkbox -----
PostCat_subscription = rsStatus("CAT_SUBSCRIPTION")
PostForum_subscription = rsStatus("F_SUBSCRIPTION")
'-- Subscribe checkbox end -


Go to Top of Page

Da_Stimulator
DEV Team Forum Moderator

USA
3373 Posts

Posted - 19 November 2001 :  13:41:51  Show Profile  Send Da_Stimulator an AOL message  Send Da_Stimulator a Yahoo! Message
Yes I added the code everywhere and followed the directions explicitly (although I commented out the code in post.asp so it would work)

post.asp ~line 125


set rsStatus = my_Conn.Execute(strSql)
'-- Subscribe checkbox -----
PostCat_subscription = rsStatus("CAT_SUBSCRIPTION")
PostForum_subscription = rsStatus("F_SUBSCRIPTION")
'-- Subscribe checkbox end -
if rsStatus.EOF or rsStatus.BOF then



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

Edited by - da_stimulator on 19 November 2001 13:43:56
Go to Top of Page

Da_Stimulator
DEV Team Forum Moderator

USA
3373 Posts

Posted - 19 November 2001 :  13:56:43  Show Profile  Send Da_Stimulator an AOL message  Send Da_Stimulator a Yahoo! Message
http://ttnetworks.121hosts.net/yap/post.asp.txt
http://ttnetworks.121hosts.net/yap/post_info.asp.txt

The inc_subscriptions I'm using is the exact one from the zip

----
-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

HuwR
Forum Admin

United Kingdom
20584 Posts

Posted - 19 November 2001 :  14:11:29  Show Profile  Visit HuwR's Homepage
MMM, not sure then, as a test, can you replace it with a valid set of numbers instead of the variables ie

<% '-- Subscribe checkbox -----
if strSubscription > 0 and postCat_Subscription > 0 and postForum_Subscription > 0 then CheckSubscription "TOPIC", 1, 1, 1, 1, "<br>", "<br>"
end if
'-- Subscribe checkbox end - %>

Do you still get the error then ?

Go to Top of Page

Da_Stimulator
DEV Team Forum Moderator

USA
3373 Posts

Posted - 19 November 2001 :  14:17:57  Show Profile  Send Da_Stimulator an AOL message  Send Da_Stimulator a Yahoo! Message
Same Error... this is perplexing

----
-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

HuwR
Forum Admin

United Kingdom
20584 Posts

Posted - 19 November 2001 :  14:28:41  Show Profile  Visit HuwR's Homepage
Ok, looks like the error is in inc_subscription, double check that the file was replaced correctly.

Go to Top of Page
Page: of 5 Previous Topic Topic Next Topic  
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.21 seconds. Powered By: Snitz Forums 2000 Version 3.4.07