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:
Add Reply
Best BB Tag Code EVER v2 [IF]; Most customisable, can do ANYTHING!; By Xanikseo
Topic Started: Jan 23 2010, 01:07 AM (462 Views)
Reid
Member Avatar
È una trappola!

This topic has been moved from our official support board.

Originally posted by: Xanikseo
Best BB Tag Code EVER v2 [IF
 
; Most customisable, can do ANYTHING!]After two years, it's back! For ZetaBoards version click here.
Mod name: Best BB Tag Code EVER v2 (BBBTCE)
Preview: http://z3.invisionfree.com/xaniktest5/index.php?showtopic=31
Features: Create/Add any BB code you want to your board, whether it be like [this], [this][/this] or [this=something]something else[/this] or even [this=something1,something2,something3...etc]something else[/this]. Normal IF style buttons added to forum posting page for easy insertion to post, even with capability of step-by-step explanation to a newbie how each BB code is used. Some pre-made BB Codes can be used as well (below).
New in v2:
  • Faster, particularly in Opera and FireFox.
  • BB Codes work in signatures and polls.
  • You can disable certain BB codes in the signatures and/or polls.
  • Can disable buttons to be shown on the posting page
  • Buttons added to signature editing page (as long as the certain BB Code is allowed in signatures)
  • Can change the name of the button on the posting page
  • Backwards compatible with v1 BB codes (can still make use of new features e.g. whether the code is allowed in signature, but executes slightly slower (still faster than before) and takes up more space in the footer)
Installation: (3 Steps)

1. Put this in the top of the footer:
Code:
 
<script src='http://i1.ifrm.com/6877/58/upload/p6695766.ibf'></script><script>

2. Choose one or more BB tags to have on your forum, and insert it/them into the footer, just under the code mentioned above (don't forget step 3 afterwards):


  • Hidden message - reply to see - Specific discussion thread
  • Embed YouTube videos - (Needs only YouTube page URL, not video URL)
  • Media Embed - Embed media (e.g. music, videos, flash etc)
  • You (display member logged in name in post)
  • Marquee - Make text scroll across the page
  • Rainbow flash - Make text glow the colour of the rainbow
  • Highlight text - Highlight text in any colour you want
  • Reverse text - Writes the text you specify backwards (e.g. "Hello" becomes "elloH")
  • Alpha2Num (turns letters into numbers - A=1,B=2 etc, "Hello" would be "8 5 11 11 14")
  • Google - Create a link pointing to a Google search you specify
  • Yahoo - Create a link pointing to a Yahoo search you specify
  • Note - Put a note in your message that only you can post
  • Offtopic - Declare something as offtopic
  • Spoiler 1 - Hide text
  • Spoiler 2 - A bit more stable than Spoiler 1
  • Symbol - Embed a symbol into your post (e.g. "0222" = "Þ")
  • SuperScript (adds button)
  • SubScript (adds button)
  • Strikeout (adds button)
  • Align (adds button)
  • HR - Horizontal line across page (adds button)
  • Glow - Make text glow any colour you want (only works in IE)
  • Wave - make text wave (only works in IE)
  • X-Ray (only works in IE)
  • Transparency - makes text transparent (only works in IE)
  • Shadow - Give text a coloured shadow (any colour you want) (only works in IE)
  • Blur - Blur text (only works in IE)
Hidden message - Reply to see Hides a message from any user who has not posted in the topic in which this BB Code is used. Disabled in signatures.
Code:
 
ubb_tag("Reply to see","reply","<span id='reply_to_see_section'><span><font color='red'>HIDDEN MESSAGE! REPLY TO SEE!</font></span><span style='display: none;'>Hidden message:<br /><% INNER %></span></span>",0,"Hide a message until user replies||Enter message to hide",2,1,"Reply");</script><script src='http://i1.ifrm.com/6877/58/upload/p3104418.ibf'></script><script>


Embed YouTube videos (Needs YouTube page URL, not video URL). Disabled in signatures.
Code:
 
ubb_tag("YouTube","utube","<span id='embed_ut_video'><% INNER %></span>",0,"Embeds a YouTube video into the post||Enter YouTube video page URL",2);
var x = document.getElementsByTagName('span');
for(i=0;i<x.length;i++) {
if(x[i].id == 'embed_ut_video') {
var v_id = x[i].innerHTML.split(/\?v=/)[1];
x[i].innerHTML = '<object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/'+v_id+'"></param><param name="allowFullScreen" value="true"></param><embed src="http://www.youtube.com/v/'+v_id+'" type="application/x-shockwave-flash" allowfullscreen="true" width="425" height="344"></embed></object>';
}
}


Media Embed - Embed media (e.g. music, videos, flash etc). Disabled in signatures and polls.
Code:
 
ubb_tag('Media','emb','<EMBED SRC="<% INNER %>" HEIGHT=<% VAR[2] %> WIDTH=<% VAR %>>',2,'Embed a media file into the post||Source of the media file||Width of the media file||Height of the media file',0);


You (display member logged in name in post)
Code:
 
function getMember() {
var x = document.getElementById('userlinks');
if(x.innerHTML.match('Logged')) {
return x.getElementsByTagName('a')[0].innerHTML;
} else {
return 'Guest';
}
}

ubb_tag("You","you",getMember(),-1,"Display member logged in");


Marquee - Make text scroll across the page
Code:
 
ubb_tag("Marquee","marq","<marquee direction=<% VAR %>><% INNER %></marquee>",1,"Make text scroll (move)||Enter the text you want to move across the page||Enter the direction you want the text to move");


Rainbow flash - Make text glow the colour of the rainbow
Code:
 
var rainbow_colors = new Array('Red','Orange','Yellow','Green','Blue','Indigo','Violet','Indigo','Blue','Green','Yellow','Orange');

function change_rainbow_color() {
var x = document.getElementsByTagName('span');
for(i=0;i<x.length;i++) {
if(x[i].className == 'rainbow_text') {
if(x[i].id==11) {
x[i].style.color = 'red';
x[i].id = "-1";
}
x[i].style.color = rainbow_colors[parseInt(x[i].id)+1];
x[i].id = parseInt(x[i].id)+1;
}
}
setTimeout("change_rainbow_color()",100);
}

change_rainbow_color();
ubb_tag("Rainbow","rainbow","<span id='-1' class='rainbow_text'><% INNER %></span>",0,"Make text blink the colors of the rainbow||Enter the text you want to flash the colors of the rainbow");


Highlight text - Highlight text in any colour you want.
Code:
 
ubb_tag("Highlight","hl","<span style='background-color:<% VAR %>;'><% INNER %></span>",1,"Highlight text a certain color||Enter the text to be highlighted||Enter the color of the highlight");


Reverse text - Writes the text you specify backwards (e.g. "Hello" becomes "elloH".
Code:
 
ubb_tag("Reverse Text","revt","<span id='reverse_text'><% INNER %></span>",0,"Reverse text||Enter the text to be Reversed");
var x = document.getElementsByTagName('span');
for(a=0;a<x.length;a++) {
if(x[a].id == 'reverse_text') {
var return_str = '';
var text = x[a].innerHTML
for (i = 0; i <= text.length; i++) {
return_str = text.substring(i, i+1) + return_str;
}
x[a].innerHTML = return_str;
}
}


Alpha2Num (turns letters into numbers - A=1,B=2 etc, Hello would be "8 5 11 11 14".
Code:
 
ubb_tag("Alpha2Num","alph2num","<span id='alpha_2_num'><% INNER %></span>",0,"Change letters to numbers||Enter the text to be changed to numbers");
var alpha_bet = 'a,b,c,d,e,f,g,h,i,j,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z';
alpha_bet = alpha_bet.split(',');
var x = document.getElementsByTagName('span');
for(i=0;i<x.length;i++) {
if(x[i].id == 'alpha_2_num') {
var text = x[i].innerHTML;
text = text.toLowerCase();
for(a=0;a<alpha_bet.length;a++) {
text = while_replace(text,alpha_bet[a],a+1 + ' ');
}
x[i].innerHTML = text;
}
}


Google - Create a link pointing to a Google search you specify
Code:
 
ubb_tag("Google","google","<a href='http://www.google.com/search?q=<% INNER %>' target='_blank'>\"<% INNER %>\" on Google</a>",0,"A link to Google search||Write Google search");


Yahoo - Create a link pointing to a Yahoo search you specify
Code:
 
ubb_tag("Yahoo","yahoo","<a href='http://search.yahoo.com/search?ei=UTF-8&fr=sfp&p=<% INNER %>' target='blank'>\"<% INNER %>\" on Yahoo</a>",0,"A link to Yahoo search||Write Yahoo search");


Note - Put a note in your message that only you can post.
Code:
 
ubb_tag("Note","note","<!-- <% INNER %> -->",0,"Add notes to post (only seen when editing)||Type in the notes you want to add to your post");


Offtopic - Declare something as offtopic
Code:
 
ubb_tag("Off Topic","offtopic","<i><b><font color='#114499'>Offtopic:</font></b> <font color='#2277DD'><% INNER %></font></i>",0,"Mark text as off topic||Type in the text you want to be marked as off topic");


Spoiler 1 - Hide text
Code:
 
ubb_tag("Spoiler","spoil","<div><a href='javascript:;' onclick='this.parentNode.getElementsByTagName(\"div\")[0].style.display=\"\";'>[spoiler]</a><div id='QUOTE' style='display:none;'><a onclick='this.parentNode.style.display=\"none\";' style='float: right;'>Hide Spoiler</a><% INNER %></div></div>",0,"Hide some text||Type the text you want to be hidden");


Spoiler 2 - A bit more stable than Spoiler 1
Code:
 
ubb_tag("Spoiler","spoiler","<div id='QUOTE'><a href='javascript:;' onclick='this.parentNode.getElementsByTagName(\"div\")[0].style.display=\"\";'><b><center><% VAR %></center></b></a><div style='display:none;'><hr><% INNER %><a href='javascript:;' onclick='this.parentNode.style.display=\"none\";'><br><hr><b><center>Hide Spoiler</center></b></a></div></div>",1,"Hide some text||Type the text you want to be hidden||Enter the spoiler link text");


Symbol - Embed a symbol into your post (e.g. 0222 = Þ)
Code:
 
ubb_tag("Symbol","symbol","symbol","&#<% INNER %>;",0,"Enter symbols into post||Type in the ALT code for the symbol you want to insert");


SuperScript
Code:
 
ubb_tag("SuperScript","sup","<sup><% INNER %></sup>",0,"SuperScript text||Enter the text to SuperScript");


SubScript
Code:
 
ubb_tag("SubScript","sub","<sub><% INNER %></sub>",0,"SubScript text||Enter the text to SubScript");


Strikeout (adds button)
Code:
 
ubb_tag("Strikeout","strike","<s><% INNER %></s>",0,"Strikeout text||Enter the text you want to be striked through");


Align (adds button)
Code:
 
ubb_tag("Align","align",'',1,"Aligns the text||Enter the text to be aligned||Enter where you want the text to be aligned (left,center,right)");


HR - Horizontal line across page (adds button)
Code:
 
ubb_tag("Horizontal Line","hr","",-1,"Draws horizontal line",3,1,'HR');


Glow - Make text glow any colour you want (only works in IE)
Code:
 
ubb_tag("Glow","glow",'<div style="width:100%; filter:glow(color=<% VAR %>,strength=<% VAR[2] %>)"><% INNER %></div>',2,"Make text glow||Enter the text you to glow||Enter the color of the glow in hex or english||Enter the strength of the glow as a number");


Wave - make text wave (only works in IE)
Code:
 
ubb_tag("Wave","wave","<span style='height: 20; Filter: Wave(Add=0, Freq=<% VAR %>, LightStrength=20, Phase=20, Strength=<% VAR[2] %>)'><% INNER %></span>",2,"Waves the text you enter||Enter the text you want to wave||Enter the frequency of the wave||Enter the strength of the wave");


X-Ray (only works in IE)
Code:
 
ubb_tag("X-Ray","xray","<span style='width: 100%; Filter: Xray'><% INNER %></span>",0,"X-Ray text||Enter the text you want to X-Ray");


Transparency - makes text transparent (only works in IE)
Code:
 
ubb_tag("Transparency","transp","<span style='width:100%; Filter: Alpha(Opacity=<% VAR %>)'><% INNER %></span>",1,"Make text transparent||Enter the text you want to make transparent||Enter the opacity of the text in numbers");


Shadow - Give text a coloured shadow (any colour you want) (only works in IE).
Code:
 
ubb_tag("Shadow","shadow","<span style='height: 20; Filter: Shadow(Color=<% VAR %>, Direction=<% VAR[2] %>)'><% INNER %></span>",2,"Give text a coloured shadow||Enter the colour of the shadow||Enter the direction of the shadow");


Blur - Blur text (only works in IE)
Code:
 
ubb_tag("Blur","blur","<span style='width:100%; Filter: Blur(Strength=<% VAR %>)'><% INNER %></span>",1,"Blur text||Enter the text you want to blur||Enter the strength of the blur");




3. NOW HAVING CHOSEN YOUR CODES enter this just underneath the codes you have just entered:
Code:
 
</script>
THAT'S IT!








(Advanced users) Customising/Creating your own BB Codes
This is the basic layout for the script (users of V1 will recognise the layout):
Quote:
 
ubb_tag("Name of BB Code","Tag name of BB code","What you want the BB Code in the post to be converted into",Number of variables in the BB Code,"What the code does||Instruction for inner variable||Instruction for first variable||Instruction for second variable .... etc",(Optional) Should it be enabled in signature and/or polls (default=enabled everywhere),(Optional) Display button?/New line after button,"(Optional) Different name of button");


Name of BB Code - Self explanatory. e.g. enter "Hyperlink".

Tag name of BB code - E.g. [link][/link] would equate to "link"

What you want the BB Code in the post to be converted into - This is where it gets complicated. Enter the HTML which should replace the whole tag, but enter "<% INNER %>" for where you want the inner variable to go ([bbtag]inner variable[/bbtag]), and "<% VAR %>" or "<% VAR[1] %>" for the first variable ([bbtag=first variable]inner variable[/bbtag]) and "<% VAR[2] %>" for the second variable ([bbtag=first variable,second variable]inner variable[/bbtag]), if necessary, and so on. E.g:
If one used the code

"<a href='<% VAR %>' style='color: <% VAR[2] %>;'><b><% INNER %></b></a>"
and you name the BB Tag "link" and a user entered the following:
[link=http://www.google.co.uk/,red]Google UK[/link]
The following would be shown in the post:
Google UK.
If don't need to use <% INNER %> (eg if you just want a bb code only like "[this]") or <% VAR %> (e.g. if you want a code only like "[this][/this]"), you don't have to enter them as long as they aren't part of the BB Code.

Number of variables in the BB Code
Enter -1 for a code just like [this].
Enter 0 for a code just like [this]...[/this].
Enter the number of variables you have if you have a code like [this=var,var2]...[this]. (e.g [this=var,var2]...[this] would be 2)

"What the code does||Instruction for inner variable||Instruction for first variable||Instruction for second variable .... etc"
If you entered -1 and above for Number of variables, put the description of the BB Code (e.g. Embeds media).
If you entered 0 and above for Number of variables, add an "||" and put the instruction for entering the BB Code (e.g. Enter source of media file).
If you entered 1 for Number of variables, for every variable, add an "||" and type in the instruction for each variable, one by one, in order (e.g. "Width of media file||Height of media file").
e.g. for [link=url,colour]name[/link]
"Puts a coloured link into the post||Enter name of link||Enter full URL of link||Enter colour of link"
Make sure all of this is in quotes

(Optional) Should it be enabled in signature and/or polls (default=enabled everywhere)
Enter 0 to disable the BB Code from signatures and polls
Enter 1 to enable the BB Code in signatures, but disable it in polls
Enter 2 to enable the BB Code in polls, but not signatures
Enter 3 to enable the BB Code in polls and signatures
Enter 4 to enable the BB Code in polls and signatures and add a newline after the button displayed on the post page (not necessary if you choose to use the next option).

(Optional) Display button?/New line after button
Enter 0 to display no button on the posting page
Enter 1 to display the button on the posting page
Enter 2 to display the button on the posting page and add a newline after the button

"(Optional) Different name of button" - Enter if you want to change the name of the button (e.g. "URL")
Offline Profile Quote Post Goto Top
 
1 user reading this topic (1 Guest and 0 Anonymous)
« Previous Topic · Codes & Modifications · Next Topic »
Add Reply