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

 All Forums
 Snitz Forums 2000 MOD-Group
 MOD Add-On Forum (W/O Code)
 Admin name different colour to other users?
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

CharlyMIS
Starting Member

Sweden
37 Posts

Posted - 01 May 2008 :  12:43:37  Show Profile  Reply with Quote
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 <

Changing nappies - no problem!
Breastfeeding - no problem!
Computer related stuff - HELP!!

phy1729
Average Member

USA
589 Posts

Posted - 01 May 2008 :  18:53:07  Show Profile  Reply with Quote
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.<
Go to Top of Page

CharlyMIS
Starting Member

Sweden
37 Posts

Posted - 02 May 2008 :  18:14:06  Show Profile  Reply with Quote
Thanks for this, phy1729, I've passed the information to my other half and he's trying to sort it for me now <
Go to Top of Page

Chopper
Starting Member

2 Posts

Posted - 03 May 2008 :  18:07:42  Show Profile  Reply with Quote
in inc_func_common.asp

Replace

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

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
		"<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
		"<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!

Edited by - Chopper on 04 May 2008 15:08:09
Go to Top of Page

Etymon
Advanced Member

United States
2385 Posts

Posted - 03 May 2008 :  21:54:01  Show Profile  Visit Etymon's Homepage  Reply with Quote
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.<
Go to Top of Page

Etymon
Advanced Member

United States
2385 Posts

Posted - 03 May 2008 :  22:20:35  Show Profile  Visit Etymon's Homepage  Reply with Quote
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

<
Go to Top of Page

phy1729
Average Member

USA
589 Posts

Posted - 03 May 2008 :  23:18:13  Show Profile  Reply with Quote
SQL could be shortened to

strSql = "SELECT M_LEVEL "
   strSql = strSql & "FROM " & strMemberTablePrefix & "MEMBERS "
   strSql = strSql & "WHERE MEMBER_ID = " & fID
<

Edited by - phy1729 on 03 May 2008 23:18:46
Go to Top of Page

texanman
Junior Member

United States
410 Posts

Posted - 03 May 2008 :  23:37:38  Show Profile  Reply with Quote
I tried it, it doesn't change the colors.Imean Chopper's version doesn't do anyting.<

Edited by - texanman on 03 May 2008 23:39:14
Go to Top of Page

cripto9t
Average Member

USA
881 Posts

Posted - 04 May 2008 :  10:03:46  Show Profile  Reply with Quote
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\-_
Go to Top of Page

cripto9t
Average Member

USA
881 Posts

Posted - 04 May 2008 :  13:08:52  Show Profile  Reply with Quote
Posted download link in the w/code forum
<

    _-/Cripto9t\-_
Go to Top of Page

cripto9t
Average Member

USA
881 Posts

Posted - 04 May 2008 :  16:40:21  Show Profile  Reply with Quote
I just didn't experiment enough .

This doesn't work
"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
		".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.
	        ".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
".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 .<

    _-/Cripto9t\-_

Edited by - cripto9t on 04 May 2008 16:43:15
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.22 seconds. Powered By: Snitz Forums 2000 Version 3.4.07