You can make up your own tags by just adding more things to be parsed. EXAMPLE:
$text = "Look at [b]this[/b] website ..."; echo $text; custom_tags($text); echo $text; function custom_tags($text) { /* converts special tags into the html counterpart * [b]text[/b] - bold text * [i]text[/i] - italicise text * [EMAIL PROTECTED] - automatically converts to mailto: link * [link=http://www.yahoo.com]text[/link] * * [list] * [*] text * [*] text * [/list] * * [color=value]text to colour[/color] - colourize some text * [colour=value]text to colour[/colour] - colourize some text * [font=value]text[/font] - value is a class defined in css file*/ $text = htmlentities($text); $text = eregi_replace("[0-9a-z]([-_.]?[0-9a-z])*@[0-9a-z]( [-.]?[0-9a-z])*\\.[a-z]{2,3}", "<a href=\"mailto:\\0\">\\0</a>",$text); $text = preg_replace("/\[link=(\S+?)\](.*?)\[\/link\]/is", "<a href=\"\\1\">\\2</a>",$text); $text = preg_replace("/\[i\](.*?)\[\/i\]/is", "<i>\\1</i>",$text); $text = preg_replace("/\[b\](.*?)\[\/b\]/is", "<b>\\1</b>",$text); $text = preg_replace("/\[list\](\n)?/i","<ul>",$text); $text = preg_replace("/\[\/list\](\n)?/i","</ul>",$text); $text = preg_replace("/\[\*\](.*?)$/ism", "<li>\\1</li>",$text); $text = preg_replace("/\[color=(.*?)\](.*?)\[\/color\]/is" , "<font color=\"\\1\">\\2</font>",$text); $text = preg_replace("/\[colour=(.*?)\](.*?)\[\/colour\]/i s", "<font color=\"\\1\">\\2</font>",$text); $text = preg_replace("/\[font=(.*?)\](.*?)\[\/font\]/is", "<font class=\"\\1\">\\2</font>",$text); return nl2br($text); } -----Original Message----- From: Anthony Ritter [mailto:[EMAIL PROTECTED]] Sent: May 25, 2002 8:39 PM To: [EMAIL PROTECTED] Subject: [PHP] bulletin board question... To all, On a bulletin board (non-usenet) within a website, is it possible to change the color or size of the type - or add a link from a word that the user has posted? For example, John Doe posts: "Man, it's hot out here today!" Where John changes the default font color - which is black - of the word "hot" - *to red* - and then links "today" with a URL to another site like weather.com If so, how would this be accomplished? Any thoughts? Thank you. Tony Ritter -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php