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 ########
<%
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 of "" & strForumTitle & " within "<a href=""& strForumURL & pop_profile.asp?mode=edit>"your profile."</a>"'" & vbNewLine & 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="""& strForumURL & "& pop_profile.asp?mode=edit>""your profile.</a>" & vbNewLine & 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
%>
strSql = strSql & "'" & strForumTitle & "'"&"'" Sponsor Renewal "'"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 "'"
-------------------------------^
<%
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
%> strSql = strSql & ", & strForumTitle & " & ", Sponsor Renewal " strSql = strSql & ", '"& strForumTitle & "'"
strSql=strSql & "'" Sponsor Renewal "'"strMessage = ", 'You have previously chosen to become a forum sponsor. The sponsorship period "<%
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
%>
strMessage = strMessage & "' You can extend your sponsorship of '" & strForumTitle & "' at http://www.maggotdrowning.com/store/index.php?app=gbu0&ns=prodshow&ref=sitesupporter"">The Online Shop</a> '" & vbNewLineResponse.Write
Site Supporter 2.0
[ALTER]
MEMBERS
ADD#M_SPONSORREMIND#int#NULL#0
[END]
if SponsorDate >= DatetoStr(DateAdd("d",-30,strForumTimeAdjust)) then<%
strSql = "SELECT M_PMRECEIVE, M_SPONSORREMIND FROM " & strMemberTablePrefix & "MEMBERS WHERE MEMBER_ID="&MEMBERID
set rsPMs=my_Conn.Execute(strSql)
strSponsorRemind = "0"
if not rsPMs.EOF then
if isnull(rsPMs("M_SPONSORREMIND")) THEN
strSponsorRemind="0"
else
strSponsorRemind = cStr(rsPMs("M_SPONSORREMIND"))
end if
strPMReceive = cStr(rsPMs("M_PMRECEIVE"))
rsPMs.Close
end if
set rsPMs = Nothing
if strSponsorRemind <> "1" then
if strPMReceive = "1" and 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 & StrtoDate(SponsorDate)
strMessage = strMessage & ". You can extend your sponsorship of " & strForumTitle & " within your profile. '" & vbNewLine & vbNewLine
strSql = strSql & strMessage
strSql = strSql & ", '" & TF & "'"
strSql = strSql & ", 0, 1)"
set rsPM=my_Conn.Execute(strSql)
strSql = "UPDATE " & strMemberTablePrefix & "MEMBERS SET M_SPONSORREMIND=1 WHERE MEMBER_ID="&MEMBERID
my_Conn.Execute(strSql)
else
' PMs not allowed, send EM
strRecipientsName = strDBNTUserName
strSql = "SELECT M_EMAIL FROM " & strMemberTablePrefix & "MEMBERS WHERE MEMBER_ID="& MEMBERID
set rsEM=my_Conn.Execute(strSql)
if not rsEM.EOF then
strRecipients = chkString(rsEM("M_EMAIL"), "SQLString")
rsEM.Close
end if
set rsEM = Nothing
strFrom = strSender
strFromName = strForumTitle
strSubject = strForumTitle & " Sponsor Renewal "
strMessage = "Hello " & strDBNTUserName & 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 = strMessage & "will expire on: "
else
strMessage = strMessage & "expired on: "
end if
strMessage = strMessage & StrtoDate(SponsorDate) & ". "
strMessage = strMessage & "You can extend your sponsorship of " & strForumTitle
strMessage = strMessage & " within your profile at: " & strForumURL & "pop_profile.asp?mode=Edit" & vbNewLine & vbNewLine
%>
<!--#INCLUDE FILE="inc_mail.asp" -->
<%
strSql = "UPDATE " & strMemberTablePrefix & "MEMBERS SET M_SPONSORREMIND=1 WHERE MEMBER_ID="&MEMBERID
my_Conn.Execute(strSql)
end if
end if
%>Originally posted by Webbo
Nice work Carefree
One thing to add is that M_PMRECEIVE and M_SPONSORREMIND need adding also to the MEMBERS table:
Microsoft OLE DB Provider for ODBC Drivers error '80040e14'
[MySQL][ODBC 3.51 Driver][mysqld-5.0.67-community-nt]You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 's Forum Sponsor Renewal ', 1, 397, '20091013221505', 'You have previously chosen' at line 1
/forum/inc_sponsor_renew.asp, line 35
's Forum Sponsor RenewalApparently you changed the code. I didn't have any apostrophe showing possession.
if SponsorDate >= DatetoStr(DateAdd("d",-30,strForumTimeAdjust)) if SponsorDate <= DatetoStr(DateAdd("d",+30,strForumTimeAdjust)) thenResponse.Write " <tr>" & vbNewLine & _
" <td bgColor=""" & strPopUpTableColor& """ align=right valign=""top"" nowrap><b><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>Supporter End Date:</b>" & vbNewline & _
" <br><small>eg: 01/01/2009</small></font></td>" & vbNewLine & _
" <td bgColor=""" & strPopUpTableColor & """ valign=""top"">" & vbNewLine
Response.Write " <input name=""SPONSORDATE"" size=""14"" value=""" & rs("M_SPONSORDATE") & """></font>"
vbNewLine
strSql = strSql & " WHERE MEMBER_ID = " & cLng(Request.Form("MEMBER_ID"))
my_Conn.Execute(strSql),,adCmdText + adExecuteNoRecords
After those lines, insert the following:
if DatetoStr(Request.Form("SPONSORDATE")) > DatetoStr(strForumTimeAdjust) then
strSql = "UPDATE " & strMemberTablePrefix & "MEMBERS SET M_SPONSORREMIND=0 WHERE MEMBER_ID="&MEMBERID
my_Conn.Execute(strSql)
end if
Response.Write " <tr>" & vbNewLine & _
" <td bgColor=""" & strPopUpTableColor& """ align=right valign=""top"" nowrap><b><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>Reset Reminder:</b>" & vbNewline & _
" <input type=""checkbox"" name=""SPONSORREMIND"" value=""1"" checked=""true"">" & vbNewLine
Response.Write " </td>" & vbNewLine & _
" </tr>" & vbNewLine
if request("SPONSORREMIND") = "1" then
strSql = "UPDATE " & strMemberTablePrefix & "MEMBERS SET M_SPONSORREMIND=0 WHERE MEMBER_ID="&MEMBERID
my_Conn.Execute(strSql)
end if