We hope you enjoy your visit.

You're currently viewing our forum as a guest. This means you are limited to certain areas of the board and there are some features you can't use. If you join our community, you'll be able to access member-only sections, and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free.


Join our community!


If you're already a member please log in to your account to access all of our features:

Username:   Password:
Locked Topic
[ C ] Replacing Text with other Text
Topic Started: Dec 10 2012, 10:01 PM (548 Views)
-Neo Metallix-
Member Avatar
Metal Overlord
[ *  *  *  *  * ]
Board Address: Sonic Blast!
Board Software: ZetaBoards
Description: What I'm trying to do is have a code that is placed ONLY in one skin that replaces certain text to display another word but being ONLY in one skin. I want this skin to change the forum name and the only way to do that is through a code changing some text but I was not successful in trying to do that myself so I was hoping someone with Javascript knowledge would whip something up for me! :) Thanks!
Offline Profile Goto Top
 
Pete B
Member
[ *  *  *  *  *  *  *  * ]
This is easy, but what do you mean by the forum name? Just what appears in the navigation trail? For example, in bold:

ZetaBoards & InvisionFree » ZetaBoards Support & Resources » ZetaBoards Requests » Codes & Modifications » Replacing Text with other Text

That bit?
Offline Profile Goto Top
 
-Neo Metallix-
Member Avatar
Metal Overlord
[ *  *  *  *  * ]
Yes and any text that may be on the forum(forum name, description, etc) as well. On my forum it refers to it as Sonic Blast and =SB= for short and I am wanting to change anything like that to say Tails Blast for a specific skin I have.
Edited by -Neo Metallix-, Dec 11 2012, 08:24 PM.
Offline Profile Goto Top
 
SlyCooperFan1
Member Avatar
Coder
[ *  *  *  * ]
As I understand it, there is no efficient way to simply take the entire page, replace any instance of "Sonic Blast" with "Tails Blast," and spit the page back out. Especially every single time someone loads the page. But if we just dictate certain places where to replace the text, that'd make it a whole lot easier.

Below is a code you can use that will: change the name of the forum in the navigation system (as Pete showed two posts above this one), replace the title on the index of the forum, and replace "Sonic Blast" and "=SB=" with whatever you want in the forum descriptions and titles. This belongs in the Layout of the theme you want the code to apply to. Put it at the very, very bottom of the layout. You should not edit anything other than what is in between the quotation marks in the first four lines.
Code:
 
<script type="text/javascript">$(function(){
var newname="Tails Blast"; // Replaces Sonic Blast in forum names and descriptions
var newnick="=TB="; // Replaces =SB= in forum names and descriptions
var newtitle="=TB= Tails Blast Forum"; // Changes the title on the index
var newnav="Tails Blast"; // Changes the title in the navigation system
// DO NOT EDIT PAST THIS POINT
if(location.href.match('index')){ $("title").text(newtitle); }
$("#nav li:eq(1) a").text(newnav);
$(".c_forum:contains('Sonic Blast'),.category .cat_head:contains('Sonic Blast')").each(function(){
$(this).html($(this).html().replace(/Sonic Blast/g,"Tails Blast"));
});
$(".c_forum:contains('=SB='),.category .cat_head:contains('=SB=')").each(function(){
$(this).html($(this).html().replace(/=SB=/gi,"=TB="));
}); });
</script>

EDIT: Forgot the script tags. xD
Edited by SlyCooperFan1, Dec 11 2012, 11:38 PM.
Offline Profile Goto Top
 
-Neo Metallix-
Member Avatar
Metal Overlord
[ *  *  *  *  * ]
Wow, thank you! :)
Offline Profile Goto Top
 
SlyCooperFan1
Member Avatar
Coder
[ *  *  *  * ]
You're very welcome!
Offline Profile Goto Top
 
Eccentric Feline
Member Avatar
梦想
[ *  *  *  *  *  *  *  * ]
Completed!

Your request has been completed. If you have any questions or concerns regarding the state of your request, please feel free to contact me via PM.
Offline Profile Goto Top
 
1 user reading this topic (1 Guest and 0 Anonymous)
« Previous Topic · Closed Requests · Next Topic »
Locked Topic