Simple Machine Codes
April 17, 2024, 09:28:33 pm
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Welcome to SMC, the best place for your SMF For Free Codes
 
  Home Help Search Arcade Gallery Affiliates Code Index Staff List Calendar Members Login Register  

Topic Color V1

Pages: [1]   Go Down
  Print  
Author Topic: Topic Color V1  (Read 406 times)
0 Members and 1 Guest are viewing this topic.
Agent Moose
Administrator

Offline Offline

Gender: Male
Posts: 2,672



View Profile WWW
« on: July 03, 2007, 07:21:05 pm »

Footers
Code:
<script>
function topic_color() {
//Created by Agent Moose at smcodes.smfforfree3.com
$(function() {
var topiccolor = new Array()
topiccolor[0] = ["TYPE IN TOPIC","COLOR OF TOPIC"]

for(q=0;q<topiccolor.length;q++){
$("a").each(function() {
if(this.innerHTML.match(topiccolor[q][0])) {
this.innerHTML = this.innerHTML.replace(topiccolor[q][0],"<font color='"+topiccolor[q][1]+"'>");
};
if(this.innerHTML.match("[/topic]")) {
this.innerHTML = this.innerHTML.replace("[/topic]","</font>");
};});};});}
topic_color();
</script>

This code alowes you to add color to the topic titles.

TYPE IN TOPIC = Is what You will type in the topic for what color you want
COLOR OF TOPIC = Is what the color of the topic is when you do TYPE IN TOPIC PART.

Now, for an example.  If you have something like this:
Code:
topiccolor[1] = ["[topic=blue]","blue"]
When you type [topic=blue] into a topic title, it will turn blue.  you will need to put [/topic] at the end of the topic title though.

So for example..
[topic=blue]Hello is the Topic[/topic] will make the topic color blue if you have it set as that...

You can add more lines if you add more of these...
Code:
topiccolor[x] = ["TYPE IN TOPIC","COLOR OF TOPIC"]
Change the x to a 1 if ytou add one.  Then, if you add another line, it will be a 2 and so on.

Get it?  If you don't, then...I don't know, post in this topic?
=============================
EDIT:
Here is another version of the code.  You DO NOT have to add the [/topic] part in it.  But you still need to do everything else.
Code:
<script>
function topic_color() {
//Created by Agent Moose at smcodes.smfforfree3.com
$(function() {
var topiccolor = new Array()
topiccolor[0] = ["[topic=red]","red"]

for(q=0;q<topiccolor.length;q++){
$("a").each(function() {
if(this.innerHTML.match(topiccolor[q][0])) {
this.innerHTML = this.innerHTML.replace(topiccolor[q][0],"<font color='"+topiccolor[q][1]+"'>");
};});};});}
topic_color();
</script>
« Last Edit: August 17, 2007, 03:46:07 am by Agent Moose » Report Spam   Logged

Share on Facebook Share on Twitter

LaundryLady
Geriatric Goddess
Global Moderator

Offline Offline

Gender: Female
Posts: 290


I'm watching, I have a sense of humor: Guess Who


View Profile
« Reply #1 on: July 04, 2007, 07:55:02 am »

I will give this a try later this week.  Looks interesting.
Report Spam   Logged

deathwilldie
100 Club Member

Offline Offline

Posts: 214


View Profile WWW
« Reply #2 on: July 04, 2007, 01:43:00 pm »

This is an awesome code.
Report Spam   Logged

Agent Moose Jr.
Ultra Contagious
Global Moderator

Offline Offline

Gender: Male
Posts: 1,045



View Profile WWW
« Reply #3 on: January 04, 2008, 01:26:10 pm »

nice job
Report Spam   Logged

Newest:

Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by EzPortal
Bookmark this site! | Upgrade This Forum
SMF For Free - Create your own Forum

Powered by SMF | SMF © 2016, Simple Machines
Privacy Policy