Welcome Guest [Log In] [Register]
Viewing Single Post From: Best BB Tag Code EVER v3.1 [ZB]
Xanikseo
Member Avatar
Xanik Says "Oh"
[ *  *  * ]
For InvisionFree version, click here.
Mod name: Best BB Tag Code EVER v3 (BBBTCE)
Preview: http://s1.zetaboards.com/xaniktest3/topic/943307/1/
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 ZB 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 v3.1:
  • BB can be enabled/disabled in blogs, topic titles, PMs, and user descriptions/titles as well
  • NEW (05/Jul/09) - Less lag on posting pages, and now faster than v2.1 in every way
  • Less space is used in the board wrappers
  • Buttons added to posting pages are better integrated (same row as ZB BB buttons)
  • Fixed bug where if you have two BB codes with the same tag name, but two different amounts of variables they would interfere. E.g [code=var1,var2]code[/code] and [code=var1]code[/code] will now not interfere anymore (both codes need different BB tag codes as they are treated as different, and the BB code with the more variables has to be mentioned first in the Board Wrappers)
New in v2.1:
  • Previewing post works properly now (doesn't load new page)
  • BB Codes displayed properly when looking at a single post
  • BB Codes displayed properly on other pages (e.g. search results, profile). All pages should have BB code working now.
  • Even faster (it's now at least 4 times faster than v1)
New in v2:
  • Faster, noticeable speed increase in slow browsers (i.e. FF, IE).
  • 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
  • Works in ZB

Installation: (3 Steps) (If "upgrading" from v2 or v2.1, please go over the same steps again, many things are different)
1. Put this in the top of the "below the board" section of the board template page in the ACP:
Code:
 
<script src='http://209.85.62.24/217/61/0/p180760/'></script><script>
Go to ACP->Themes->Edit Theme Layout
make sure there is a <div id="wrap"> before the <!-- NAV --> and a </div> after the <!-- BOARD -->. E.g.
Code:
 
<div id="wrap"><!-- NAV --><!-- BOARD --></div>
This should only be necessary if you have a custom skin which doesn't use the '<div id="wrap"></div>' (naughty). (Note to early [pre 05/Jul/09] v3 users: this is a faster version of v3 than you may be using now, these two things are the only things that need to be changed if "upgrading" from v3)
2. Choose one or more BB tags to have on your forum, and insert it/them into the "below the board" section, just under the code mentioned above (don't forget step 3 afterwards): (you can also create your own BB Codes, see at the bottom of this post). Most popular BB codes are in a red font.


  • Simple ZB codes in topic titles - click here - bold, italic, underline, bigger, smaller, image, colour, url
  • 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 (not just flash unlike ZB) etc)
  • You (display member logged in name in post)
  • PM - Display a message only to specific user(s) chosen when you enter the BB code into the post. E.g. [pm=Xanikseo,testy,user3,user5]message[/pm] shows the message when Xanikseo, testy, user3, or user5 are looking at the post
  • IE Only - Display Text visible to only Internet Explorer Users (optional extra BB code to specify certain IE versions) - by firestrife2
  • Any browser but IE - Display Text visible to only non-Internet Explorer Users - by firestrife2
  • Table - Put a table into a post with ability to merge rows/columns/boxes - How to use it - Doesn't work in Chrome
  • Anchor - Put a named anchor into a post (place to jump to), put a link to jump to a named anchor into post
  • Spoiler - Same as ZB spoiler, but can specify title of spoiler each time
  • Code with title by theschoot - Same as ZB code BBC tag, but can specify title of code - Disabled in signatures and polls, button disabled
  • Add background image to text (not just text) by firestrife2
  • Marquee - Make text scroll across the page
  • Google - Create a link pointing to a Google search you specify
  • Yahoo - Create a link pointing to a Yahoo search you specify
  • YouTube search - Create a link pointing to a YouTube search you specify - by obxbiker
  • Forum search - Create a link pointing to the forum search query you specify by obxbiker
  • Note - Put a note in your message that only you can see while editing the post
  • Note - Put a note in your message that only you can see while editing the post. Can be seen by admins even when not editing the post
  • Date - Put the date on the post (always updates) - by theschoot
  • Left float - right float - Write on the left side something and in the same row on the right side. - click for code - theschoot
  • Scroll - add a text which would add a scroll bar if the height is too big! - click for code - theschoot
  • Style - put your own custom css styles on text through UBB. - by Viral.
  • Rainbow flash - Make text glow the colour of the rainbow
  • 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")
  • Offtopic - Declare something as offtopic
  • Symbol - Embed a symbol into your post (e.g. "0222" = "Þ")
  • 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)
Click the spoiler to show the codes which need to be put into the "below the board" section for the BB codes which you want.
Spoiler: click to toggle



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) Options (where to enable/disable BB code and posting button options","(Optional) Different name of button (can include HTML)");


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 1 and above for Number of variables, add an "||" and put the instruction for entering the BB Code (e.g. Enter source of media file). 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) Options (where to enable/disable BB code and posting button options"
Here is a list of options (you can use as many as you want and in any order). The default value of not using one of the options is the opposite of what entering that option does (e.g. not using p in the options means that the BB code is allowed in polls):
  • p - disable in poll
  • s - disable in sig
  • m - disable in private messages
  • l - disable in blog entry
  • u - enable in username title
  • t - enable in topic title
  • b - disable button
  • n - newline after button
  • z - put button below zetaboards button row
  • f - if bb code is use in conjunction with a fuction, call the function after the bb has been parsed, also used for previewing bb code (the function must be called xbb_ followed by the tag name, e.g. [reply][/reply] would be xbb_reply() )
E.g. "psut" disables use the BB code in polls, signatures, but enables it's use in username titles (the description under the username) and topic titles.

"(Optional) Different name of button (can include HTML)" - Enter if you want to change the name of the button (e.g. "URL"). Can include HTML.
Edited by Xanikseo, Jul 22 2009, 11:19 AM.
Offline Profile Quote Post
Best BB Tag Code EVER v3.1 [ZB] · Code & Modification Database