bb code I guess
Posted: Tue Apr 12, 2005 8:03 am
Hi,
I have been trying to get some bb code to work for
I have been trying to get some bb code to work for
[/qoute]
when I display the quote message I have a few problems ..
within the blockquote there seems to be a couple invisible <br> before the word Quote: is displayed .. its printed well below the blockquote border.
Also when the data is echoed back I cant get nl2br to work .. its all displayed in a single line.
then called displayed on the page as:Code: Select all
//variables $replymessage = $row["message"]; $quote = '[quote]'; $quote1 = '[/quote]'; $message = ereg_replace('\[quote]','<blockquote style="width: 80%; background-color: #CCCCCC; border: 1px solid #000000;"> <table width="100%" border="0" cellspacing="2" cellpadding="2"> <tr> <td><font class="txt"><b>Quote</b>:<br> ', $row["message"]); $message = ereg_replace('\[/quote][/quote]', '</font></td> </tr> </table> </blockquote><br>', $message);
Other problem is .. that when I echo the quote /quote back within a textarea again it is all in one line .. and if there is a " within the text the quote fails example:Code: Select all
<?php echo (nl2br($message)); ?>
quote bla bla bla "
rather than:
quote bla
bla
bla "/quote
as the original message being quoted is stored.
in the reply code:
How should the code be to work properly?Code: Select all
// variables $replymessage = $_GET['replymessage']; $quote = $_GET['quote']; $quote1 = $_GET['quote1']; //echo back in textarea as <textarea name=\"message\" cols=\"40\" rows=\"10\" class=\"input-box\"><? echo $quote; ?><? echo nl2br($replymessage); ?><? echo $quote1; ?></textarea>
Thanks