Admin name different colour to other users?

Snitz™ Forums 2000
https://forum.snitz.com/forumTopic/Posts/66977?pagenum=1
05 November 2025, 14:45

Topic


CharlyMIS
Admin name different colour to other users?
01 May 2008, 12:43


Have searched in various different ways, didn't find what I was looking for shy
I was wondering if anyone has tried this... I'd like my username on my forum to be a different colour to the usernames of other members. I've got the Active Users mod installed and I'm a different colour there, but I'd like to carry this over and be a different colour in the main forum as well.
For example, here on Snitz, all the usernames show up as dark blue on the left hand side of the posts, and normal blue in the 'Author' field when looking at a certain forum. I'd like to be able to change that to a different colour for Admin on my forum.
Is it possible, and how difficult is it, and what do I need to do?
I'm using the latest version, 3.4.06. Thanks in advance for any help - if I've missed out anything you need to know, please ask kisses<

 

Replies ...


phy1729
01 May 2008, 18:53


It's possible and shouldn't be too difficult because most of the code is already written for you in the Actives Users mod. You'll need to find the code that does the color swap in the Active Users mod and copy it over making sure the variables match and the alternate color is defined.<
CharlyMIS
02 May 2008, 18:14


Thanks for this, phy1729, I've passed the information to my other half and he's trying to sort it for me now smile<
Chopper
03 May 2008, 18:07


in inc_func_common.asp
Replace
Code:
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

With
Code:
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

'## Forum SQL - Get user status
strSql = "SELECT M_LEVEL "
strSql = strSql & "FROM " & strMemberTablePrefix & "MEMBERS "
strSql = strSql & "WHERE MEMBER_ID = " & fID & " "
strSql = strSql & "AND M_NAME = '" & fName & "' "
strSql = strSql & "AND M_STATUS = " & 1

Set rsLink2 = my_Conn.Execute(strSql)

if rsLink2.EOF or rsLink2.BOF then
LinkLevelStyle = ""
else
if fID = intAdminMemberID then
LinkLevelStyle = "class=""strAdminStyle2"""
elseif rsLink2("M_LEVEL") = 3 then
LinkLevelStyle = "class=""strAdminStyle2"""
elseif rsLink2("M_LEVEL") = 2 then
LinkLevelStyle = "class=""strModoStyle2"""
else
LinkLevelStyle = ""
end if
end if

rsLink2.Close
Set rsLink2 = nothing

if strUseExtendedProfile then
strReturn = "<a " & LinkLevelStyle & " href=""pop_profile.asp?mode=display&id=" & fID & """" & strExtraStuff & ">"
else
strReturn = "<a " & LinkLevelStyle & " href=""JavaScript:openWindow3('pop_profile.asp?mode=display&id=" & fID & "')""" & strExtraStuff & ">"
end if
profileLink = strReturn & fName & "</a>"
end function


In inc_header.asp
Replace
Code:
		"<style type=""text/css"">" & vbNewLine & _
"<!--" & vbNewLine & _
"a:link {color:" & strLinkColor & ";text-decoration:" & strLinkTextDecoration & "}" & vbNewLine & _
"a:visited {color:" & strVisitedLinkColor & ";text-decoration:" & strVisitedTextDecoration & "}" & vbNewLine & _
"a:hover {color:" & strHoverFontColor & ";text-decoration:" & strHoverTextDecoration & "}" & vbNewLine & _
"a:active {color:" & strActiveLinkColor & ";text-decoration:" & strActiveTextDecoration & "}" & vbNewLine & _
".spnMessageText a:link {color:" & strForumLinkColor & ";text-decoration:" & strForumLinkTextDecoration & "}" & vbNewLine & _
".spnMessageText a:visited {color:" & strForumVisitedLinkColor & ";text-decoration:" & strForumVisitedTextDecoration & "}" & vbNewLine & _
".spnMessageText a:hover {color:" & strForumHoverFontColor & ";text-decoration:" & strForumHoverTextDecoration & "}" & vbNewLine & _
".spnMessageText a:active {color:" & strForumActiveLinkColor & ";text-decoration:" & strForumActiveTextDecoration & "}" & vbNewLine & _
".spnSearchHighlight {background-color:" & strSearchHiLiteColor & "}" & vbNewLine & _
"input.radio {background:" & strPopUpTableColor & ";color:#000000}" & vbNewLine & _
"-->" & vbNewLine & _
"</style>" & vbNewLine & _

with
Code:
		"<style type=""text/css"">" & vbNewLine & _
"<!--" & vbNewLine & _
"a:link {color:" & strLinkColor & ";text-decoration:" & strLinkTextDecoration & "}" & vbNewLine & _
"a:visited {color:" & strVisitedLinkColor & ";text-decoration:" & strVisitedTextDecoration & "}" & vbNewLine & _
"a:hover {color:" & strHoverFontColor & ";text-decoration:" & strHoverTextDecoration & "}" & vbNewLine & _
"a:active {color:" & strActiveLinkColor & ";text-decoration:" & strActiveTextDecoration & "}" & vbNewLine & _
".spnMessageText a:link {color:" & strForumLinkColor & ";text-decoration:" & strForumLinkTextDecoration & "}" & vbNewLine & _
".spnMessageText a:visited {color:" & strForumVisitedLinkColor & ";text-decoration:" & strForumVisitedTextDecoration & "}" & vbNewLine & _
".spnMessageText a:hover {color:" & strForumHoverFontColor & ";text-decoration:" & strForumHoverTextDecoration & "}" & vbNewLine & _
".spnMessageText a:active {color:" & strForumActiveLinkColor & ";text-decoration:" & strForumActiveTextDecoration & "}" & vbNewLine & _
".spnSearchHighlight {background-color:" & strSearchHiLiteColor & "}" & vbNewLine & _
"input.radio {background:" & strPopUpTableColor & ";color:#000000}" & vbNewLine & _
"a.stradminstyle2:link {color:" & strAUAdminColor & ";background-color:transparent;text-decoration:none}" & vbNewLine & _
"a.stradminstyle2:visited {color:" & strAUAdminColor & ";background-color:transparent;text-decoration:none;}" & vbNewLine & _
"a.stradminstyle2:hover {color:" & strAUAdminColor & ";background-color:transparent;text-decoration:none}" & vbNewLine & _
"a.stradminstyle2:active {color:" & strAUAdminColor & ";background-color:transparent;text-decoration:none;}" & vbNewLine & _
"a.strmodostyle2:link {color:" & strAUModColor & ";background-color:transparent;text-decoration:none}" & vbNewLine & _
"a.strmodostyle2:visited {color:" & strAUModColor & ";background-color:transparent;text-decoration:none;}" & vbNewLine & _
"a.strmodostyle2:hover {color:" & strAUModColor & ";background-color:transparent;text-decoration:none}" & vbNewLine & _
"a.strmodostyle2:active {color:" & strAUModColor & ";background-color:transparent;text-decoration:none;}" & vbNewLine & _
"-->" & vbNewLine & _
"</style>" & vbNewLine & _
<
Etymon
03 May 2008, 21:54


The above will work. I have done something similar for my wife's site. I applied the same for a larger site, and it took a performance hit. You may want to keep track of your access times (in the footer [if you have the time activated]). Keep track of when you first installed the code and then monitor it as your site grows. The above code is a little different than mine, so I am sure it may bring different results for you.<
Etymon
03 May 2008, 22:20


Also, if you create a variable instead of using the record set rsLink2("M_LEVEL"), that will help you some. Something like will work:

Dim AdminColor
AdminColor = rsLink2("M_LEVEL")

if fID = intAdminMemberID then
LinkLevelStyle = "class=""strAdminStyle2"""
elseif AdminColor = 3 then
LinkLevelStyle = "class=""strAdminStyle2"""
elseif AdminColor = 2 then
LinkLevelStyle = "class=""strModoStyle2"""
else
LinkLevelStyle = ""
end if

<
phy1729
03 May 2008, 23:18


SQL could be shortened to
Code:

strSql = "SELECT M_LEVEL "
strSql = strSql & "FROM " & strMemberTablePrefix & "MEMBERS "
strSql = strSql & "WHERE MEMBER_ID = " & fID
<
texanman
03 May 2008, 23:37


I tried it, it doesn't change the colors.Imean Chopper's version doesn't do anyting.<
cripto9t
04 May 2008, 10:03


I tried something similar to what chopper posted and it wouldn't work. The anchor class wouldn't trump the span class. testing with ie6 and firefox2?.
So I went a different route and wrote a little function to get the class in the span tag based on M_Level. Its a little more db friendly also.
So far I've just made the changes to default.asp.
I'll post something a little later when I have more.<
cripto9t
04 May 2008, 13:08


Posted download link in the w/code forum <
cripto9t
04 May 2008, 16:40


I just didn't experiment enough smile.
This doesn't work
Code:
                "a.admin:link {color:red;}" & vbNewLine & _
"a.admin:visited {color:red;}" & vbNewLine & _
"a.admin:hover {color:red;}" & vbNewLine & _
"a.admin:active {color:red;}" & vbNewLine & _
".spnMessageText a:link {color:" & strForumLinkColor & ";text-decoration:" & strForumLinkTextDecoration & "}" & vbNewLine & _
".spnMessageText a:visited {color:" & strForumVisitedLinkColor & ";text-decoration:" & strForumVisitedTextDecoration & "}" & vbNewLine & _
".spnMessageText a:hover {color:" & strForumHoverFontColor & ";text-decoration:" & strForumHoverTextDecoration & "}" & vbNewLine & _
".spnMessageText a:active {color:" & strForumActiveLinkColor & ";text-decoration:" & strForumActiveTextDecoration & "}" & vbNewLine & _
".spnSearchHighlight {background-color:" & strSearchHiLiteColor & "}" & vbNewLine & _
This does. As you can see, the anchor class has to follow the span class
Code:
		".spnMessageText a:link    {color:" & strForumLinkColor & ";text-decoration:" & strForumLinkTextDecoration & "}" & vbNewLine & _
".spnMessageText a:visited {color:" & strForumVisitedLinkColor & ";text-decoration:" & strForumVisitedTextDecoration & "}" & vbNewLine & _
".spnMessageText a:hover {color:" & strForumHoverFontColor & ";text-decoration:" & strForumHoverTextDecoration & "}" & vbNewLine & _
".spnMessageText a:active {color:" & strForumActiveLinkColor & ";text-decoration:" & strForumActiveTextDecoration & "}" & vbNewLine & _

"a.admin:link {color:red;}" & vbNewLine & _
"a.admin:visited {color:red;}" & vbNewLine & _
"a.admin:hover {color:red;}" & vbNewLine & _
"a.admin:active {color:red;}" & vbNewLine & _

this is what I was trying to use which doesn't work no matter where you place it.
Code:
 	        ".admin a:link    {color:red;}" & vbNewLine & _
".admin a:visited {color:red;}" & vbNewLine & _
".admin a:hover {color:red;}" & vbNewLine & _
".admin a:active {color:red;}" & vbNewLine & _
and this works no matter where you place it
Code:
                ".spnMessageText a:link.admin1 {color:red;}" & vbNewLine & _
".spnMessageText a:visited.admin1 {color:red;}" & vbNewLine & _
".spnMessageText a:hover.admin1 {color:red;}" & vbNewLine & _
".spnMessageText a:active.admin1 {color:red;}" & vbNewLine & _
Think "cascade" and css isn't that frustrating smile.<
© 2000-2021 Snitz™ Communications