The Forum has been Updated
The code has been upgraded to the latest .NET core version. Please check instructions in the Community Announcements about migrating your account.
Have searched in various different ways, didn't find what I was looking for
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
<
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
Changing nappies - no problem!
Breastfeeding - no problem!
Computer related stuff - HELP!!
Posted
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.<
Posted
Thanks for this, phy1729, I've passed the information to my other half and he's trying to sort it for me now
<
Posted
in inc_func_common.asp
Replace
With
In inc_header.asp
Replace
with<
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 functionWith
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 functionIn 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 & _This account was hacked into by Image, a very honest guy as you all can see! Stealing people's passwords is his pasttime. Beware of this, before you register at his forums!
Last edited by Chopper on 04 May 2008, 15:08
Posted
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.<
Posted
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
<
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
<
Posted
SQL could be shortened to<
Code:
strSql = "SELECT M_LEVEL "
strSql = strSql & "FROM " & strMemberTablePrefix & "MEMBERS "
strSql = strSql & "WHERE MEMBER_ID = " & fID
Last edited by phy1729 on 03 May 2008, 23:18
Posted
I tried it, it doesn't change the colors.Imean Chopper's version doesn't do anyting.<
Last edited by texanman on 03 May 2008, 23:39
Posted
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.<
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\-_
Posted
Posted download link in the w/code forum
<
_-/Cripto9t\-_
Posted
I just didn't experiment enough
.
This doesn't work
This does. As you can see, the anchor class has to follow the span class
this is what I was trying to use which doesn't work no matter where you place it.
and this works no matter where you place it
Think "cascade" and css isn't that frustrating
.<
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 & _
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 & _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 & _ _-/Cripto9t\-_
Last edited by cripto9t on 04 May 2008, 16:43
Email Member
Message Member
Post Moderation
FileUpload
If you're having problems uploading, try choosing a smaller image.
Preview post
Send Topic
Loading...