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

 All Forums
 Help Groups for Snitz Forums 2000 Users
 Help: MOD Implementation
 MarcelG's Sponsoring Members Mod
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

Webbo
Average Member

United Kingdom
982 Posts

Posted - 26 January 2009 :  16:16:55  Show Profile  Visit Webbo's Homepage
I've been using this mod as part of my Site Supporter's Mod with no problems at all .... until recently

For some reason the filter: sLev = simply stopped working
I was using it as a filter to either show an advert or not, ie if sLev = 0 show the advert

It seemed to work well for nearly a week and then stopped and doesn't seem to be recognised any more

Now the daftest bit is, I haven't made any changes at all so there's nothing that I have done to stop it from working; plus when it was noticed on my main forum that it had stopped working, I checked on my test forum (seperate files and database) and likewise it too had stopped working

I've checked both databases to make sure that M_SPONSORLEVEL is set correctly ie showing 0, 1 or 2 and they are
The code is correct in the files - in fact as I've wrote it worked fine and the code has not been changed since it was working

I'm now starting to think that I'm going mad lol having spent four days trying to get to the bottom of this to no avail

...so HELP !! (please )

If anyone knows why the filter sLev = should suddenly for no explicable reason stop working I'd be grateful if you could tell me, or if not if you could help me solve this

Thanks<

MarcelG
Retired Support Moderator

Netherlands
2625 Posts

Posted - 27 January 2009 :  04:33:52  Show Profile  Visit MarcelG's Homepage
There is a function in inc_header.asp that retrieves the Slev value.
Can you put a response.write(Slev) after that query, to see which value it retrieves? Just for testing....<

portfolio - linkshrinker - oxle - twitter
Go to Top of Page

Webbo
Average Member

United Kingdom
982 Posts

Posted - 27 January 2009 :  08:34:26  Show Profile  Visit Webbo's Homepage
Hi Marcel, it comes back with the value 0 for test members with sponsor levels of 0, 1, 2

My function is written so:


'MarcelG's Sponsormod
   '## Forum_SQL
   strSql = "SELECT " & strMemberTablePrefix & "MEMBERS.M_SPONSORLEVEL"
   strSql = strSql & " FROM " & strMemberTablePrefix & "MEMBERS "
   strSql = strSql & " WHERE " & strDBNTSQLName & " = '" & ChkString(strDBNTUserName, "SQLString") & "'"
   strSql = strSql & " AND M_SPONSORDATE > '" & 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

'end of MarcelG's Sponsormod
else
MemberID = -1
mLev = 0
end if


And it is a MySql database if that makes a difference

Thanks


<
Go to Top of Page

Carefree
Advanced Member

Philippines
4207 Posts

Posted - 27 January 2009 :  10:31:08  Show Profile
Change that first line to say:
strSql = "SELECT M_SPONSORLEVEL"

<

Edited by - Carefree on 27 January 2009 16:04:06
Go to Top of Page

Webbo
Average Member

United Kingdom
982 Posts

Posted - 27 January 2009 :  15:13:23  Show Profile  Visit Webbo's Homepage
That causes a HTTP 500 error Carefree<
Go to Top of Page

Carefree
Advanced Member

Philippines
4207 Posts

Posted - 27 January 2009 :  16:04:50  Show Profile
Sorry, brainfart. Delete the members. from the field name.<

Edited by - Carefree on 27 January 2009 16:05:23
Go to Top of Page

Webbo
Average Member

United Kingdom
982 Posts

Posted - 27 January 2009 :  16:18:38  Show Profile  Visit Webbo's Homepage
Edit...

Done the above change, it's fixed the HTTP500 error but it hasn't made a difference to the problem<

Edited by - Webbo on 27 January 2009 16:20:33
Go to Top of Page

Carefree
Advanced Member

Philippines
4207 Posts

Posted - 27 January 2009 :  16:47:16  Show Profile
Try this:
	'	########## 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 ########
else
	MemberID = -1
	mLev = 0
end if
<

Edited by - Carefree on 27 January 2009 18:43:54
Go to Top of Page

Webbo
Average Member

United Kingdom
982 Posts

Posted - 27 January 2009 :  17:26:32  Show Profile  Visit Webbo's Homepage
Sorry for the delay getting back ..

Still doesn't work :(<
Go to Top of Page

Carefree
Advanced Member

Philippines
4207 Posts

Posted - 27 January 2009 :  17:59:37  Show Profile
About the only thing left that could cause a no-value would be expired dates of sponsorship. Did you verify the sponsorships are still valid? You could see if this is the cause by commenting out one line
'	strSql = strSql & " AND M_SPONSORDATE > '" & strForumTimeAdjust & "'"

<

Edited by - Carefree on 27 January 2009 18:01:00
Go to Top of Page

Webbo
Average Member

United Kingdom
982 Posts

Posted - 27 January 2009 :  18:06:37  Show Profile  Visit Webbo's Homepage
Hi Carefree - you're a star

The sponsorships were still valid so I couldn't see a problem with that line - however, commenting it out seems to have done the trick and sLev now seems to work as planned

I'll check the other functions to make sure nothing has been compromised, but they shouldn't have

Many thanks<
Go to Top of Page

Carefree
Advanced Member

Philippines
4207 Posts

Posted - 27 January 2009 :  18:42:50  Show Profile
Webbo, the comparison of dates is incorrect. Change
"strForumTimeAdjust" to "DatetoStr(strForumTimeAdjust)"


I found another flaw in the Sponsorship documentation. In "topic.asp", there are two comparisons for
			if sLev > 0 then
				if sLev = 1 then SponsorLevel = "<font color = ""#c6c3ba"">Silver Sponsor</font>"

Change the first to say:
			if (sLev > 0 and trim(Reply_MemberSponsorDate) > DateToStr(strForumTimeAdjust)) then
				if sLev = 1 then SponsorLevel = "<font color = ""#c6c3ba""><b>Silver Sponsor</b></font>"

Change the next to say:
		if (sLev > 0 and trim(Member_SponsorDate) > DateToStr(strForumTimeAdjust)) then
			if sLev = 1 then SponsorLevel = "<font color = ""#c6c3ba""><b>Silver Sponsor</b></font>"

At appx line 500, add
		rM_SPONSORDATE = 13
after
		rM_SPONSORLEVEL = 12

At appx line 288, add
, M.M_SPONSORDATE"
after
M.M_SPONSORLEVEL

At appx line 130, add
	Member_SponsorLevel = rsTopic("M_SPONSORDATE")
after
	Member_SponsorLevel = rsTopic("M_SPONSORLEVEL")

At appx line 97, add
, M.M_SPONSORDATE"
after
M.M_SPONSORLEVEL
<
Go to Top of Page

Webbo
Average Member

United Kingdom
982 Posts

Posted - 28 January 2009 :  04:12:55  Show Profile  Visit Webbo's Homepage
Hi Carefree

quote:
Webbo, the comparison of dates is incorrect. Change
"strForumTimeAdjust" to "DatetoStr(strForumTimeAdjust)"



That causes an Error 500

The other changes I've already implemented variations of as part of the 'Site Supporters' mod <
Go to Top of Page

Carefree
Advanced Member

Philippines
4207 Posts

Posted - 28 January 2009 :  07:57:23  Show Profile
In your browser options, turn off "Use Friendly Error Messages". Then you'll get a usable error report. Make sure you have included the ", M_SPONSORDATE" in the first line of the strSql.<

Edited by - Carefree on 28 January 2009 08:06:06
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.48 seconds. Powered By: Snitz Forums 2000 Version 3.4.07