You are here

bbcode-help.inc in Bbcode 5

Same filename and directory in other branches
  1. 7 bbcode-help.inc

File

bbcode-help.inc
View source
<?php

function _bbcode_filter_tip() {
  return t("<a id=\"filter-bbcode\"></a><h2>BBCode Guide</h2>\n\n<h3>Introduction</h3>\n\n<p>\n BBCode allows you to specify formatting rules for your text,\n even if you are not allowed to use HTML in your posts. BBCode\n originated from the forum software named PHPBB, and this site\n has a special implementation of it.\n</p>\n<p>\n In BBCode terms, you use \"tags\" to add formatting to your text. Every\n tag is enclosed in <strong>[</strong> and <strong>]</strong> brackets. \n If you want to mark some region in your text, you need to use an opening \n tag and a closing tag. Closing tags start with <strong>[/</strong>, as\n you will see in the examples below. If you mistype a tag or forget to \n close it, you will not get the desired formatting.\n</p>\n\n<h3>Simple text formatting</h3>\n\n<p>\n BBCode allows you to make some parts of your texts stand out from the\n context by adding <strong>[b]</strong>old, <strong>[i]</strong>talic,\n <strong>[u]</strong>nderlined and <strong>[s]</strong>trikeout formatting \n to them. The <strong>[color]</strong>, <strong>[size]</strong> and \n <strong>[font]</strong> tags allow you to change the color, size and font \n of portions of the text you enclose with these tags. Both require a \n parameter (which colour, how big, what font) that is suffixed to the name \n of the tag by an equals sign (example below).  You should not repeat the \n parameter in the closing tag!\n</p>\n\n<p>\n You can specify any recognized color name (red, blue, green, white, etc.)\n or a hexadecimal color value (#CDCDCD, #FFFFFF, etc.) as the parameter of\n a <strong>[color]</strong> tag. The <strong>[size]</strong> tag allows you\n to set the font size between 6 and 48, 6 being the smallest size.\n Note that using very large text is considered by many to be annoying, and\n it is seldom a good idea to try to attract more attention to your post in\n this way. The <strong>[font]</strong> tag can be set to any valid font face,\n such as Arial, Arial Black, Courier, Courier New, Helvetica, Impact, \n Times New Roman, Verdana, etc.\n</p>\n\n<table width=\"98%\">\n <tr>\n  <th>usage</th><th>display</th>\n </tr>\n <tr>\n  <td>I [b]need to do[/b] this by the weekend</td>\n  <td>I <strong>need to do</strong> this by the weekend</td>\n </tr>\n <tr>\n  <td>John said that [i]we should[/i] ask her</td>\n  <td>John said that <em>we should</em> ask her</td>\n </tr>\n <tr>\n  <td>I [u]would not like to[/u] offend you</td>\n  <td>I <span style=\"text-decoration: underline;\">would not like to</span> offend you</td>\n </tr>\n <tr>\n  <td>Let's correct this [s]mispelled[/s] misspelled word</td>\n  <td>Let's correct this <s>mispelled</s> misspelled word</td>\n </tr>\n <tr>\n  <td>Jane was at [color=blue]the coast[/color]</td>\n  <td>Jane was at <span style=\"color: blue;\">the coast</span></td>\n </tr>\n <tr>\n  <td>Joe was in [color=#FF0000]the forest[/color]</td>\n  <td>Joe was in <span style=\"color: #FF0000;\">the forest</span></td>\n </tr>\n <tr>\n  <td>You said: [size=30]HEY![/size]</td>\n  <td>You said: <span style=\"font-size: 30px;\">HEY!</span></td>\n </tr>\n <tr>\n  <td>She said: [font=Courier]What?[/font]</td>\n  <td>She said: <span style=\"font-family: Courier;\">What?</span></td>\n </tr>\n</table>\n\n<h3>Creating links</h3>\n\n<p>\n You have multiple options to specify links to other destinations in\n your posts.\n</p>\n\n<p>\n URLs (Uniform Resource Locators) starting with \"www\" or \"ftp\" (eg.\n www.example.com) are automatically recognized and replaced with links. \n You can also use the <strong>[url]</strong> tag with a parameter to \n specify a link with meaningful text to click on. If you use the url \n tag without the parameter, the enclosed text is assumed to be a URL,\n and a link is created to that destination.\n</p>\n<p>\n Email addresses in posts are also automatically converted to email links. \n For compatibility with common BBCode implementations, an \n <strong>[email]</strong> tag is provided. \n</p>\n\n<table width=\"98%\">\n <tr>\n  <th>usage</th><th>display</th>\n </tr>\n <tr>\n  <td>For more examples, visit www.example.com</td>\n  <td>For more examples, visit <a href=\"http://www.example.com\" target=\"_blank\">www.example.com</a></td>\n </tr>\n <tr>\n  <td>For more examples, visit http://example.com</td>\n  <td>For more examples, visit <a href=\"http://example.com\" target=\"_blank\">http://example.com</a></td>\n </tr>\n <tr>\n  <td>If you have questions ask me at joe@example.com</td>\n  <td>If you have questions ask me at <a href=\"mailto:joe@example.com\">joe@example.com</a></td>\n </tr>\n <tr>\n  <td>If you have questions ask me at [email]joe@example.com[/email]</td>\n  <td>If you have questions ask me at <a href=\"mailto:joe@example.com\">joe@example.com</a></td>\n </tr>\n <tr>\n  <td>We use [url=http://example.com/]the example site[/url] in these examples</td>\n  <td>We use <a href=\"http://example.com/\" target=\"_blank\">the example site</a> in these examples</td>\n </tr>\n <tr>\n  <td>We use [url]http://example.com/[/url] in these examples</td>\n  <td>We use <a href=\"http://example.com/\" target=\"_blank\">http://example.com/</a> in these examples</td>\n </tr>\n</table>\n\n<h3>Displaying images</h3>\n\n<p>\n The <strong>[img]</strong> tag allows you to display an image in your\n post. You need to specify a URL to the image, so it needs to be\n accessible somewhere on the internet. Beware of adding very large\n images to your text, or the page will load very slowly!\n</p>\n\n<p>\n If you enclose a URL in an <strong>[img]</strong> tag, then it will\n be replaced with code to display the image. For example <code>A good\n screenshot: [img]http://example.com/screenshot.png[/img]</code>\n will show you the screenshot (if it exists). \n</p>\n<p>\n You can also specify the desired display dimensions of the image by\n adding a dimension parameter to the <strong>[img]</strong> tag. <code>A\n good screenshot: [img=640x480]http://example.com/screenshot.png[/img]</code>\n will display the image in 640x480 (though the full image will be\n downloaded). Do not use this to show a thumbnail of an image!\n</p>\n\n<p>\n You are free to link an image to an external destination by enclosing\n the <strong>[img]</strong> tag with a <strong>[url]</strong> tag: <code>See\n [url=http://example.com][img]http://example.com/screenshot.png[/img][/url]</code>.\n</p>\n\n<h3>Ordered and unordered lists</h3>\n\n<p>\n The simplest list type is the unordered list, which means that there is\n no numbering applied to the elements. You can make such a list by enclosing\n the list elements in <strong>[list]</strong> opening and closing tags.\n Specify the start of one element with the <strong>[*]</strong> list element\n marker, which has no closing tag pair.\n</p>\n\n<p>\n To create an ordered list, you should add a parameter to the \n <strong>[list]</strong> list tag specifying what type of ordered list \n you would like to see. The possible parameters are \"i\", \"I\", \"1\", \n \"a\", \"A\", \"c\", \"d\" and \"s\" which all correspond to the display \n of the first list element.\n</p>\n\n<table width=\"98%\">\n <tr>\n  <th>usage</th><th>display</th>\n </tr>\n <tr>\n  <td><pre>\nI love\n [list]\n  [*]Oranges\n  [*]Apples\n  [*]Bananas\n [/list]\n</pre></td>\n  <td>\n   I love \n   <ul>\n    <li>Oranges</li>\n    <li>Apples</li>\n    <li>Bananas</li>\n   </ul>\n  </td>\n </tr>\n <tr>\n  <td><pre>\nI love\n [list=I]\n  [*]Oranges\n  [*]Apples\n  [*]Bananas\n [/list]\n</pre></td>\n  <td>\n   I love \n   <ol style=\"list-style-type: upper-roman;\">\n    <li>Oranges</li>\n    <li>Apples</li>\n    <li>Bananas</li>\n   </ol>\n  </td>\n </tr>\n <tr>\n  <td><pre>\nI love\n [list=1]\n  [*]Oranges\n  [*]Apples\n  [*]Bananas\n [/list]\n</pre></td>\n  <td>\n   I love \n   <ol style=\"list-style-type: decimal;\">\n    <li>Oranges</li>\n    <li>Apples</li>\n    <li>Bananas</li>\n   </ol>\n  </td>\n </tr>\n</table>\n\n<h3>Fixed-width text and block formatting</h3>\n\n<p>\n You can use the <strong>[code]</strong> tag to add an inline fixed-width\n formatted part or to add a block of (usually program) code. If there is\n any newline present between the opening and closing tags, then a block\n will be displayed.\n</p>\n\n<p>\n Similarly, the <strong>[php]</strong> tag can be used to post PHP code. \n PHP code will automatically be syntax highlighted for easier readability.\n</p>\n\n<table width=\"98%\">\n <tr>\n  <th>usage</th><th>display</th>\n </tr>\n <tr>\n  <td>Edit your [code]robots.txt[/code] file</td>\n  <td>Edit your <code>robots.txt</code> file</td>\n </tr>\n <tr>\n </tr>\n <tr>\n  <td>\nAn HTML title example:<br />\n[code]<br />\n&lt;head&gt;<br />\n&nbsp;&lt;title&gt;Page Title&lt;/title&gt;<br />\n&lt;/head&gt;<br />\n[/code]\n  </td>\n  <td>\nAn HTML title example:<br />\n<div class=\"codeblock\"><code>\n&lt;head&gt;<br />\n&nbsp;&lt;title&gt;Page Title&lt;/title&gt;<br />\n&lt;/head&gt;<br />\n</code>\n  </td>\n </tr>\n <tr>\n </tr>\n <tr>\n  <td>\nSome PHP code:<br />\n[php]<br />\n&lt;?php<br />\nfunction hello()<br />\n{<br />\n&nbsp;&nbsp;echo \"Hello World!\";<br />\n}<br />\n?&gt;<br />\n[/php]\n  </td>\n  <td valign=top>\nSome PHP code:<br />\n<div class=\"codeblock\"><code>\n<font color=\"#000000\">\n<font color=\"#0000BB\">&lt;?php<br /></font><font color=\"#007700\">function </font><font color=\"#0000BB\">hello</font><font color=\"#007700\">()<br />{<br />&nbsp;&nbsp;echo </font><font color=\"#DD0000\">\"Hello World!\"</font><font color=\"#007700\">;<br />}<br /><font color=\"#0000BB\">?&gt;</font>\n</font>\n</code>\n  </td>\n </tr>\n</table>\n\n<h3>Text and block alignment</h3>\n\n<p>\n You can also set the alignment of the text by using <strong>[left]</strong>,\n <strong>[right]</strong> and <strong>[center]</strong> tags. The \n <strong>[float]</strong> tag can be used to place floating boxes in the text \n (especially handy for images). You can specify the direction of the floating with\n <strong>[float=left]</strong> and <strong>[float=right]</strong>. The \n <strong>[justify]</strong> tag can be used justify text on both sides of \n the page.\n</p>\n\n<h3>Other supported tags</h3>\n\n<p>\n It is possible to quote something that has already been posted, by just \n putting <strong>[quote][/quote]</strong> tags around it. To quote a \n specific person, use something like [quote=John]. Quote tags can \n be nested.\n</p>\n\n<p>\n  The <strong>[sub]</strong> and <strong>[sup]</strong> tags can be used \n  to add subscript and superscript text. For example,\n  H[sub]2[/sub]O gives H<sub>2</sub>O, while \n  X[sup]3[/sup] gives X<sup>3</sup>.\n</p>\n\n<p>\n The <strong>[acronym]</strong> tag allow you to identify text as \n an acronym and provide a description when users move their mouse \n over the tag. For example,\n [acronym=Structured Query Language]SQL[/acronym] produces \n <acronym title=\"Structured Query Language\">SQL</acronym>.\n</p>\n\n<p>\n The <strong>[abbr]</strong> tag allow you to identify text as \n an abbreviation and provide a description when users move their mouse \n over the tag. For example,\n [abbr=World Wide Web]WWW[/abbr] produces \n <abbr title=\"World Wide Web\">WWW</abbr>.\n</p>\n\n<p>\n The <strong>[notag]</strong> tags prevent text inside the tags from being \n parsed. This allows you to give examples of BBcode and not have it \n converted to HTML. For example: [notag]These [b]tags[/b] are not \n rendered[/notag] will produce \"These [b]tags[/b] are not rendered\".\n</p>\n\n<p>\n The <strong>[hr]</strong> tag draws a horizontal line across the page. Handy\n for separating chunks of text.\n</p>\n\n<h3>Using multiple formatting tags</h3>\n\n<p>\n You can apply more than one formatting specification to a portion of some\n text. <code>I was at [b][i]the coast[/i][/b]</code> will be\n rendered as <code>I was at <strong><em>the coast</em></strong></code>.\n</p>\n\n<p>\n Make sure that you take care of the proper order of the opening and closing\n tags. You should close the tags in the opposite order in which you opened\n them. Otherwise you might get very strange rendering results. Also check\n your post with the preview function before submitting it, in case there are\n formatting errors due to improper BBCode usage.\n</p>");
}

Functions

Namesort descending Description
_bbcode_filter_tip