cooldude832 Posted March 10, 2009 Share Posted March 10, 2009 Anyone know of a downlaod of one that is quality? I've lost my copy Link to comment https://forums.phpfreaks.com/topic/148695-bb2html-function/ Share on other sites More sharing options...
redarrow Posted March 10, 2009 Share Posted March 10, 2009 what bb sorry .... put me out of my mystery. Link to comment https://forums.phpfreaks.com/topic/148695-bb2html-function/#findComment-780797 Share on other sites More sharing options...
cooldude832 Posted March 10, 2009 Author Share Posted March 10, 2009 there is a function someone wrote and shared called bb2html($string){ } and it was great but I lost my copy Link to comment https://forums.phpfreaks.com/topic/148695-bb2html-function/#findComment-780804 Share on other sites More sharing options...
redarrow Posted March 10, 2009 Share Posted March 10, 2009 was it this one? <?php // A simple FAST parser to convert BBCode to HTML // Trade-in more restrictive grammar for speed and simplicty // // Syntax Sample: // -------------- // [img=http://elouai.com/images/star.gif] // [url="http://elouai.com"]eLouai[/url] // [mail="[email protected]"]Webmaster[/mail] // [size="25"]HUGE[/size] // [color="red"]RED[/color] // [b]bold[/b] // [i]italic[/i] // [u]underline[/u] // [list][*]item[*]item[*]item[/list] // [code]value="123"; // John said yadda yadda yadda // // Usage: // ------ // <?php include 'bb2html.php'; ?> // <?php $htmltext = bb2html($bbtext); ?> // // (please do not remove credit) // author: Louai Munajim // website: http://elouai.com // date: 2004/Apr/18 function bb2html($text) { $bbcode = array("<", ">", " ", " ", " ", "", "", "", "", "", "", "", '", "", '", "[mail=\"", "[/mail]", " ", " ", " ", " ", '"]'); $htmlcode = array("<", ">", "<ul>", "<li>", "</ul>", "<img src=\"", "\">", "<b>", "</b>", "<u>", "</u>", "<i>", "</i>", "<span style=\"color:", "</span>", "<span style=\"font-size:", "</span>", '<a href="', "</a>", "<a href=\"mailto:", "</a>", "<code>", "</code>", "<table width=100% bgcolor=lightgray><tr><td bgcolor=white>", "</td></tr></table>", '">'); $newtext = str_replace($bbcode, $htmlcode, $text); $newtext = nl2br($newtext);//second pass return $newtext; } ?> [/code] Link to comment https://forums.phpfreaks.com/topic/148695-bb2html-function/#findComment-780805 Share on other sites More sharing options...
redarrow Posted March 10, 2009 Share Posted March 10, 2009 http://elouai.com/bb2html.php.txt Link to comment https://forums.phpfreaks.com/topic/148695-bb2html-function/#findComment-780806 Share on other sites More sharing options...
cooldude832 Posted March 10, 2009 Author Share Posted March 10, 2009 yeah that is it thanks a lot Link to comment https://forums.phpfreaks.com/topic/148695-bb2html-function/#findComment-780829 Share on other sites More sharing options...
redarrow Posted March 10, 2009 Share Posted March 10, 2009 See i do care lol. Link to comment https://forums.phpfreaks.com/topic/148695-bb2html-function/#findComment-780831 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.