Author |
Topic |
Webbo
Average Member
United Kingdom
982 Posts |
Posted - 28 October 2008 : 17:38:23
|
For some time I've been thinking of implementing a system where members of a forum can become a 'Site Supporter' by way of making a contribution such as an Annual or Quarterly subscription and receive acknowledgement for doing so.
Having searched for a mod that could acomplish this I found the 'Sponsoring Members Mod' by MarcelG and used this as the basis to my 'Site Supporter Mod'
The functionality of the mod is reasonably simple and is in Four parts: - (1) The base code - 'Sponsoring Members Mod' by MarcelG
- (2) The 'Site Supporter' add-on in topic.asp to show whether or not a member is a 'Site Supporter'
- (3) An add-on to show an expiration date to a member's subscription which will also determine if the above shows in the mini-profile, or not
- (4) Modifications to members.asp to add two additional columns to show if a member is a Site Supporter, whether Annual or Quarterly, and also the expiration date of the member's subscription
Enjoy: 'Site Supporter Mod' by Webbo
Edit: The mod is now available with MarcelG's Sponsor Mod integrated into it: http://www.snitzbitz.com/mods/details.asp?Version=All&mid=284
Disclaimer: This mod is offered with no guarantees, and offered 'as is' It has been tested on a MySql database, please back up all files before making any changes
Notes: If changing a member from 'Annual' or 'Quarterly' to 'None' in their profile, a date must still be entered in 'Supporter End Date:' This has the advantage of showing that a member once supported and a suggested date is the date their subscription ran out
Enjoy
< |
Edited by - Webbo on 30 October 2008 02:47:42 |
|
Etymon
Advanced Member
United States
2385 Posts |
Posted - 29 October 2008 : 01:20:02
|
Hi Webbo,
Thanks so much for your contribution. I am sure it will be also appreciated by many others!
Thanks again!
Sincerely,
Etymon < |
|
|
MarcelG
Retired Support Moderator
Netherlands
2625 Posts |
|
Webbo
Average Member
United Kingdom
982 Posts |
Posted - 29 October 2008 : 16:14:24
|
Thanks Etymon and Marcel
I have now integrated Marcel's 'Sponsor Mod' and the 'Site Supporters Mod' as one and Carefree has repackaged it for me It has now been released as 'Site Supporter Mod ver1.1' and can be downloaded from SnitzBitz: http://www.snitzbitz.com/mods/details.asp?Version=All&mid=284
< |
Edited by - Webbo on 30 October 2008 02:46:02 |
|
|
Webbo
Average Member
United Kingdom
982 Posts |
Posted - 31 October 2008 : 14:47:17
|
There was an error in the code. _______________________________________________________________ Step 5b : Setting/Updating the M_SPONSORLEVEL, M_SPONSORDATE
Find this: (around line 1552) find this:
strSql = strSql & ", M_LEVEL = " & cLng("0" & Request.Form("Level"))
Paste this code right below it.
'---------- Site Supporter Mod
strSql = strSql & ", M_SPONSORLEVEL = " & cLng("0" & Request.Form("Sponsorlevel"))
strSql = strSql & ", M_SPONSORDATE = " & DatetoStr(cDate(Request.Form("Sponsordate")))
'---------- end Site Supporter Mod
_______________________________________________________________
The parts in red must be removed or errors in formatting will result when making changes to the profile that do NOT change already specified sponsor information.
The line should read:
strSql = strSql & ", M_SPONSORDATE = " & DatetoStr(Request.Form("Sponsordate"))
The readme.htm, the SiteSupporter 12.rtf, the pop_profile.asp & the zip file contents have been updated in SnitzBitz. < |
Edited by - Webbo on 31 October 2008 14:48:08 |
|
|
Webbo
Average Member
United Kingdom
982 Posts |
Posted - 18 January 2009 : 17:50:41
|
I've found a small bug in the code that affects the optional "slev = " function
In topic.asp this line (about 131) remove this line:
sLev = rsTopic("M_SPONSORLEVEL")
It doesn't perform any function and was left in when the mod was merged with MarcelG's
Edit: The Zip files in SnitzBitz have been updated< |
Edited by - Webbo on 18 January 2009 18:10:10 |
|
|
Webbo
Average Member
United Kingdom
982 Posts |
Posted - 02 October 2009 : 02:27:43
|
Can someone point me in the direction of how to add an automatic notification by either PM or Email when a member's Site Support is about to run out
eg: Check to see if member is a Site Supporter when visiting board and if so check expiry date and if equal to or less than 30days from expiration send Email or PM inviting them to renew
It sounds simple enough but i can't seem to get my head around it
Thanks |
|
|
Carefree
Advanced Member
Philippines
4207 Posts |
Posted - 02 October 2009 : 23:48:43
|
In the modified "inc_header.asp"
Look for the following lines:
' ########## Sponsor Mod ##########
strSql = "SELECT M_NAME, M_SPONSORLEVEL, M_SPONSORDATE"
strSql = strSql & " FROM " & strMemberTablePrefix & "MEMBERS "
strSql = strSql & " WHERE M_NAME= '" & ChkString(strDBNTUserName, "SQLString") & "'"
strSql = strSql & " AND M_SPONSORDATE > '" & DatetoStr(strForumTimeAdjust) & "'"
set rsSponsor = my_Conn.Execute (strSql)
if rsSponsor.EOF or rsSponsor.BOF then
sLev = 0
else
sLev = rsSponsor("M_SPONSORLEVEL")
end if
rsSponsor.close
set rsSponsor = nothing
' ######## Sponsor Mod End ########
Change those to say:
' ########## Sponsor Mod ##########
strSql = "SELECT M_NAME, M_SPONSORLEVEL, M_SPONSORDATE"
strSql = strSql & " FROM " & strMemberTablePrefix & "MEMBERS "
strSql = strSql & " WHERE M_NAME= '" & ChkString(strDBNTUserName, "SQLString") & "'"
strSql = strSql & " AND M_SPONSORDATE > '" & DatetoStr(strForumTimeAdjust) & "'"
set rsSponsor = my_Conn.Execute (strSql)
if rsSponsor.EOF or rsSponsor.BOF then
sLev = 0
else
sLev = rsSponsor("M_SPONSORLEVEL")
SponsorDate = rsSponsor("M_SPONSORDATE")
if SponsorDate <= DatetoStr(DateAdd("d",-30,strForumTimeAdjust)) then
' Send PM or EM
%>
<!--#INCLUDE FILE="inc_sponsor_renew.asp" -->
<%
end if
end if
rsSponsor.close
set rsSponsor = nothing
' ######## Sponsor Mod End ########
Then make a "inc_sponsor_renew.asp" page to handle the check if PMs are allowed, use PM if so; else send EMail. |
|
|
Webbo
Average Member
United Kingdom
982 Posts |
Posted - 05 October 2009 : 17:45:56
|
Looks good Carefree but what would you have in the inc_sponsor_renew.asp file? |
|
|
Carefree
Advanced Member
Philippines
4207 Posts |
Posted - 06 October 2009 : 14:19:37
|
I haven't tested this and there may be errors in the syntax, my head hurts and it's hard to concentrate. Give it a try and if you have errors, I'll try and fix later.
|
|
|
Webbo
Average Member
United Kingdom
982 Posts |
Posted - 07 October 2009 : 17:07:20
|
Hi Carefree, I'm getting Expected end of statement errors on lines 6 & 10 using the above inc_sponsor_renew.asp
Any help would be appreciated
|
|
|
Carefree
Advanced Member
Philippines
4207 Posts |
Posted - 08 October 2009 : 05:04:43
|
Change line 6 to say:
strSql = strSql & "'" & strForumTitle & "'"&"'" Sponsor Renewal "'"
I don't see anything wrong with line 10. |
|
|
Webbo
Average Member
United Kingdom
982 Posts |
Posted - 10 October 2009 : 14:49:35
|
Still can't get it to work Carefree
It's throwing up the following errors on Lines 6 and 10
Microsoft VBScript compilation error '800a0401'
Expected end of statement
/forum/inc_sponsor_renew.asp, line 6
strSql = strSql & "'" & strForumTitle & "'"&"'" Sponsor Renewal "'"
------------------------------------------------^
Microsoft VBScript compilation error '800a0401'
Expected end of statement
/forum/inc_sponsor_renew.asp, line 10
strMessage = strMessage & ", '"You have previously chosen to become a forum sponsor. The sponsorship period "'"
-------------------------------^
|
|
|
Webbo
Average Member
United Kingdom
982 Posts |
Posted - 11 October 2009 : 05:20:51
|
I seem to have fixed the Expected end of Statement errors witht he following code:
<%
if strPMStatus="1" then
' PMs allowed, send PM
set rsAdmin=Nothing
strSql = "INSERT INTO " & strTablePrefix & "PM (M_SUBJECT, M_FROM, M_TO, M_SENT, M_MESSAGE, M_MAIL, M_READ, M_OUTBOX) VALUES ("
strSql = strSql & ", & strForumTitle & " & ", Sponsor Renewal "
strSql = strSql & ", " & intAdminMemberID
strSql = strSql & ", " & MEMBERID
strSql = strSql & ", '" & DateToStr(strForumTimeAdjust) & "'"
strMessage = strMessage & ", You have previously chosen to become a forum sponsor. The sponsorship period "
if SponsorDate <= DatetoStr(strForumTimeAdjust) then
strMessage = strMessage & ", will expire on: "
else
strMessage = strMessage & ", expired on: "
end if
strMessage = strMessage & "'" & SponsorDate & "'"&". " & vbNewLine & vbNewLine
strMessage = strMessage & ", You can extend your sponsorship within <a href=""http://www.link"">The Online Shop</a>" & vbNewLine
strSql = strSql & strMessage
strSql = strSql & ", " & TF
strSql = strSql & ", " & "0"
set rsPM=my_Conn.Execute(strSql)
else
' PMs not allowed, send EM
strRecipientsName = chkString(rsKey("M_NAME"),"SQLString")
strRecipients = chkString(rsKey("M_EMAIL"),"SQLString")
strFrom = strSender
strFromName = strForumTitle
strSubject = strForumTitle & " Sponsor Renewal "
strMessage = "Hello " & chkString(rsKey("M_NAME"),"SQLString") & vbNewLine & vbNewLine
strMessage = strMessage & "You received this message from " & strForumTitle & ". You have previously chosen to become a forum sponsor." & vbNewLine & vbNewLine
strMessage = strMessage & "The sponsorship period "
if SponsorDate <= DatetoStr(strForumTimeAdjust) then
strMessage = "will expire on: "
else
strMessage = "expired on: "
end if
strMessage = strMessage & SponsorDate & ". " & vbNewLine & vbNewLine
strMessage = strMessage & ", You can extend your sponsorship within <a href=""http://www.link"">The Online Shop</a>" & vbNewLine
Response.Write "strRecipientsName = " & strRecipientsName & "<br>"
Response.Write "strRecipients = " & strRecipients & "<br>"
Response.Write "strFrom = " & strFrom & "<br>"
Response.Write "strFromName = " & strFromName & "<br>"
Response.Write "strsubject = " & strsubject & "<br><br>"
Response.Write "strMessage = " & strMessage & "<br><br>"
%>
<!--#INCLUDE FILE="inc_mail.asp" -->
<%
end if
%>
But the emails or PMs aren't being sent ....? |
Edited by - Webbo on 11 October 2009 05:21:48 |
|
|
Carefree
Advanced Member
Philippines
4207 Posts |
Posted - 11 October 2009 : 09:17:49
|
In that format, line 6 will not work. It must be a string enclosed within apostrophes since it's being inserted into a string field: strSql = strSql & ", & strForumTitle & " & ", Sponsor Renewal "
Could break it:strSql = strSql & ", '"& strForumTitle & "'"
strSql=strSql & "'" Sponsor Renewal "'"
Since line 10 is the beginning of strMessage, it should say:strMessage = ", 'You have previously chosen to become a forum sponsor. The sponsorship period " |
Edited by - Carefree on 14 October 2009 16:20:28 |
|
|
Webbo
Average Member
United Kingdom
982 Posts |
Posted - 11 October 2009 : 17:16:44
|
Using the code as above is still giving Expected end of statement errors on all the lines that include a text message such as Lines 6, 10, 12,.14, etc
Removing the " that the lines are enclosed by solves the error messages but still can't get the PM or Email to send. (I've double checked to see if emails are being sent by other functions and no problems with it)
Re-hashing the code a bit to the following solves the error messages but I'm becoming flumuxed now
<%
if strPMStatus="1" then
' PMs allowed, send PM
set rsAdmin=Nothing
strSql = "INSERT INTO " & strTablePrefix & "PM (M_SUBJECT, M_FROM, M_TO, M_SENT, M_MESSAGE, M_MAIL, M_READ, M_OUTBOX) VALUES ("
strSql = strSql & ", '"& strForumTitle & "'"
strSql=strSql & "' Sponsor Renewal '"
strSql = strSql & ", " & intAdminMemberID
strSql = strSql & ", " & MEMBERID
strSql = strSql & ", '" & DateToStr(strForumTimeAdjust) & "'"
strMessage = strMessage & ", ' You have previously chosen to become a forum sponsor. The sponsorship period '"
if SponsorDate <= DatetoStr(strForumTimeAdjust) then
strMessage = strMessage & "' will expire on: '"
else
strMessage = strMessage & "' expired on: '"
end if
strMessage = strMessage & "'" & SponsorDate & "'"&". " & vbNewLine & vbNewLine
strMessage = strMessage & "' You can extend your sponsorship of "' & strForumTitle & '" within http://www.maggotdrowning.com/store/index.php?app=gbu0&ns=prodshow&ref=sitesupporter"">The Online Shop</a> '" & vbNewLine
strSql = strSql & strMessage
strSql = strSql & ", " & TF
strSql = strSql & ", " & "0"
set rsPM=my_Conn.Execute(strSql)
else
' PMs not allowed, send EM
strRecipientsName = chkString(rsKey("M_NAME"),"SQLString")
strRecipients = chkString(rsKey("M_EMAIL"),"SQLString")
strFrom = strSender
strFromName = strForumTitle
strSubject = strForumTitle & " Sponsor Renewal "
strMessage = "Hello " & chkString(rsKey("M_NAME"),"SQLString") & vbNewLine & vbNewLine
strMessage = strMessage & "You received this message from " & strForumTitle & ". You have previously chosen to become a forum sponsor." & vbNewLine & vbNewLine
strMessage = strMessage & "The sponsorship period "
if SponsorDate <= DatetoStr(strForumTimeAdjust) then
strMessage = "will expire on: "
else
strMessage = "expired on: "
end if
strMessage = strMessage & SponsorDate & ". " & vbNewLine & vbNewLine
strMessage = strMessage & "' You can extend your sponsorship of "' & strForumTitle & '" within <a href=""http://www.link"">The Online Shop</a> '" & vbNewLine
Response.Write "strRecipientsName = " & strRecipientsName & "<br>"
Response.Write "strRecipients = " & strRecipients & "<br>"
Response.Write "strFrom = " & strFrom & "<br>"
Response.Write "strFromName = " & strFromName & "<br>"
Response.Write "strsubject = " & strsubject & "<br><br>"
Response.Write "strMessage = " & strMessage & "<br><br>"
%>
<!--#INCLUDE FILE="inc_mail.asp" -->
<%
end if
%>
|
|
|
Topic |
|