samScripts.com
[Home] [My Scripts] [Contact] [Business Card Designer] [Donate] [$8.95 Domain Names]

Home > Scripts > bbtags

bbtags

... feel free to use this script for whatever you like.

bbtags

This class makes it easy to convert [ ] tags to html like on phpBB and other bulletin boards in your own scripts.

Description:

[What] [is] [this]?


The utility class, tagreplacer provides a simple method to set up a conversion function to change text formatted with [ ] tags to html for display.

The class bbtags is an example of an implementation of the tagreplacer. To get an example of how it works, post a message in my guestbook, using any of these tags:

[b]bold[/b], [i]italic[/i], [u]underline[/u]
[url=http://www.yourwebsite.com]The name of your website[/url]
or just: [url]http://www.yourwebsite.com[/url]

Or quote someone else with [quote=who said it]I said it![/quote]

if you use [email=you@yourdomain.com]your name  here[/email] then people can contact you.


bold, italic, underline
The name of your website
or just: http://www.yourwebsite.com

Or quote someone else with
Quote from who said it:
I said it!


if you use your name here then people can contact you.

Oh, and see what happens if you put some code between some php tags.

Example:
<?php

$text
= "[b]Hello World[/b]"; // or from your weblog, guestbook etc

$bb = new bbtags;
echo
$bb->replace($text);

?>


Output:
Hello World


Have a look at the bbtags class to understand how to add custom tags.

Ask in the support forum if you need help.

Files

bbtags.php (5427 bytes) View Download
Viewed 884 times. Downloaded 1412 times.

[Back] [Top] [Forward]

Powered by php, mySql.

Request processed in 0.00 seconds on Wednesday 26th September 2012 23:43:29.

©2002 Sam Yapp

What do you think of my resume wizard site? All nicely written in php :)