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
 Moderators and Admin link in default.asp
 New Topic  Topic Locked
 Printer Friendly
Next Page
Author Previous Topic Topic Next Topic
Page: of 2

Andy Humm
Average Member

United Kingdom
908 Posts

Posted - 17 June 2009 :  05:24:30  Show Profile
Within the active users mod, when a moderator or admin is online their name is shown as a different font colour ie strAUModColor or strAUAdminColor.
I am trying to get the moderator links on the default.asp page to correspond with the same font colours.
Within inc_activeusers.asp line 73 there is this code:
if rsAM("M_LEVEL") = 2 then
strActiveMemberList = strActiveMemberList & "<font color=""" & strAUModColor & """>"
elseif rsAM("M_LEVEL") = 3 then
strActiveMemberList = strActiveMemberList & "<font color=""" & strAUAdminColor & """>"
end if


I believe the code in default.asp for the moderators listing is
Response.Write "<font face=""" & strDefaultFontFace & """ color=""" & strForumFontColor & """ size=""" & strFooterFontSize & """><span class=""spnMessageText"">" & listForumModerators(ForumID) & "</span></font></td>" & vbNewline

I tried to get the font face to the same set up as activeusers.asp but I am stuck (too many Ifs and Thens??. Any help would be greatly appreciated
rgds andy

Carefree
Advanced Member

Philippines
4207 Posts

Posted - 17 June 2009 :  13:58:40  Show Profile
Look at this function, Andy. The bit you want is in red.

Function listforumModerators(fforum_ID)
	fforumMods = split(strforumMods,"|")
	for iModerator = 0 to ubound(fforumMods)
		fforumMod = split(fforumMods(iModerator),",")
		ModforumID = fforumMod(0)
		ModMemID = fforumMod(1)
		ModMemName = fforumMod(2)
		if cLng(ModforumID) = cLng(fforum_ID) then
			if fMods = "" then
				fMods = "<nobr>" & profileLink(chkString(ModMemName,"display"),ModMemID) & "</nobr>"
			else
				fMods = fMods & ", <nobr>"
				if ModMemID=intAdminMemberID then
					fMods = fMods &	"<font color=""" & strAUAdminColor & """>"
				else
					fMods = fMods &	"<font color=""" & strAUModColor & """>"
				end if
				fMods = fMods & profileLink(chkString(ModMemName,"display"),ModMemID) & "</nobr>"
			end if
		end if
	next
	if fMods = "" then fMods = " "
	listforumModerators = fMods
end Function
Go to Top of Page

Andy Humm
Average Member

United Kingdom
908 Posts

Posted - 17 June 2009 :  17:21:15  Show Profile
Hi CF, thank you so far..
Given this function above, I am trying to see how to tie it into the code:
Response.Write "<font face=""" & strDefaultFontFace & """ color=""" & strForumFontColor & """ size=""" & strFooterFontSize & """><span class=""spnMessageText"">" & listForumModerators(ForumID) & "</span></font></td>" & vbNewline

Do I need to swap the color=""" & strForumFontColor & """ to see the function?
I tried to add the complete function to inc_func_common.asp - tilt!

Confused Dot com
rgds andy
Go to Top of Page

Carefree
Advanced Member

Philippines
4207 Posts

Posted - 18 June 2009 :  14:30:10  Show Profile
That function is within default.asp, Andy - at the very bottom. Just modify your function to incorporate the color changes.
Go to Top of Page

modifichicci
Average Member

Italy
787 Posts

Posted - 18 June 2009 :  17:14:01  Show Profile  Visit modifichicci's Homepage
the color is defined as link color in profilelink function, as it is a link it has the link color
you have to define a class for that link, including it in header, and calling it from the profile link function


Ernia e Laparocele
Forum di Ernia e Laparocele
Acces - MySql Migration Tutorial
Adamantine forum
Go to Top of Page

Andy Humm
Average Member

United Kingdom
908 Posts

Posted - 18 June 2009 :  17:26:49  Show Profile
CF- Spotted thanks and adjusted function to the code you have provided, but both the admin and moderators name/profile link remain in same colours as all the other links within the forum. See forum image

The active user moderator link is red, but moderators column the moderators have profile link colours the same as the rest of default.asp and rest of forum.
thanking you as always andy
Go to Top of Page

Andy Humm
Average Member

United Kingdom
908 Posts

Posted - 02 July 2009 :  06:03:59  Show Profile
I having great difficulty trying to make the profilelink function identify the different user names ie separate the administrators and moderators and ensure their links correspond with the active users settings and all the rest stay as normal.
function profileLink(fName, fID)
	if instr(fName,"img src=") > 0 then
		strExtraStuff = ""
	else
		strExtraStuff = " title=""View " & fName & "'s Profile""" & dWStatus("View " & fName & "'s Profile")
	end if
	if strUseExtendedProfile then
		strReturn = "<a href=""pop_profile.asp?mode=display&id=" & fID & """" & strExtraStuff & ">"
	else
		strReturn = "<a href=""JavaScript:openWindow3('pop_profile.asp?mode=display&id=" & fID & "')""" & strExtraStuff & ">"
	end if
	profileLink = strReturn & fName & "</a>"
end function


The active users uses this I think:
if rsAM("M_LEVEL") = 2 then
strActiveMemberList = strActiveMemberList & "<font color=""" & strAUModColor & """>"
elseif rsAM("M_LEVEL") = 3 then
strActiveMemberList = strActiveMemberList & "<font color=""" & strAUAdminColor & """>"
end if

Any guidance would be greatly appreciated if this can be done.
Go to Top of Page

Etymon
Advanced Member

United States
2385 Posts

Posted - 02 July 2009 :  06:53:10  Show Profile  Visit Etymon's Homepage
I am just pulling this from an old forum where I did this once before and have since not touched it for quite some time. It might just work as it is or it may have some of my own stuff in it.


function profileLink(fName, fID)
if instr(fName,"img src=") > 0 then
strExtraStuff = ""
else
strExtraStuff = " title=""View " & fName & "'s Profile""" & dWStatus("View " & fName & "'s Profile")
end if
if strUseExtendedProfile then
strReturn = "<b><a href=""pop_profile.asp?mode=display&id=" & fID & """" & strExtraStuff & ">"
else
strReturn = "<a href=""JavaScript:openWindow3('pop_profile.asp?mode=display&id=" & fID & "')""" & strExtraStuff & ">"
end if
if getMemberLevel(fname) = 3 then
profileLink = strReturn & "<font color=""" & strAUAdminColor & """>" & fName & "</font></a></b>"
elseif getMemberLevel(fname) = 2 then
profileLink = strReturn & "<font color=""" & strAUModColor & """>" & fName & "</font></a></b>"
elseif getMemberLevel(fname) = 1 then
profileLink = strReturn & "<font color=""" & strAUMemColor & """>" & fName & "</font></a></b>"
else
profileLink = strReturn & "<font color=""" & strForumFontColor & """>" & fName & "</a></b>"
end if
end function

Edited by - Etymon on 02 July 2009 06:55:16
Go to Top of Page

Andy Humm
Average Member

United Kingdom
908 Posts

Posted - 02 July 2009 :  12:50:30  Show Profile
thank you etymon for this function I have tried it and receive the following error:
Microsoft VBScript runtime error '800a000d'
Type mismatch: 'getMemberLevel'
/forum/inc_func_common.asp, line 1733


I am trying to find a way to get the Mlev (member level) incorporated to distinguish admininstrator/moderator and members
Go to Top of Page

Etymon
Advanced Member

United States
2385 Posts

Posted - 02 July 2009 :  17:07:48  Show Profile  Visit Etymon's Homepage
Ah, yes, I created a custom function. Place it in inc_function_common.asp above the ProfileLink function):



function getMemberLevel(fUser_Name)

dim strSql
dim rsgetMemberLevel

'## Forum_SQL'
strSql = "SELECT M_LEVEL "
strSql = strSql & " FROM " & strMemberTablePrefix & "MEMBERS "
strSql = strSql & " WHERE " & strDBNTSQLName & " = '" & ChkString(fUser_Name, "SQLString") & "'"

set rsgetMemberLevel = Server.CreateObject("ADODB.Recordset")
rsgetMemberLevel.open strSql, my_Conn

if rsgetMemberLevel.EOF then
getMemberLevel = 0
else
getMemberLevel = cInt(rsgetMemberLevel("M_LEVEL"))
end if

rsgetMemberLevel.close
set rsgetMemberLevel = nothing

end function

Edited by - Etymon on 02 July 2009 17:14:14
Go to Top of Page

Andy Humm
Average Member

United Kingdom
908 Posts

Posted - 03 July 2009 :  04:32:50  Show Profile
Thanks etymon, that is the business. I was looking at the additional need for the getMemberLevel but could get it to work..
Thanking you for the stirling support.
Andy
Go to Top of Page

Etymon
Advanced Member

United States
2385 Posts

Posted - 03 July 2009 :  05:27:28  Show Profile  Visit Etymon's Homepage
You are quite welcome, Andy!
Go to Top of Page

Andy Humm
Average Member

United Kingdom
908 Posts

Posted - 05 July 2009 :  17:11:37  Show Profile
Etymon, since I have updated the profilelink function, which is great, I have noticed a few other pages, probably incorporated with mods etc., the profile link colours are not activated to show the same.

If any one is interested to standardise the pages here are the minor changes necessary:

On the following pages, the text in italic is original coding and the line immediately below is new profilelink code

Searchlog.asp
Line 680
strSearcherName = "<a href=""searchlog.asp?display=searches&user=" & rsq("SLS_MEMBER") & """>" & getMemberName(CInt(rsq("SLS_MEMBER"))) & "</a>"


strSearcherName = "<a href=""searchlog.asp?display=searches&user=" & rsq("SLS_MEMBER") & """>" & profilelink(chkstring(getMemberName(CInt(rsq("SLS_MEMBER"))),"display"),rsq("SLS_MEMBER")) & "</a>"


Line 803
strSearcherName = "<a href=""searchlog.asp?display=searches&user=" & rsq("SLS_MEMBER") & """>" & getMemberName(CInt(rsq("SLS_MEMBER"))) & "</a>"


strSearcherName = "<a href=""searchlog.asp?display=searches&user=" & rsq("SLS_MEMBER") & """>" & profilelink(chkstring(getMemberName(CInt(rsq("SLS_MEMBER"))),"display"),rsq("SLS_MEMBER")) & "</a>"



members.asp
line 441
Response.Write Members_MemberName & "</a></span></font></td>" & vbNewLine & _


Response.Write profilelink(ChkString(Members_MemberName,"display"),Members_MemberID) & "</a></span></font></td>" & vbNewLine & _


privateread.asp
line 189
Response.Write " <p><font color=""" & strDefaultLinkColor & """ face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><b>" & strMName & "</a></b></font><br>" & vbNewLine


Response.Write " <p><font color=""" & strDefaultLinkColor & """ face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><b>" & profilelink(ChkString(strMName,"display"),strPMFromID) & "</a></b></font><br>" & vbNewLine



pm_view.asp
outbox line 330
Response.Write "<span class=""spnMessageText""><a href=""pop_profile.asp?mode=display&id=" & rsFMessage("M_TO") & """>" & strReadPMs & strTOMemberName & strReadPMe & "</a></span></font></td>"


Response.Write "<span class=""spnMessageText""><a href=""pop_profile.asp?mode=display&id=" & rsFMessage("M_TO") & """>" & strReadPMs & profilelink(chkstring(strTOMemberName,"display"),rsFMessage("M_TO")) & strReadPMe & "</a></span></font></td>"


inbox line 246
Response.Write "<span class=""spnMessageText""><a href=""pop_profile.asp?mode=display&id=" & rsMessage("M_FROM") & """>" & strNewPMs & strFromMemberName & strNewPMe & "</a></span></font></td>" & vbNewLine


Response.Write "<span class=""spnMessageText""><a href=""pop_profile.asp?mode=display&id=" & rsMessage("M_FROM") & """>" & strNewPMs & profilelink(chkstring(strFromMemberName,"display"),rsMessage("M_FROM")) & strNewPMe & "</a></span></font></td>" & vbNewLine


subscription_list.asp
line 269
Response.Write subMemberName & "</a>" & vbNewLine & _


Response.Write profilelink(chkstring(subMemberName,"display"),submemberID) & "</a>" & vbNewLine & _


Thanks etymon for your initial support.
Go to Top of Page

Etymon
Advanced Member

United States
2385 Posts

Posted - 05 July 2009 :  19:24:43  Show Profile  Visit Etymon's Homepage
I am happy that you are having fun with it, Andy. I suppose that I need to package this up as a MOD-Addon to Active Users.

Edited by - Etymon on 05 July 2009 19:25:05
Go to Top of Page

Andy Humm
Average Member

United Kingdom
908 Posts

Posted - 06 July 2009 :  05:41:37  Show Profile
Sounds good Etymon, its easier to share then.
Go to Top of Page

Carefree
Advanced Member

Philippines
4207 Posts

Posted - 06 July 2009 :  09:08:51  Show Profile
Should move the line in red up a line (before the "end if"), so that it won't try to close after an EOF.
quote:

function getMemberLevel(fUser_Name)
	dim strSql
	dim rsgetMemberLevel
	'## Forum_SQL'
	strSql = "SELECT M_LEVEL "
	strSql = strSql & " FROM " & strMemberTablePrefix & "MEMBERS "
	strSql = strSql & " WHERE " & strDBNTSQLName & " = '" & ChkString(fUser_Name, "SQLString") & "'"
	set rsgetMemberLevel = Server.CreateObject("ADODB.Recordset")
	rsgetMemberLevel.open strSql, my_Conn
	if rsgetMemberLevel.EOF then
		getMemberLevel = 0
	else
		getMemberLevel = cInt(rsgetMemberLevel("M_LEVEL"))
	end if
	rsgetMemberLevel.close
	set rsgetMemberLevel = nothing
end function

Go to Top of Page
Page: of 2 Previous Topic Topic Next Topic  
Next Page
 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.3 seconds. Powered By: Snitz Forums 2000 Version 3.4.07