Author |
Topic |
|
Webbo
Average Member
United Kingdom
982 Posts |
Posted - 25 October 2008 : 18:11:17
|
Having found this mod: http://forum.snitz.com/forum/topic.asp?ARCHIVE=true&TOPIC_ID=51932
I've tried implementing it into a test forum so that it shows 'Site Supporter' underneath a member's name if they are either Gold or Silver level, unfortunately it shows it regardless of what status the member is set at.
The changes I've made to a fresh install of Snitz are as follows:
quote:
In topic.asp:
Line 97:
Changed
--------------------------------------------------------------------------------
", M.M_TITLE, M.M_HOMEPAGE, M.MEMBER_ID, M.M_LEVEL, M.M_POSTS, M.M_COUNTRY" & _
--------------------------------------------------------------------------------
to this:
--------------------------------------------------------------------------------
", M.M_TITLE, M.M_HOMEPAGE, M.MEMBER_ID, M.M_LEVEL, M.M_POSTS, M.M_COUNTRY, M.M_SPONSORLEVEL" & _
--------------------------------------------------------------------------------
Line 160:
Added:
-------------------------------------------------------------------------
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
------------------------------------------------------------------------------------------
Found this around line 565:
--------------------------------------------------------------------------------
if strCountry = "1" and trim(Reply_MemberCountry) <> "" then
Response.Write " <font color=""" & strForumFontColor & """ face=""" & strDefaultFontFace & """ size=""" & strFooterFontSize & """><small>" & Reply_MemberCountry & "</small></font><br />" & vbNewLine
end if
--------------------------------------------------------------------------------
and added this immediately afterwards:
--------------------------------------------------------------------------------
if sLev > 0 then
Response.Write " <font color=""" & strForumFontColor & """ face=""" & strDefaultFontFace & """ size=""" & strFooterFontSize & """><small>Site Sponsor</small></font><br />" & vbNewLine
end if
--------------------------------------------------------------------------------
Found this around line 775:
--------------------------------------------------------------------------------
if strCountry = "1" and trim(Member_Country) <> "" then
Response.Write " <font color=""" & strForumFontColor & """ face=""" & strDefaultFontFace & """ size=""" & strFooterFontSize & """><small>" & Member_Country & "</small></font><br />" & vbNewLine
end if
--------------------------------------------------------------------------------
and added this immediately afterwards:
--------------------------------------------------------------------------------
if sLev > 0 then
Response.Write " <font color=""" & strForumFontColor & """ face=""" & strDefaultFontFace & """ size=""" & strFooterFontSize & """><small>Site Sponsor</small></font><br />" & vbNewLine
end if
--------------------------------------------------------------------------------
I've checked the database (MySql) and the sLev for four test members are set at 2, 1, 0, & 0 , and using the above I would have thought that 'Site Supporter' would have shown under just the first and second member's names, not all four.
Could someone please advise where I'm going wrong?
Thanks< |
|
balexandre
Junior Member
Denmark
418 Posts |
Posted - 25 October 2008 : 18:29:56
|
quote: the sLev for four test members are set at 2, 1, 0, & 0 , and using the above I would have thought that 'Site Supporter' would have shown under just the first and second member's names, not all four.
witch is correct...
only members 1 and 2 have respectively "2" and "1" values, and the code says:
is sLev > 0 then ...
so, only members that have the sLev variable above zero (and not included)
my question is: What do you want to accomplish?
quote: if they are either Gold or Silver level
for this you need to edit the code like:
if sLev = 2 then
' Member is Gold code
ifelse sLev = 1 then
' Member is Silver code
end if
instead of all codes that have
if sLev >= 0 then ...
< |
Bruno Alexandre (Strøby, DANMARK)
"a Portuguese in Danmark"
|
Edited by - balexandre on 25 October 2008 18:34:42 |
|
|
Webbo
Average Member
United Kingdom
982 Posts |
Posted - 25 October 2008 : 18:42:35
|
The problem I have is that all test members have 'Site Supporter' showing under their names and for some reason sLev > 0 is not filtering them out as I would have expected
Here's my test forum showing it in more detail: http://www.maggotdrowning.com/testforum/topic.asp?TOPIC_ID=3< |
|
|
Carefree
Advanced Member
Philippines
4207 Posts |
Posted - 26 October 2008 : 00:23:49
|
Did you Dim the value in "config.asp" and add the lines to "inc_header.asp"? If so, you didn't need to re-specify what the value was in "topic.asp" - you could eliminate the first two bits of code and it should still work. If not, you should dimension the value in "config.asp" and see if that solves your issue.
Also, since you've already called the value of m_sponsorlevel from the database, you don't have to use this whole bit:quote: 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
Instead, just after this line: Member_Level = rsTopic("M_LEVEL") Add this: sLev=rsTopic("M_SPONSORLEVEL") < |
Edited by - Carefree on 26 October 2008 00:43:44 |
|
|
Webbo
Average Member
United Kingdom
982 Posts |
Posted - 26 October 2008 : 04:05:56
|
Hi Carefree,
I've Dim'd the value in config.asp but without M.M_SPONSORLEVEL added in topic.asp (line 97) I get the following error message:
quote: ADODB.Recordset error '800a0cc1'
Item cannot be found in the collection corresponding to the requested name or ordinal.
/testforum/topic.asp, line 129
Which is refering to this line that I added as per your advice:
sLev=rsTopic("M_SPONSORLEVEL")
The forum still shows everyone as a site sponsor regardless of sponsor level< |
|
|
Webbo
Average Member
United Kingdom
982 Posts |
Posted - 26 October 2008 : 04:12:08
|
Okay, I've just had a play and if I set the topic starter as a 'Freerider' ie sponsor level 0 then all the other sponsor titles underneath the member names stop showing, therefore it looks like the sponsor level of the topic starter is determining wether or not 'Site Sponsor' shows underneath members who reply to the topic and not the individual member's sponsor level
(if you understand what Imean )< |
|
|
Webbo
Average Member
United Kingdom
982 Posts |
Posted - 26 October 2008 : 05:21:54
|
I've just played with it a bit further to try to show the actual sponsor level of the member under their membername and it now shows the sponsor level of the topic starter underneath the topic starter, but also the topic starter's sponsor level under the replying members
Here's a link to topic.txt if anyone can take a look, as I need to now put my head in a fridge lol: Please Click Here< |
|
|
modifichicci
Average Member
Italy
787 Posts |
|
Webbo
Average Member
United Kingdom
982 Posts |
Posted - 26 October 2008 : 12:21:18
|
Did that but for some strange reason it then showed the member's name instead of the sponsor level ???
Finally worked out how and why though as it needed line #292 changing to: strSql = strSql & ", R.R_LAST_EDITBY, R.R_SIG, R.R_STATUS, R.R_DATE, M.M_SPONSORLEVEL"
All works well now, thanks
....now on to the next stage lol< |
|
|
|
Topic |
|