[ C ] Custom BBCode

Jul 16, 2012 #1

Board Address: Illuminati Society
Board Software: ZetaBoards
Description: A Custom BBCode

Our forum is primarily used as a Library and for gameplay on an online game called NationStates.
Recently I came cross another gameplay forum for NationStates that used two special BB tags.
Where you entered in either a players nation or a region from the Game, and it automatically
puts a link up, but hids all the URL to it. I have a picture of what I am talking about here:



Essentially, I would like to have these for my forum as well. Can they be created, and what would the coding be for it.

Any help would be greatly appreciated.
.



Illuminati Society: Library
Like
Dislike
Share
0 0 0

Jul 16, 2012 #2

Admin CP Themes Board Template Below the Board

Code: Select all

<script type="text/javascript">
$('#c_bbcode button:last').after(' <button type="submit" onclick="nation(); return false">Nation</button> <button type="submit" onclick="region(); return false">Region</button>');
function nation() {
    var nationTag = prompt("Nation name:", "");
    ZetaTag('nation', false, nationTag);
}
function region() {
    var regionTag = prompt("Region name:", "");
    ZetaTag('region', false, regionTag);
}
$('td.c_post, #topic_review td, div.search_results').each(function () {
    $(this).html($(this).html().replace(/\[nation=(.+?)\]\[\/nation\]/gi, '<a href="http://www.nationstates.net/nation=$1" target="_blank">$1</a>').replace(/\[region=(.+?)\]\[\/region\]/gi, '<a href="http://www.nationstates.net/region=$1" target="_blank">$1</a>'));
});
</script>
Like
Dislike
Share
0 0 0

Jul 16, 2012 #3

As you can see, its slightly different than what the other forum does, but close enough, Thank you.
^_^

Code: Select all

<script type='text/javascript' src='http://z1.ifrm.com/0/2/0/p401849/bbtags31_xanik.js'></script><script>ubb_tag("Nation","nation","<a href='http://www.nationstates.net/nation=<% INNER %>'><% INNER %></a>",0,"Links to a nation on NationStates"); ubb_tag("Region","region","<a href='http://www.nationstates.net/region=<% INNER %>'><% INNER %></a>",0,"Links to a region on NationStates");</script>
Well, after simplifying that code, A Lot, this is what I have. But thank you very much for your contribution, it would not have been able to be done otherwise.
.



Illuminati Society: Library
Like
Dislike
Share
0 0 0

Jul 20, 2012 #4

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.
Like
Dislike
Share
0 0 0