Author |
Topic |
smoutc
Starting Member
4 Posts |
Posted - 12 November 2001 : 11:54:00
|
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
|
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 |
|
|
HuwR
Forum Admin
United Kingdom
20584 Posts |
Posted - 12 November 2001 : 13:57:30
|
Yes I implemented this at my test forum, i will try to sort out the required changes and post them.
|
|
|
HuwR
Forum Admin
United Kingdom
20584 Posts |
Posted - 12 November 2001 : 15:09:54
|
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
|
|
|
smoutc
Starting Member
4 Posts |
Posted - 12 November 2001 : 17:22:23
|
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
|
|
|
HuwR
Forum Admin
United Kingdom
20584 Posts |
Posted - 12 November 2001 : 20:14:49
|
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
|
|
|
Da_Stimulator
DEV Team Forum Moderator
USA
3373 Posts |
Posted - 17 November 2001 : 20:45:22
|
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 |
|
|
Da_Stimulator
DEV Team Forum Moderator
USA
3373 Posts |
Posted - 19 November 2001 : 13:01:42
|
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 |
|
|
HuwR
Forum Admin
United Kingdom
20584 Posts |
Posted - 19 November 2001 : 13:20:12
|
Did you replace your inc_subscription.asp ?
|
|
|
Da_Stimulator
DEV Team Forum Moderator
USA
3373 Posts |
|
HuwR
Forum Admin
United Kingdom
20584 Posts |
Posted - 19 November 2001 : 13:38:56
|
did you add this code in the correct place
'-- Subscribe checkbox ----- PostCat_subscription = rsStatus("CAT_SUBSCRIPTION") PostForum_subscription = rsStatus("F_SUBSCRIPTION") '-- Subscribe checkbox end -
|
|
|
Da_Stimulator
DEV Team Forum Moderator
USA
3373 Posts |
Posted - 19 November 2001 : 13:41:51
|
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 |
|
|
Da_Stimulator
DEV Team Forum Moderator
USA
3373 Posts |
|
HuwR
Forum Admin
United Kingdom
20584 Posts |
Posted - 19 November 2001 : 14:11:29
|
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 ?
|
|
|
Da_Stimulator
DEV Team Forum Moderator
USA
3373 Posts |
|
HuwR
Forum Admin
United Kingdom
20584 Posts |
Posted - 19 November 2001 : 14:28:41
|
Ok, looks like the error is in inc_subscription, double check that the file was replaced correctly.
|
|
|
Topic |
|