hey guyz..
you see i just did this new bbcode thingy on my forum...
but i cant figure one thing out.... you see i also included a quote option... so i want is that once people quote... the message comes in the post area of posting... just like here....
i managed to do this bit... by this method...
1) i get the user to press quote button send the id of post in URL.
2) the next posting page checks for the existance of "quote=id" in the URL.
3) it then sends a query that extracts relevant info from the table..
4) and then displays the extracted message as default of the text area..
now all this is done... but as the bbcode converts all stuff to html... the post area shows this..
where it should not display "<br>" and not show other stuff like.. in quote... it displays all the css and stuff....
so how can i get it to not to do this...... this si the bb code im usin...
thnx in advance !!
you see i just did this new bbcode thingy on my forum...
but i cant figure one thing out.... you see i also included a quote option... so i want is that once people quote... the message comes in the post area of posting... just like here....
i managed to do this bit... by this method...
1) i get the user to press quote button send the id of post in URL.
2) the next posting page checks for the existance of "quote=id" in the URL.
3) it then sends a query that extracts relevant info from the table..
4) and then displays the extracted message as default of the text area..
now all this is done... but as the bbcode converts all stuff to html... the post area shows this..
| Code: |
| [quote]test <b>bold </b><br /><br />
<br /><br /> [url]www.example.com[/url][/quote]<br> |
where it should not display "<br>" and not show other stuff like.. in quote... it displays all the css and stuff....
so how can i get it to not to do this...... this si the bb code im usin...
| Code: |
| <?php
function bbcode($string){ $string = nl2br(htmlspecialchars($string)); $patterns = array( '`\[b\](.+?)\[/b\]`is', '`\[i\](.+?)\[/i\]`is', '`\[u\](.+?)\[/u\]`is', '`\[strike\](.+?)\[/strike\]`is', '`\[color=#([0-9]{6})\](.+?)\[/color\]`is', '`\[email\](.+?)\[/email\]`is', '`\[img\](.+?)\[/img\]`is', '`\[code\](.+?)\[/code\]`is', '`\[url=([a-z0-9]+://)([\w\-]+\.([\w\-]+\.)*[\w]+(:[0-9]+)?(/[^ \"\n\r\t<]*?)?)\](.*?)\[/url\]`si', '`\[url\]([a-z0-9]+?://){1}([\w\-]+\.([\w\-]+\.)*[\w]+(:[0-9]+)?(/[^ \"\n\r\t<]*)?)\[/url\]`si', '`\[url\]((www|ftp)\.([\w\-]+\.)*[\w]+(:[0-9]+)?(/[^ \"\n\r\t<]*?)?)\[/url\]`si', '`\[flash=([0-9]+),([0-9]+)\](.+?)\[/flash\]`is', '`\[quote\](.+?)\[/quote\]`is', '`\[indent](.+?)\[/indent\]`is', '`\[size=([1-6]+)\](.+?)\[/size\]`is', '`\[step\](.+?)\[/step\]`is' ); $replaces = array( '<b>\\1</b>', '<em>\\1</em>', '<u>\\1</u>', '<strike>\\1</strike>', '<span style="color:#\1;">\2</span>', '<a href="mailto:\1">\1</a>', '<img src="\1" alt="" style="border:0px;" />', '<br><b><div align="left"><blockquote>Code:</blockquote></div></b><code><div align="left" style="margin:0px 10px;padding:5px;background-color:#F7F7F7;border:1px solid #CCCCCC;width:90%;"><font color="#000000">\\1</font></div></code><br>', '<a href="\1\2">\6</a>', '<a href="\1\2">\1\2</a>', '<a href="http://\1">\1</a>', '<object width="\1" height="\2"><param name="movie" value="\3" /><embed src="\3" width="\1" height="\2"></embed></object>', '<b><div align="left">Quote</blockquote></div></b><div align="left" style="margin:0px 10px;padding:5px;background-color:#F7F7F7;border:1px dotted #CCCCCC;width:90%;font:#000000;"><em><font color="#000000">\1</font></em></div>', '<pre>\\1</pre>', '<h\1>\2</h\1>', '<br><br><br><img src="Templates/Urbane/images/tuts/\\1.gif"><br><br>', ); $string = preg_replace($patterns, $replaces , $string); return $string; } ?> |
thnx in advance !!
