MemphiS Posted October 11, 2007 Share Posted October 11, 2007 i use the following code to replace my bbcodes: function bb($t){ str_replace("","<img src='images/smile.gif>",$t); return $t; } How do i code it so i can have colors: Quote Link to comment Share on other sites More sharing options...
Aureole Posted October 11, 2007 Share Posted October 11, 2007 I've been trying to find this out too... if anyone knows how to do it can you make it so it's like <span style="color:#------;">...</span> as that's the valid way to do it... only ones I can find use font tags and I don't know how to change the regular expression to use spans... Quote Link to comment Share on other sites More sharing options...
MemphiS Posted October 11, 2007 Author Share Posted October 11, 2007 bump Quote Link to comment Share on other sites More sharing options...
MemphiS Posted November 5, 2007 Author Share Posted November 5, 2007 bump ??? ??? ??? Quote Link to comment Share on other sites More sharing options...
abdfahim Posted November 5, 2007 Share Posted November 5, 2007 Here is a part of code I used when I built my forum. function abc($str){ $bb_extra[0]="|\[color=(.*?)\](.*?)\[/color\]|s"; $html_extra[0]="<font color=\"\$1\">\$2</font>"; $str= preg_replace($bb_extra, $html_extra, $str); return $str; } Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.