Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Snitz Forums 2000 MOD-Group
 MOD Add-On Forum (W/Code)
 Mod: Site Supporter

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!
Before posting, make sure you have read this topic!

Screensize:
UserName:
Password:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkInsert EmailInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
Webbo 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

<
15   L A T E S T    R E P L I E S    (Newest First)
Webbo 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
Carefree 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 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 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):

					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 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
Carefree 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 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 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 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 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.
Carefree 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.
Webbo 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"
Webbo 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
Carefree 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.

<%
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
%>

Carefree Posted - 11 October 2009 : 17:30:29
See this line:
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:
Response.Write

Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.06 seconds. Powered By: Snitz Forums 2000 Version 3.4.07