Author |
Topic |
Carefree
Advanced Member
Philippines
4207 Posts |
Posted - 11 October 2009 : 17:30:29
|
See this line:
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:Response.Write |
Edited by - Carefree on 12 October 2009 06:57:01 |
|
|
Carefree
Advanced Member
Philippines
4207 Posts |
Posted - 11 October 2009 : 18:44:57
|
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.
Site Supporter 2.0
[ALTER]
MEMBERS
ADD#M_SPONSORREMIND#int#NULL#0
[END]
Change this in "inc_header.asp" (it was backwards):
if SponsorDate >= DatetoStr(DateAdd("d",-30,strForumTimeAdjust)) then
This version includes a check if a reminder message has already been sent.
|
Edited by - Carefree on 12 October 2009 21:06:25 |
|
|
Webbo
Average Member
United Kingdom
982 Posts |
Posted - 12 October 2009 : 17:57:00
|
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
Average Member
United Kingdom
982 Posts |
Posted - 12 October 2009 : 18:24:40
|
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
Advanced Member
Philippines
4207 Posts |
Posted - 12 October 2009 : 20:29:01
|
duhhh yeah, that would cause it
Fixed it and added a check for a null value in code above. |
Edited by - Carefree on 12 October 2009 21:07:44 |
|
|
Carefree
Advanced Member
Philippines
4207 Posts |
Posted - 12 October 2009 : 20:34:44
|
quote: 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
Average Member
United Kingdom
982 Posts |
Posted - 13 October 2009 : 17:18:50
|
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 )
Email function works fine now and with a MySql db, however I'm getting the following error for the PM function using MySql:
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
Advanced Member
Philippines
4207 Posts |
Posted - 14 October 2009 : 16:23:53
|
quote: 's Forum Sponsor Renewal
Apparently you changed the code. I didn't have any apostrophe showing possession. |
|
|
Webbo
Average Member
United Kingdom
982 Posts |
Posted - 14 October 2009 : 18:55:36
|
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:
if SponsorDate >= DatetoStr(DateAdd("d",-30,strForumTimeAdjust))
needs changing to this:
if SponsorDate <= DatetoStr(DateAdd("d",+30,strForumTimeAdjust)) then
otherwise all sponsors with more than 30 days to renewal will receive the reminder
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
Advanced Member
Philippines
4207 Posts |
Posted - 14 October 2009 : 19:17:14
|
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
Average Member
United Kingdom
982 Posts |
Posted - 15 October 2009 : 03:00:24
|
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:
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 |
Edited by - Webbo on 15 October 2009 03:16:21 |
|
|
Carefree
Advanced Member
Philippines
4207 Posts |
Posted - 16 October 2009 : 01:02:52
|
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):
|
|
|
Webbo
Average Member
United Kingdom
982 Posts |
Posted - 16 October 2009 : 18:16:51
|
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:
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
Advanced Member
Philippines
4207 Posts |
Posted - 16 October 2009 : 21:40:31
|
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
Average Member
United Kingdom
982 Posts |
Posted - 28 October 2009 : 16:30:54
|
Hi Carefree - I'm not ignoring you just been too busy of late and not had chance to get back on with it |
|
|
Topic |
|