Advertise Here

Author Topic: [Code] Automatic Color for Locked Topics  (Read 4623 times)

0 Members and 1 Guest are viewing this topic.

Offline Agent Moose

  • Moderator
  • *****
  • Posts: 836
  • Do not PM me for Code Support or Request
    • View Profile

  • Total Badges: 32
    Badges: (View All)
    Search Level 6 Tenth year Anniversary Nineth year Anniversary Eighth year Anniversary
[Code] Automatic Color for Locked Topics
« on: July 16, 2007, 08:22:47 pm »
Preview
http://mooseycodes.smfforfree3.com/index.php/board,2.0.html

Footers:
Code: [Select]
<script>
function lock_topic_color() {
//Created by Agent Moose (smcodes.smfforfree3.com)
var color = "COLOR HERE";
if(location.href.match(/board,(\d+)/i)){
var b = document.getElementsByTagName("td");
for(a=0;a<b.length;a++){
if(b[a].className == "windowbg3" && b[a].innerHTML.match("quick_lock.gif")){
var d = b[a].getElementsByTagName("A")[0]
d.innerHTML = "<font color='" + color + "'>" + d.innerHTML + "</font>";
};};};};
lock_topic_color();
</script>

If there is a Locked topic, the color of that link will automaticly turn the color you choose it to be.   All you have to do it change COLOR HERE to the color of your choice.
« Last Edit: May 02, 2008, 09:44:41 pm by Agent Moose »
Check out Revolution X's Brand new Code Index!

Offline Laugh-nd-kid

  • SMF For Free Master
  • *
  • Posts: 1409
  • Thankyou for this great software SMF For Free!
    • View Profile

  • Total Badges: 21
    Badges: (View All)
    Topic Starter Combination Level 4 Level 3 Level 2
Re: Automatic Color for Locked Topics
« Reply #1 on: July 17, 2007, 09:57:17 am »
Preview please :).

Offline hatred

  • SMF For Free Full Member
  • *
  • Posts: 112
    • View Profile

  • Total Badges: 13
    Badges: (View All)
    Topic Starter Combination Level 3 Level 2 Level 1
Re: Automatic Color for Locked Topics
« Reply #2 on: July 17, 2007, 01:05:26 pm »
I tried with and without the # sign and it didn't work.. Any suggestions?

Offline Agent Moose

  • Moderator
  • *****
  • Posts: 836
  • Do not PM me for Code Support or Request
    • View Profile

  • Total Badges: 32
    Badges: (View All)
    Search Level 6 Tenth year Anniversary Nineth year Anniversary Eighth year Anniversary
Re: Automatic Color for Locked Topics
« Reply #3 on: July 17, 2007, 05:40:20 pm »
Preview Added.
Check out Revolution X's Brand new Code Index!

Offline rileyks

  • SMF For Free Sponsors
  • *
  • Posts: 530
    • View Profile

  • Total Badges: 16
    Badges: (View All)
    Topic Starter Combination Level 3 Level 2 Level 1
Re: Automatic Color for Locked Topics
« Reply #4 on: July 17, 2007, 09:20:54 pm »
LOL...just how many codes can you put in Headers and Footers...I love so many of these!

OK...I tried it and it didn't work...what's your secret?  lol
« Last Edit: July 17, 2007, 09:25:41 pm by rileyks »

Offline Agent Moose

  • Moderator
  • *****
  • Posts: 836
  • Do not PM me for Code Support or Request
    • View Profile

  • Total Badges: 32
    Badges: (View All)
    Search Level 6 Tenth year Anniversary Nineth year Anniversary Eighth year Anniversary
Re: Automatic Color for Locked Topics
« Reply #5 on: July 17, 2007, 10:46:58 pm »
Hmmm...

Find this part in the code and change the 3 to a 1 or a 2, see if that works.

if(b[a].className == "windowbg3"
Check out Revolution X's Brand new Code Index!

Offline rileyks

  • SMF For Free Sponsors
  • *
  • Posts: 530
    • View Profile

  • Total Badges: 16
    Badges: (View All)
    Topic Starter Combination Level 3 Level 2 Level 1
Re: Automatic Color for Locked Topics
« Reply #6 on: July 17, 2007, 10:52:49 pm »
Hmmm...

Find this part in the code and change the 3 to a 1 or a 2, see if that works.

if(b[a].className == "windowbg3"

Nope...I am sorry Agent, still not working for me.

Offline Molly

  • SMF For Free Full Member
  • *
  • Posts: 157
    • View Profile
    • Oak Grove

  • Total Badges: 15
    Badges: (View All)
    Topic Starter Combination Level 3 Level 2 Level 1
Re: Automatic Color for Locked Topics
« Reply #7 on: July 17, 2007, 11:35:17 pm »
Yup, not workin for me either. Mine that are locked are stickied too and I unstickied them just to be sure but no go.

would be great if they are a dif color...they are the important ones LOL ;)

Edit: I have left it and been working on something else and have found as I have been clicking on those links when I do ALL my locked topics go that color that I designated in the script for a time then the thread loads that I clicked on...do not know if it is a just a bug in the script or not when you copied it? I write html not script so ...? If you could let us know would appreciate it. Thanks a bunch for all you have done. It is def makin it easier on me :)
« Last Edit: July 18, 2007, 12:29:00 am by Gwenllian »

Offline LaundryLady

  • Helpers
  • *
  • Posts: 3253
  • Internet Challenged
    • View Profile

  • Total Badges: 26
    Badges: (View All)
    Seventh year Anniversary Sixth year Anniversary Search Poll Voter Level 5
Re: Automatic Color for Locked Topics
« Reply #8 on: July 18, 2007, 05:59:57 am »
Forum Url: http://thebacklot.smfforfree3.com
Ok, the code does work on my test forum, the backlot.  My locked TOPIC TITLES are now purple.  It works with the color codes also.  This only changes the titles, not the background, if I am understanding Moose correctly. 

I would think that you need to make the color far different than anything else you have on your page.

http://thebacklot.smfforfree3.com/index.php/board,1.0.html



And I Play:  Mafia-Mandemz

Offline Molly

  • SMF For Free Full Member
  • *
  • Posts: 157
    • View Profile
    • Oak Grove

  • Total Badges: 15
    Badges: (View All)
    Topic Starter Combination Level 3 Level 2 Level 1
Re: Automatic Color for Locked Topics
« Reply #9 on: July 18, 2007, 06:39:22 am »
Ya ^^ mine works now, mine is set to red. I was adding another code in there and had the lines mixed unknowingly. What a nightmare LOL.

http://gwenllian.smfforfree2.com/index.php/board,40.0.html

Offline LaundryLady

  • Helpers
  • *
  • Posts: 3253
  • Internet Challenged
    • View Profile

  • Total Badges: 26
    Badges: (View All)
    Seventh year Anniversary Sixth year Anniversary Search Poll Voter Level 5
Re: Automatic Color for Locked Topics
« Reply #10 on: July 18, 2007, 07:53:27 am »
So glad you got it, Gwenllian.  It's really hard to tell sometimes if you have a lot of stuff going on just exactly what is wrong.  Personally, I drop the "<" a lot when I copy and paste.  I have named it LL's disease.


And I Play:  Mafia-Mandemz

Offline Agent Moose

  • Moderator
  • *****
  • Posts: 836
  • Do not PM me for Code Support or Request
    • View Profile

  • Total Badges: 32
    Badges: (View All)
    Search Level 6 Tenth year Anniversary Nineth year Anniversary Eighth year Anniversary
Re: Automatic Color for Locked Topics
« Reply #11 on: July 18, 2007, 10:24:14 am »
Well, I see everyone is getting the code.  Glad yall like it :)
Check out Revolution X's Brand new Code Index!

Offline rileyks

  • SMF For Free Sponsors
  • *
  • Posts: 530
    • View Profile

  • Total Badges: 16
    Badges: (View All)
    Topic Starter Combination Level 3 Level 2 Level 1
Re: Automatic Color for Locked Topics
« Reply #12 on: July 18, 2007, 10:40:43 am »
Well, I see everyone is getting the code.  Glad yall like it :)

LOL...I'm not....

Offline SbS

  • SMF For Free Member
  • *
  • Posts: 46
  • Agent Moose = My hero 4 his codes!
    • View Profile
    • runeblast

  • Total Badges: 13
    Badges: (View All)
    Topic Starter Combination Level 3 Level 2 Level 1
Re: Automatic Color for Locked Topics
« Reply #13 on: July 31, 2007, 10:56:45 am »
Thanks SOOO MUCH AGENT! I love ur codes, this 1 worked straightaway for me.

Offline rileyks

  • SMF For Free Sponsors
  • *
  • Posts: 530
    • View Profile

  • Total Badges: 16
    Badges: (View All)
    Topic Starter Combination Level 3 Level 2 Level 1
Re: Automatic Color for Locked Topics
« Reply #14 on: July 31, 2007, 03:50:45 pm »
Ok I am really bummed!  I still can't get this to work.  wah!

 

Related Topics

  Subject / Started by Replies Last post
3 Replies
1531 Views
Last post July 06, 2007, 03:37:45 pm
by Bullet_RHLI
3 Replies
1840 Views
Last post February 25, 2008, 05:00:00 pm
by atlantic reefer
1 Replies
776 Views
Last post February 07, 2009, 11:52:24 am
by simply sibyl
0 Replies
1800 Views
Last post May 03, 2009, 11:12:29 am
by Vitality
4 Replies
1487 Views
Last post January 12, 2012, 02:00:46 pm
by Octavia