Page 1 of 1

Forums Quotes

Posted: Sun Feb 06, 2005 10:48 pm
by s.dot
I was wondering if this would be the most effecient way to add quote functionality to my forums? (I don't think it is because it seems impractical, although it works)

Code: Select all

// form data has been submited $entry = returned forum entry

$entry2 = mysql_real_escape_string(nl2br(strip_tags($entry)));
$entry3 = str_replace("&#1111;QUOTE]", "<p style='border: solid 1px #000000'>", $entry2);
$entry4 = str_replace("&#1111;/QUOTE]", "</p>", $entry3);

// submit entry 4 to database
This works fine, but I'm sure it's not how it's done in professional forums. Also, using this method, there's no way to get the username of the person who is being quoted ($author).

Posted: Sun Feb 06, 2005 10:51 pm
by feyd
take a look at the bbcode class/functions on evilwalrus.com or bbcode.php in phpbb's code..