Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Snitz Forums 2000 MOD-Group
 MOD Add-On Forum (W/O Code)
 Link to Paypal on Registration
 New Topic  Reply to Topic
 Printer Friendly
Previous Page | Next Page
Author Previous Topic Topic Next Topic
Page: of 3

thermal_seeker
Junior Member

United Kingdom
430 Posts

Posted - 20 January 2010 :  02:22:57  Show Profile  Reply with Quote
I'm looking for the code that checks the subscription date on login.. can you point me in the right direction please?

No good at coding, but I can plough a field !!
Go to Top of Page

Carefree
Advanced Member

Philippines
4207 Posts

Posted - 06 December 2010 :  16:34:02  Show Profile  Reply with Quote
I had forgotten this thread, someone pointed out that I never finished it LOL.

Code to check subscription date: Save the following as "dbs_PayPal.asp", then run it from admin console:


PayPal Date 1.0

[ALTER]
MEMBERS
ADD#M_PAYPALDATE#VARCHAR(8)#NULL#
[END]


In "inc_header.asp":


Look for the following lines (appx 197-200):

if trim(strDBNTUserName) <> "" and trim(Request.Cookies(strUniqueID & "User")("Pword")) <> "" then
	chkCookie = 1
	mLev = cLng(chkUser(strDBNTUserName, Request.Cookies(strUniqueID & "User")("Pword"),-1))
	chkCookie = 0

After them, insert the following:
	'	########## PayPal Mod ##########
	dim PayLev
	PayLev = 1
	strSql = "SELECT M_NAME, M_PAYPALDATE"
	strSql = strSql & " FROM " & strMemberTablePrefix & "MEMBERS "
	strSql = strSql & " WHERE M_NAME= '" & ChkString(strDBNTUserName, "SQLString") & "'"
	strSql = strSql & " AND M_PAYPALDATE > '" & DatetoStr(strForumTimeAdjust) & "'"
	set rsSponsor = my_Conn.Execute (strSql)
	if rsSponsor.EOF or rsSponsor.BOF then
		strPaid = "<font color=""red""><b>expired or not paid.</b></font>"
		PayLev = 0
	else
		strPaid = "<font color=""green""><b>current.</b></font>"
		rsSponsor.Close
	end if
	set rsSponsor = nothing
	Response.Write	"<table align=""center"" width=""50%"" border=""0"" cellspacing=""2"" cellpadding=""4"" bgcolor=""" & strPageBGColor & """>" & vbNewLine & _
		"	<tr valign=""middle"">" & vbNewLine & _
		"		<td align=""center"" width=""100%"" bgcolor=""" & strPageBGColor & """>" & vbNewLine & _
		"			<font face=""" & strDefaultFontFace & """ size=""" & strHeaderFontSize & """ color=""" & strForumFontColor & """>PayPal subscription to this board is required.  Your subscription is :  " & strPaid & vbNewLine & _
		"			</font>" & vbNewLine & _
		"		</td>" & vbNewLine & _
		"	</tr>" & vbNewLine & _
		"</table>" & vbNewLine
	if PayLev = 0 then
		MemberID = 0
		strDBNTUserName = ""
		strLoginStatus = 0
		Call ClearCookies()
		Response.Write	"<meta http-equiv=""Refresh"" content=""5; URL=login.asp"">" & vbNewLine
	end if
	'	######## PayPal Mod End ########



In "pop_profile.asp":


Look for the following line (appx 1707):

					strSql = strSql & ", M_LEVEL = " & cLng("0" & Request.Form("Level"))

After it, insert the following:

					'	########## PayPal Mod ##########
					if mLev > 3 and len(Request.Form("PAYPALDATE")) > 0 then
						strSql = strSql & ", M_PAYPALDATE = '" & left(ChkString(Request.Form("PAYPALDATE"), "SQLString"),8) & "'"
					end if
					'	########## PayPal Mod End ##########


Look for the following line (appx 1339):

			strSql = strSql & "     M_COUNTRY  = '" & ChkString(Request.Form("Country"),"SQLString")  & "', "


After it, insert the following:


			'	########## PayPal Mod ##########
			if mLev > 3 and len(Request.Form("PAYPALDATE")) > 0 then
				strSql = strSql & "     M_PAYPALDATE = '" & left(ChkString(Request.Form("PAYPALDATE"), "SQLString"),8) & "', "
			end if
			'	########## PayPal Mod End ##########


Look for the following line (appx 907):

				strSql = strSql & ", " & strMemberTablePrefix & "MEMBERS.M_COUNTRY"

After it, insert the following:
					'	########## PayPal Mod ##########
				strsql = strSql & ", " & strMemberTablePrefix & "MEMBERS.M_PAYPALDATE"
					'	########## PayPal Mod End ##########



Look for the following line (appx 817):

		strSql = strSql & ", " & strMemberTablePrefix & "MEMBERS.M_COUNTRY"

After it, insert the following:
		'	########## PayPal Mod ##########
		strsql = strSql & ", " & strMemberTablePrefix & "MEMBERS.M_PAYPALDATE"
		'	########## PayPal Mod End ##########



In "members.asp":



Look for the following lines (appx 462-464):

		if mlev = 4 or mlev = 3 then
			Response.Write	"                <td bgcolor=""" & CColor & """ align=""center"" nowrap><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strForumFontColor & """>" & ChkDate(Members_MemberLastHereDate,"",false) & "</font></td>" & vbNewLine
		end if

After them, insert the following:
		'	########## PayPal Mod ##########
		if mlev > 3 then
			Response.Write "                <td bgcolor=""" & CColor & """ align=""center""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strForumFontColor & """>"
			Response.Write ChkDate(Members_MemberPayPalDate,"",false)
			Response.Write "</font></td>" & vbNewLine
		end if
		'	########## PayPal Mod End ##########


Look for the following line (appx 389):

		Members_MemberCountry = arrMemberData(mM_COUNTRY, iMember)
After it, insert the following:
		'	########## PayPal Mod ##########
		Members_MemberPayPalDate = arrMemberData(mM_PAYPALDATE, iMember)
		'	########## PayPal Mod End ##########


Look for the following line (appx 367):

	mM_COUNTRY = 5

After it, insert the following, and renumber consecutive items appropriately:
	'	########## PayPal Mod ##########
	mM_PAYPALDATE = 6
	'	########## PayPal Mod End ##########


Look for the following lines (appx 348-352):

if mlev = 4 or mlev = 3 then
	Response.Write	"                <td align=""center"" bgcolor=""" & strHeadCellColor & """><a href=""members.asp?method="
	if Request.QueryString("method") = "lastheredatedesc" then Response.Write("lastheredateasc") else Response.Write("lastheredatedesc")
	Response.Write	"""" & dWStatus("Sort by Last Visit Date") & "><b><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strHeadFontColor & """>Last Visit</font></b></a></td>" & vbNewLine
end if

After them, insert the following:
'	########## PayPal Mod ##########
if mlev > 3 then
   Response.Write "                <td align=""center"" bgcolor=""" & strHeadCellColor & """><a href=""members.asp?method="
   if Request.QueryString("method") = "PayPaldate" then Response.Write("PayPaldate") else Response.Write("PayPaldate")
   Response.Write """" & dWStatus("Sort by PayPal Date") & "><b><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strHeadFontColor & """>Date Paid</font></b></a></td>" & vbNewLine
end if
'	########## PayPal Mod End ##########


Look for the following lines (appx 185-186):

	case "countrydesc"
		strSql4 = " ORDER BY M_COUNTRY DESC, M_NAME ASC"

After them, insert the following:
	'	########## PayPal Mod ##########
	case "PayPaldateasc"
		strSql4 = " ORDER BY M_PAYPALDATE ASC, M_NAME ASC"
	case "PayPaldatedesc"
		strSql4 = " ORDER BY M_PAYPALDATE DESC, M_NAME ASC"
	'	########## PayPal Mod End ##########


Look for the following lines (appx 107 AND 145):

	strSql = "SELECT MEMBER_ID, M_STATUS, M_NAME, M_LEVEL, M_EMAIL, M_COUNTRY, M_HOMEPAGE, "

Change them to say:
	strSql = "SELECT MEMBER_ID, M_STATUS, M_NAME, M_LEVEL, M_EMAIL, M_COUNTRY, M_PAYPALDATE, M_HOMEPAGE, "



In "inc_profile.asp":


Look for the following lines (appx 628-631):

		Response.Write	">No</option>" & vbNewLine & _
				"                      </select>" & vbNewLine & _
				"                      </td>" & vbNewLine & _
				"                    </tr>" & vbNewLine	


After them, insert the following:
		'	########## PayPal Mod ##########
		if Request.Form("Method_Type") = "Modify" or _
			Request.Form("Method_Type") = "goModify" or _
			Request.Form("Method_Type") = "goEdit" then
				Response.Write "										<tr>" & vbNewLine & _
					"											<td bgColor=""" & strPopUpTableColor & """ align=right valign=""top"" nowrap>" & vbNewLine & _
					"												<font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><b>PayPal Mod: </b>" & vbNewLine & _
					"												</font>" & vbNewLine & _
					"											</td>" & vbNewLine & _
					"											<td bgColor=""" & strPopUpTableColor & """ valign=""top""> " & vbNewLine & _
					"											</td>" & vbNewLine & _
					"										</tr>" & vbNewLine & _
					"										<tr>" & vbNewLine & _
					"											<td bgColor=""" & strPopUpTableColor& """ align=right valign=""top"" nowrap>" & vbNewLine & _
					"												<font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><b>Paid Date:</b><br><small>eg: YYYYMMDD</small>" & vbNewline & _
					"												</font>" & vbNewLine & _
					"											</td>" & vbNewLine & _
					"											<td bgColor=""" & strPopUpTableColor & """ valign=""top"">" & vbNewLine & _
					"												<input name=""PAYPALDATE"" size=""8"" value=""" & rs("M_PAYPALDATE") & """>" & vbNewLine & _
					"											</td>" & vbNewLine & _
					"										</tr>" & vbNewLine
		end if
		'	########## PayPal Mod End ##########


Edited by - Carefree on 19 December 2010 04:54:32
Go to Top of Page

thermal_seeker
Junior Member

United Kingdom
430 Posts

Posted - 08 December 2010 :  17:04:13  Show Profile  Reply with Quote
I'm getting this error:
Microsoft VBScript compilation error '800a0401'

Expected end of statement

/Forum/inc_header.asp, line 226

"<meta http-equiv=""Refresh"" content=""2; URL="login.asp""">" & vbNewLine
------------------------------------------------^




Dave

No good at coding, but I can plough a field !!

Edited by - thermal_seeker on 10 December 2010 03:44:43
Go to Top of Page

Classicmotorcycling
Development Team Leader

Australia
2084 Posts

Posted - 10 December 2010 :  04:31:17  Show Profile  Reply with Quote
Change the line to read:


"<meta http-equiv=""Refresh"" content=""2; URL=""login.asp"""">" & vbNewLine


That should fix it..

Cheers,

David Greening
Go to Top of Page

Jezmeister
Senior Member

United Kingdom
1141 Posts

Posted - 10 December 2010 :  07:16:14  Show Profile  Visit Jezmeister's Homepage  Reply with Quote
quote:
Originally posted by Classicmotorcycling

Change the line to read:


"<meta http-equiv=""Refresh"" content=""2; URL='login.asp'"">" & vbNewLine


That should fix it..


Two "s would cause it to read as the end of the content...erm... content... anyway the above will work :P

Edited by - Jezmeister on 10 December 2010 07:16:58
Go to Top of Page

thermal_seeker
Junior Member

United Kingdom
430 Posts

Posted - 10 December 2010 :  11:23:44  Show Profile  Reply with Quote
Thanks guys.

The first one brought up an error and I had to remove the ...
'	########## PayPal Mod End ##########
for the second one to work.

However there is still a problem. Upon login the date should be checked and if it is within the membership period everything should be normal. If the date has passed (membership has expired) it should refresh the page back to login.asp. It appears that a check on the date isnt being made and the page is just refreshing (ie default.asp) every 2 seconds.

Dave



No good at coding, but I can plough a field !!
Go to Top of Page

Carefree
Advanced Member

Philippines
4207 Posts

Posted - 10 December 2010 :  11:32:40  Show Profile  Reply with Quote
I fixed the routine for "inc_header.asp" above. Replace it and it'll be solved.
Go to Top of Page

thermal_seeker
Junior Member

United Kingdom
430 Posts

Posted - 10 December 2010 :  12:34:15  Show Profile  Reply with Quote
Thanks Carefree

No errors this time but the page still refreshes every 2 seconds (default.asp) and doesn't refresh to login.asp regardless of what date has been entered.

No good at coding, but I can plough a field !!
Go to Top of Page

Carefree
Advanced Member

Philippines
4207 Posts

Posted - 10 December 2010 :  13:37:07  Show Profile  Reply with Quote
I added four lines to be sure variables are deleted. I also changed the background color to match the page and extended the time displayed so the user can see why the redirect is happening.

Edited by - Carefree on 10 December 2010 13:49:23
Go to Top of Page

thermal_seeker
Junior Member

United Kingdom
430 Posts

Posted - 10 December 2010 :  14:19:58  Show Profile  Reply with Quote
it's looking good now Carefree.

I'll just have some dinner and have a thorough test.

One thing I did notice. Is it possible to have the date format changed from yyyy/mm/dd (in pop profile)to dd/mm/yyyy ??

Dave

No good at coding, but I can plough a field !!
Go to Top of Page

thermal_seeker
Junior Member

United Kingdom
430 Posts

Posted - 10 December 2010 :  16:50:23  Show Profile  Reply with Quote
I'm getting an error trying to enter the date in pop profile.

Microsoft OLE DB Provider for SQL Server error '80040e57'

Arithmetic overflow error converting expression to data type nvarchar.

/Forum/pop_profile.asp, line 1943

 strSql = strSql & ", M_ALLOWEMAIL = " & cLng(Request.Form("allowemail"))
end if
end if
strSql = strSql & " WHERE MEMBER_ID = " & cLng(Request.Form("MEMBER_ID"))

my_Conn.Execute(strSql),,adCmdText + adExecuteNoRecords
if ChkString(Request.Form("Level"),"") = "1" then
'## Forum_SQL - Remove the member from the moderator table
strSql = "DELETE FROM " & strTablePrefix & "MODERATOR "
strSql = strSql & " WHERE " & strTablePrefix & "MODERATOR.MEMBER_ID = " & cLng(Request.Form("MEMBER_ID"))


Dave

No good at coding, but I can plough a field !!
Go to Top of Page

Carefree
Advanced Member

Philippines
4207 Posts

Posted - 10 December 2010 :  16:59:49  Show Profile  Reply with Quote
quote:
Originally posted by thermal_seeker

it's looking good now Carefree.

I'll just have some dinner and have a thorough test.

One thing I did notice. Is it possible to have the date format changed from yyyy/mm/dd (in pop profile)to dd/mm/yyyy ??

Dave


Yes, it is possible. But no slashes should be included - just YYYYMMDD format. If you want to enter it as DD/MM/YYYY, I can write a routine to convert it.
Go to Top of Page

Carefree
Advanced Member

Philippines
4207 Posts

Posted - 10 December 2010 :  17:01:00  Show Profile  Reply with Quote
quote:
Originally posted by thermal_seeker

I'm getting an error trying to enter the date in pop profile.

Microsoft OLE DB Provider for SQL Server error '80040e57'

Arithmetic overflow error converting expression to data type nvarchar.

/Forum/pop_profile.asp, line 1943

 strSql = strSql & ", M_ALLOWEMAIL = " & cLng(Request.Form("allowemail"))
end if
end if
strSql = strSql & " WHERE MEMBER_ID = " & cLng(Request.Form("MEMBER_ID"))

my_Conn.Execute(strSql),,adCmdText + adExecuteNoRecords
if ChkString(Request.Form("Level"),"") = "1" then
'## Forum_SQL - Remove the member from the moderator table
strSql = "DELETE FROM " & strTablePrefix & "MODERATOR "
strSql = strSql & " WHERE " & strTablePrefix & "MODERATOR.MEMBER_ID = " & cLng(Request.Form("MEMBER_ID"))


Dave



I'm assuming you were still including slashes - which tells the computer to DIVIDE ....
Go to Top of Page

thermal_seeker
Junior Member

United Kingdom
430 Posts

Posted - 10 December 2010 :  17:20:38  Show Profile  Reply with Quote
Just tried without the slashes and still the same error :(

Dave

No good at coding, but I can plough a field !!
Go to Top of Page

thermal_seeker
Junior Member

United Kingdom
430 Posts

Posted - 10 December 2010 :  17:36:54  Show Profile  Reply with Quote
quote:
Originally posted by Carefree

quote:
Originally posted by thermal_seeker

it's looking good now Carefree.

I'll just have some dinner and have a thorough test.

One thing I did notice. Is it possible to have the date format changed from yyyy/mm/dd (in pop profile)to dd/mm/yyyy ??

Dave


Yes, it is possible. But no slashes should be included - just YYYYMMDD format. If you want to enter it as DD/MM/YYYY, I can write a routine to convert it.



Only if you have time. You have been extremely helpful and I really don't want to put you to any trouble.

Dave

No good at coding, but I can plough a field !!
Go to Top of Page
Page: of 3 Previous Topic Topic Next Topic  
Previous Page | Next Page
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.14 seconds. Powered By: Snitz Forums 2000 Version 3.4.07