/[drupal]/contributions/modules/bbcode/bbcode-help.inc
ViewVC logotype

Contents of /contributions/modules/bbcode/bbcode-help.inc

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.8 - (show annotations) (download) (as text)
Sun Jan 28 21:18:45 2007 UTC (2 years, 9 months ago) by naudefj
Branch: MAIN
CVS Tags: DRUPAL-5--2-0, DRUPAL-5--2-1, DRUPAL-6--1-0, DRUPAL-6--1-1, DRUPAL-6--1-2, DRUPAL-5--1-1, DRUPAL-5--1-3, DRUPAL-5--1-2, HEAD
Changes since 1.7: +1 -3 lines
File MIME type: text/x-php
#111669 by ac: Tiny fix to the help tips
1 <?php
2 // $Id: bbcode-help.inc,v 1.7 2006/04/05 16:21:14 naudefj Exp $
3
4 function _bbcode_filter_tip() {
5 return t("<a id=\"filter-bbcode\"></a><h2>BBCode Guide</h2>
6
7 <p>
8 BBCode allows you to specify formatting rules for your text,
9 even if you are not allowed to use HTML in your posts. BBCode
10 originated from the forum software named PHPBB, and this site
11 has a special implementation of it.
12 </p>
13 <p>
14 In BBCode terms, you use \"tags\" to add formatting to your text. Every
15 tag is enclosed in <strong>[</strong> and <strong>]</strong> brackets.
16 If you want to mark some region in your text, you need to use an opening
17 tag and a closing tag. Closing tags start with <strong>[/</strong>, as
18 you will see in the examples below. If you mistype a tag or forget to
19 close it, you will not get the desired formatting.
20 </p>
21
22 <h3>Simple text formatting</h3>
23
24 <p>
25 BBCode allows you to make some parts of your texts stand out from the
26 context by adding <strong>[b]</strong>old, <strong>[i]</strong>talic,
27 <strong>[u]</strong>nderlined and <strong>[s]</strong>trikeout formatting
28 to them. The <strong>[color]</strong>, <strong>[size]</strong> and
29 <strong>[font]</strong> tags allow you to change the color, size and font
30 of portions of the text you enclose with these tags. Both require a
31 parameter (which colour, how big, what font) that is suffixed to the name
32 of the tag by an equals sign (example below). You should not repeat the
33 parameter in the closing tag!
34 </p>
35
36 <p>
37 You can specify any recognized color name (red, blue, green, white, etc.)
38 or a hexadecimal color value (#CDCDCD, #FFFFFF, etc.) as the parameter of
39 a <strong>[color]</strong> tag. The <strong>[size]</strong> tag allows you
40 to set the font size between 6 and 48, 6 being the smallest size.
41 Note that using very large text is considered by many to be annoying, and
42 it is seldom a good idea to try to attract more attention to your post in
43 this way. The <strong>[font]</strong> tag can be set to any valid font face,
44 such as Arial, Arial Black, Courier, Courier New, Helvetica, Impact,
45 Times New Roman, Verdana, etc.
46 </p>
47
48 <table width=\"98%\">
49 <tr>
50 <th>usage</th><th>display</th>
51 </tr>
52 <tr>
53 <td>I [b]need to do[/b] this by the weekend</td>
54 <td>I <strong>need to do</strong> this by the weekend</td>
55 </tr>
56 <tr>
57 <td>John said that [i]we should[/i] ask her</td>
58 <td>John said that <em>we should</em> ask her</td>
59 </tr>
60 <tr>
61 <td>I [u]would not like to[/u] offend you</td>
62 <td>I <span style=\"text-decoration: underline;\">would not like to</span> offend you</td>
63 </tr>
64 <tr>
65 <td>Let's correct this [s]mispelled[/s] misspelled word</td>
66 <td>Let's correct this <s>mispelled</s> misspelled word</td>
67 </tr>
68 <tr>
69 <td>Jane was at [color=blue]the coast[/color]</td>
70 <td>Jane was at <span style=\"color: blue;\">the coast</span></td>
71 </tr>
72 <tr>
73 <td>Joe was in [color=#FF0000]the forest[/color]</td>
74 <td>Joe was in <span style=\"color: #FF0000;\">the forest</span></td>
75 </tr>
76 <tr>
77 <td>You said: [size=30]HEY![/size]</td>
78 <td>You said: <span style=\"font-size: 30px;\">HEY!</span></td>
79 </tr>
80 <tr>
81 <td>She said: [font=Courier]What?[/font]</td>
82 <td>She said: <span style=\"font-family: Courier;\">What?</span></td>
83 </tr>
84 </table>
85
86 <h3>Creating links</h3>
87
88 <p>
89 You have multiple options to specify links to other destinations in
90 your posts.
91 </p>
92
93 <p>
94 URLs (Uniform Resource Locators) starting with \"www\" or \"ftp\" (eg.
95 www.example.com) are automatically recognized and replaced with links.
96 You can also use the <strong>[url]</strong> tag with a parameter to
97 specify a link with meaningful text to click on. If you use the url
98 tag without the parameter, the enclosed text is assumed to be a URL,
99 and a link is created to that destination.
100 </p>
101 <p>
102 Email addresses in posts are also automatically converted to email links.
103 For compatibility with common BBCode implementations, an
104 <strong>[email]</strong> tag is provided.
105 </p>
106
107 <table width=\"98%\">
108 <tr>
109 <th>usage</th><th>display</th>
110 </tr>
111 <tr>
112 <td>For more examples, visit www.example.com</td>
113 <td>For more examples, visit <a href=\"http://www.example.com\" target=\"_blank\">www.example.com</a></td>
114 </tr>
115 <tr>
116 <td>For more examples, visit http://example.com</td>
117 <td>For more examples, visit <a href=\"http://example.com\" target=\"_blank\">http://example.com</a></td>
118 </tr>
119 <tr>
120 <td>If you have questions ask me at joe@example.com</td>
121 <td>If you have questions ask me at <a href=\"mailto:joe@example.com\">joe@example.com</a></td>
122 </tr>
123 <tr>
124 <td>If you have questions ask me at [email]joe@example.com[/email]</td>
125 <td>If you have questions ask me at <a href=\"mailto:joe@example.com\">joe@example.com</a></td>
126 </tr>
127 <tr>
128 <td>We use [url=http://example.com/]the example site[/url] in these examples</td>
129 <td>We use <a href=\"http://example.com/\" target=\"_blank\">the example site</a> in these examples</td>
130 </tr>
131 <tr>
132 <td>We use [url]http://example.com/[/url] in these examples</td>
133 <td>We use <a href=\"http://example.com/\" target=\"_blank\">http://example.com/</a> in these examples</td>
134 </tr>
135 </table>
136
137 <h3>Displaying images</h3>
138
139 <p>
140 The <strong>[img]</strong> tag allows you to display an image in your
141 post. You need to specify a URL to the image, so it needs to be
142 accessible somewhere on the internet. Beware of adding very large
143 images to your text, or the page will load very slowly!
144 </p>
145
146 <p>
147 If you enclose a URL in an <strong>[img]</strong> tag, then it will
148 be replaced with code to display the image. For example <code>A good
149 screenshot: [img]http://example.com/screenshot.png[/img]</code>
150 will show you the screenshot (if it exists).
151 </p>
152 <p>
153 You can also specify the desired display dimensions of the image by
154 adding a dimension parameter to the <strong>[img]</strong> tag. <code>A
155 good screenshot: [img=640x480]http://example.com/screenshot.png[/img]</code>
156 will display the image in 640x480 (though the full image will be
157 downloaded). Do not use this to show a thumbnail of an image!
158 </p>
159
160 <p>
161 You are free to link an image to an external destination by enclosing
162 the <strong>[img]</strong> tag with a <strong>[url]</strong> tag: <code>See
163 [url=http://example.com][img]http://example.com/screenshot.png[/img][/url]</code>.
164 </p>
165
166 <h3>Ordered and unordered lists</h3>
167
168 <p>
169 The simplest list type is the unordered list, which means that there is
170 no numbering applied to the elements. You can make such a list by enclosing
171 the list elements in <strong>[list]</strong> opening and closing tags.
172 Specify the start of one element with the <strong>[*]</strong> list element
173 marker, which has no closing tag pair.
174 </p>
175
176 <p>
177 To create an ordered list, you should add a parameter to the
178 <strong>[list]</strong> list tag specifying what type of ordered list
179 you would like to see. The possible parameters are \"i\", \"I\", \"1\",
180 \"a\", \"A\", \"c\", \"d\" and \"s\" which all correspond to the display
181 of the first list element.
182 </p>
183
184 <table width=\"98%\">
185 <tr>
186 <th>usage</th><th>display</th>
187 </tr>
188 <tr>
189 <td><pre>
190 I love
191 [list]
192 [*]Oranges
193 [*]Apples
194 [*]Bananas
195 [/list]
196 </pre></td>
197 <td>
198 I love
199 <ul>
200 <li>Oranges</li>
201 <li>Apples</li>
202 <li>Bananas</li>
203 </ul>
204 </td>
205 </tr>
206 <tr>
207 <td><pre>
208 I love
209 [list=I]
210 [*]Oranges
211 [*]Apples
212 [*]Bananas
213 [/list]
214 </pre></td>
215 <td>
216 I love
217 <ol style=\"list-style-type: upper-roman;\">
218 <li>Oranges</li>
219 <li>Apples</li>
220 <li>Bananas</li>
221 </ol>
222 </td>
223 </tr>
224 <tr>
225 <td><pre>
226 I love
227 [list=1]
228 [*]Oranges
229 [*]Apples
230 [*]Bananas
231 [/list]
232 </pre></td>
233 <td>
234 I love
235 <ol style=\"list-style-type: decimal;\">
236 <li>Oranges</li>
237 <li>Apples</li>
238 <li>Bananas</li>
239 </ol>
240 </td>
241 </tr>
242 </table>
243
244 <h3>Fixed-width text and block formatting</h3>
245
246 <p>
247 You can use the <strong>[code]</strong> tag to add an inline fixed-width
248 formatted part or to add a block of (usually program) code. If there is
249 any newline present between the opening and closing tags, then a block
250 will be displayed.
251 </p>
252
253 <p>
254 Similarly, the <strong>[php]</strong> tag can be used to post PHP code.
255 PHP code will automatically be syntax highlighted for easier readability.
256 </p>
257
258 <table width=\"98%\">
259 <tr>
260 <th>usage</th><th>display</th>
261 </tr>
262 <tr>
263 <td>Edit your [code]robots.txt[/code] file</td>
264 <td>Edit your <code>robots.txt</code> file</td>
265 </tr>
266 <tr>
267 </tr>
268 <tr>
269 <td>
270 An HTML title example:<br />
271 [code]<br />
272 &lt;head&gt;<br />
273 &nbsp;&lt;title&gt;Page Title&lt;/title&gt;<br />
274 &lt;/head&gt;<br />
275 [/code]
276 </td>
277 <td>
278 An HTML title example:<br />
279 <div class=\"codeblock\"><code>
280 &lt;head&gt;<br />
281 &nbsp;&lt;title&gt;Page Title&lt;/title&gt;<br />
282 &lt;/head&gt;<br />
283 </code>
284 </td>
285 </tr>
286 <tr>
287 </tr>
288 <tr>
289 <td>
290 Some PHP code:<br />
291 [php]<br />
292 &lt;?php<br />
293 function hello()<br />
294 {<br />
295 &nbsp;&nbsp;echo \"Hello World!\";<br />
296 }<br />
297 ?&gt;<br />
298 [/php]
299 </td>
300 <td valign=top>
301 Some PHP code:<br />
302 <div class=\"codeblock\"><code>
303 <font color=\"#000000\">
304 <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>
305 </font>
306 </code>
307 </td>
308 </tr>
309 </table>
310
311 <h3>Text and block alignment</h3>
312
313 <p>
314 You can also set the alignment of the text by using <strong>[left]</strong>,
315 <strong>[right]</strong> and <strong>[center]</strong> tags. The
316 <strong>[float]</strong> tag can be used to place floating boxes in the text
317 (especially handy for images). You can specify the direction of the floating with
318 <strong>[float=left]</strong> and <strong>[float=right]</strong>. The
319 <strong>[justify]</strong> tag can be used justify text on both sides of
320 the page.
321 </p>
322
323 <h3>Other supported tags</h3>
324
325 <p>
326 It is possible to quote something that has already been posted, by just
327 putting <strong>[quote][/quote]</strong> tags around it. To quote a
328 specific person, use something like [quote=John]. Quote tags can
329 be nested.
330 </p>
331
332 <p>
333 The <strong>[sub]</strong> and <strong>[sup]</strong> tags can be used
334 to add subscript and superscript text. For example,
335 H[sub]2[/sub]O gives H<sub>2</sub>O, while
336 X[sup]3[/sup] gives X<sup>3</sup>.
337 </p>
338
339 <p>
340 The <strong>[acronym]</strong> tag allow you to identify text as
341 an acronym and provide a description when users move their mouse
342 over the tag. For example,
343 [acronym=Structured Query Language]SQL[/acronym] produces
344 <acronym title=\"Structured Query Language\">SQL</acronym>.
345 </p>
346
347 <p>
348 The <strong>[abbr]</strong> tag allow you to identify text as
349 an abbreviation and provide a description when users move their mouse
350 over the tag. For example,
351 [abbr=World Wide Web]WWW[/abbr] produces
352 <abbr title=\"World Wide Web\">WWW</abbr>.
353 </p>
354
355 <p>
356 The <strong>[notag]</strong> tags prevent text inside the tags from being
357 parsed. This allows you to give examples of BBcode and not have it
358 converted to HTML. For example: [notag]These [b]tags[/b] are not
359 rendered[/notag] will produce \"These [b]tags[/b] are not rendered\".
360 </p>
361
362 <p>
363 The <strong>[hr]</strong> tag draws a horizontal line across the page. Handy
364 for separating chunks of text.
365 </p>
366
367 <h3>Using multiple formatting tags</h3>
368
369 <p>
370 You can apply more than one formatting specification to a portion of some
371 text. <code>I was at [b][i]the coast[/i][/b]</code> will be
372 rendered as <code>I was at <strong><em>the coast</em></strong></code>.
373 </p>
374
375 <p>
376 Make sure that you take care of the proper order of the opening and closing
377 tags. You should close the tags in the opposite order in which you opened
378 them. Otherwise you might get very strange rendering results. Also check
379 your post with the preview function before submitting it, in case there are
380 formatting errors due to improper BBCode usage.
381 </p>");
382
383 }

  ViewVC Help
Powered by ViewVC 1.1.2