Mod: Site Supporter

Snitz™ Forums 2000
https://forum.snitz.com/forumTopic/Posts/67823?pagenum=1
05 November 2025, 10:51

Topic


Webbo
Mod: Site Supporter
28 October 2008, 17:38


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

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 [^]
<

 

Replies ...


Etymon
29 October 2008, 01:20


Hi Webbo,

Thanks so much for your contribution. I am sure it will be also appreciated by many others!
Thanks again!
Sincerely,

Etymon
<
MarcelG
29 October 2008, 04:57


Nice work Dave!<
Webbo
29 October 2008, 16:14


Thanks Etymon and Marcel smile
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

<
Webbo
31 October 2008, 14:47


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. <
Webbo
18 January 2009, 17:50


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<
Webbo
02 October 2009, 02:27


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
02 October 2009, 23:48


In the modified "inc_header.asp"
Code:

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
05 October 2009, 17:45


Looks good Carefree but what would you have in the inc_sponsor_renew.asp file?
Carefree
06 October 2009, 14:19


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.
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 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
%>
Webbo
07 October 2009, 17:07


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
08 October 2009, 05:04


Change line 6 to say:
Code:
strSql = strSql & "'" & strForumTitle & "'"&"'" Sponsor Renewal "'"

I don't see anything wrong with line 10.
Webbo
10 October 2009, 14:49


Still can't get it to work Carefree

It's throwing up the following errors on Lines 6 and 10


Code:
Microsoft VBScript compilation error '800a0401' 

Expected end of statement

/forum/inc_sponsor_renew.asp, line 6

strSql = strSql & "'" & strForumTitle & "'"&"'" Sponsor Renewal "'"
------------------------------------------------^



Code:
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
11 October 2009, 05:20


I seem to have fixed the Expected end of Statement errors witht he following code:

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 ....?
Carefree
11 October 2009, 09:17


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:
Code:
   strSql = strSql & ", & strForumTitle & " & ", Sponsor Renewal "

Could break it:
Code:
   strSql = strSql & ", '"& strForumTitle & "'"
strSql=strSql & "'" Sponsor Renewal "'"

Since line 10 is the beginning of strMessage, it should say:
Code:
strMessage = ", 'You have previously chosen to become a forum sponsor.  The sponsorship period "
Webbo
11 October 2009, 17:16


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 smile
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 & "'"
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
%>

Carefree
11 October 2009, 17:30


See this line:
Code:
 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> '" & vbNewLine

Check the content of the strMessage line when it's output to the screen to make sure it says what you want. BTW, when you're happy with the EMail results, you can remove the lines beginning with:
Code:
Response.Write
Carefree
11 October 2009, 18:44


You'll need to set a value in the member table to indicate that the EM/PM has been sent or the member will get them with every view of every page.
Code:

Site Supporter 2.0
[ALTER] MEMBERS
ADD#M_SPONSORREMIND#int#NULL#0
[END]


Change this in "inc_header.asp" (it was backwards):
Code:
		if SponsorDate >= DatetoStr(DateAdd("d",-30,strForumTimeAdjust)) then


This version includes a check if a reminder message has already been sent.
Code:
<%
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
%>
Webbo
12 October 2009, 17:57


Nice work Carefree

One thing to add is that M_PMRECEIVE and M_SPONSORREMIND need adding also to the MEMBERS table:

[ALTER] MEMBERS
ADD#M_SPONSORRENEW#int#NULL#0
ADD#M_PMRECEIVE#int#NULL#0
ADD#M_SPONSORREMIND#int#NULL#0
[END]
I've yet to test it with Private Messages but the email sending works well

I'll report back shortly
Webbo
12 October 2009, 18:24


Found one problem and that is that once an email is sent out to one member then all member's M_SPONSORREMIND is set to 1, not just the member that was sent the email

I suspect caused by this line:
strSql = "UPDATE " & strMemberTablePrefix & "MEMBERS SET M_SPONSORREMIND=1"
Carefree
12 October 2009, 20:29


duhhh
yeah, that would cause it

Fixed it and added a check for a null value in code above.
Carefree
12 October 2009, 20:34


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:

PMRECEIVE is added by the private messages dbs file.
Webbo
13 October 2009, 17:18


I added the above because I didn't have Private Messaging added to my test forum
(I forgot to remove it before posting it above smile)

Email function works fine now and with a MySql db, however I'm getting the following error for the PM function using MySql:

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

Carefree
14 October 2009, 16:23


's Forum Sponsor Renewal
Apparently you changed the code. I didn't have any apostrophe showing possession.
Webbo
14 October 2009, 18:55


Strange one, it turned out to be an apostrophe in my forum's name that caused the error

Anyway, all tested now on MySql and the emailand PM function work well but the following line in inc_header.asp:

Code:
if SponsorDate >= DatetoStr(DateAdd("d",-30,strForumTimeAdjust))

needs changing to this:

Code:
      if SponsorDate <=  DatetoStr(DateAdd("d",+30,strForumTimeAdjust)) then

otherwise all sponsors with more than 30 days to renewal will receive the reminder smile
One thing though, if the column M_SPONSORREMIND in the database is set to 1 after the reminder has been sent out, that prevents repeat reminders being sent at each page view, but what will happen in a year's time - would this prevent further reminders being sent out?
Regards,

Dave
Carefree
14 October 2009, 19:17


Yes. One solution to that would be to change the field from an integer to a string and use the date a reminder was sent. Alternatively, you could add a routine to set it to 0 upon renewal of the sponsorship.
Webbo
15 October 2009, 03:00


I had a thought last night and the easiest way I think to do this would be to have a checkbox for the administrator to tick to set the member's M_SPONSORREMIND to 0 within inc_profile.asp whilst they are entering the 'Supporter End Date:' which has to be done manually

Added onto this code should do the job:

Code:
Response.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

I'll have a look at it tonight (UKtime) unless you beat me to it smile
Carefree
16 October 2009, 01:02


No reason to add an extra step for the administrator. In "pop_profile.asp", look for the following lines (appx 1599-1601 in the file modified for sponsor mod):
Code:

					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
Webbo
16 October 2009, 18:16


I couldn't get that to work Carefree, it didn't make any changes to the M_SPONSORREMIND value in the db when the sponsor date was changed to a later date than the forum date

I had a go at adding a checked checkbox to inc_profile and achieved this:

Code:

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

However, I cannot get that to change the value to 0 either when the Submit button is clicked when editing a profile as admin

Any idea whats missing?
Carefree
16 October 2009, 21:40


That's odd because it works fine here. Did you make sure to set the sponsorship date at least 31 days in advance (so it didn't automatically reset to 1 again)?
Webbo
28 October 2009, 16:30


Hi Carefree - I'm not ignoring you just been too busy of late and not had chance to get back on with it smile
© 2000-2021 Snitz™ Communications