SMF For Free Support Forum
Signup For Free Forum
August 21, 2008, 07:38:25 pm *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Welcome to SMF For Free. The best free SMF Host
 
   Home   Help Search Arcade Gallery Login Register  

Pages: [1]
  Print  
Author Topic: [Code] Change Tab Text V2  (Read 901 times)
0 Members and 1 Guest are viewing this topic.
Agent Moose
Moderator
*****
Online Online

Posts: 612


Do not PM me for Code Support or Request


View Profile WWW
« on: July 27, 2007, 08:59:58 pm »

Add this to the top of your headers if you don't have it:
Code:
<script src="/jquery.js"></script>


Footers:
Code:
<script>
function change_tab_text() {
//Created by Agent Moose (smcodes.smfforfree3.com)
$(function() {
var tab = new Array()
tab[tab.length] = ["TAB TEXT","YOUR TEXT HERE"]

for(f=0;f<tab.length;f++){
$(".maintab_back a , .maintab_active_back a").each(function() {
if(this.innerHTML.match(tab[f][0])){this.innerHTML = this.innerHTML.replace(tab[f][0],tab[f][1]);};
});};});}
change_tab_text();
</script>

This changes the Tab Text to your own text.  Now, this code will change the tab text when your on that page, or not.

TAB TEXT = The text that you want to change
YOUR TEXT HERE = The text the tab will change too.

EDIT:
If you want to change more tab texts, add more of these lines:
tab[tab.length] = ["TAB TEXT","YOUR TEXT HERE"]
« Last Edit: May 02, 2008, 04:16:47 pm by simply sibyl » Logged


SMC Code Index V3 - The best Code Index for all your Needs!  Includes a bunch of codes not on Support.
LaundryLady
Global Moderator
*
Offline Offline

Posts: 2959


Keep Smiling, Let'em Wonder!


View Profile WWW
« Reply #1 on: July 28, 2007, 07:41:57 am »

Sweet, I tried it on my test site and it worked smoothly.  If I add more of these
Code:
tab[tab.length] = ["TAB TEXT","YOUR TEXT HERE"]
, can I  change more tabs?
« Last Edit: July 28, 2007, 07:44:48 am by LaundryLady » Logged

Agent Moose
Moderator
*****
Online Online

Posts: 612


Do not PM me for Code Support or Request


View Profile WWW
« Reply #2 on: July 28, 2007, 10:57:35 am »

Yep, I forgot to add that in the first post.
Logged


SMC Code Index V3 - The best Code Index for all your Needs!  Includes a bunch of codes not on Support.
Alex
SMF For Free Full Member
*
Offline Offline

Posts: 116


View Profile
« Reply #3 on: September 14, 2007, 08:43:51 pm »

Great code but when you rename it can you also change the link?
Logged

sig coming soon!
Agent Moose
Moderator
*****
Online Online

Posts: 612


Do not PM me for Code Support or Request


View Profile WWW
« Reply #4 on: September 15, 2007, 08:52:18 am »

You can just use my Add Tabs Code.
Logged


SMC Code Index V3 - The best Code Index for all your Needs!  Includes a bunch of codes not on Support.
Tash
SMF For Free Full Member
*
Offline Offline

Posts: 157



View Profile
« Reply #5 on: November 25, 2007, 04:24:16 pm »

Forum Url: http://coffeechat.smfforfree3.com
Hi, Agent.  Will this work for smfforfree3.com sites?Huh?


Add this to your headers if you don't have it:
Code:
<script src="http://YOUR_FORUM.smfforfreeX.com/jquery.js"></script>
Just change YOUR_FORUM to your forum name, and the X to your server.  Rembmer, if you have a server one, there will not be a number.

Footers:
Code:
<script>
function change_tab_text() {
//Created by Agent Moose (smcodes.smfforfree3.com)
$(function() {
var tab = new Array()
tab[tab.length] = ["TAB TEXT","YOUR TEXT HERE"]

for(f=0;f<tab.length;f++){
$(".maintab_back a , .maintab_active_back a").each(function() {
if(this.innerHTML.match(tab[f][0])){this.innerHTML = this.innerHTML.replace(tab[f][0],tab[f][1]);};
});};});}
change_tab_text();
</script>

This changes the Tab Text to your own text.  Now, this code will change the tab text when your on that page, or not.

TAB TEXT = The text that you want to change
YOUR TEXT HERE = The text the tab will change too.

EDIT:
If you want to change more tab texts, add more of these lines:
tab[tab.length] = ["TAB TEXT","YOUR TEXT HERE"]
Logged
LaundryLady
Global Moderator
*
Offline Offline

Posts: 2959


Keep Smiling, Let'em Wonder!


View Profile WWW
« Reply #6 on: November 25, 2007, 04:54:18 pm »

Tash I can tell you that it does work on Servers 2 and 3.  Have it on my main site and my test one.
Logged

Coreeeey
SMF For Free Sr. Member
*
Offline Offline

Posts: 311



View Profile WWW
« Reply #7 on: November 25, 2007, 07:28:37 pm »

I LOVE THIS CODE! THANKS MOOSE  Smiley
Logged



Pages: [1]
  Print  
 
Jump to:  

Powered by SMF 1.1.5 | SMF © 2006-2008, Simple Machines LLC
ServerBeach Coupon
Page created in 0.208 seconds with 16 queries.