Forum Moderators: coopster

Message Too Old, No Replies

PHP Forum

         

wonderboy

2:51 pm on Jul 11, 2004 (gmt 0)

10+ Year Member



Hi, I have created a fairly simple PHP / MySQL forum, I just need some advice on tags and other small things to improve the usability.

1) How do I ensure that when the user wants spaces between paragraphs they are present. At the moment if you press 'enter' several times the next bit of text you write will still appear next to the last bit rather than down the page.

2) How do I replace certain text with images or other characters, the classic example is a smiley or a swear word.

3) How do I change the colour or spacing of text within [quote] brackets.

I am storing the posts in "text" fields within the mysql database, is this the best way?

Please bear in mind this is all manual code, so no really deep functions, as it is very minimal.

Thanks for your help!

W.

jatar_k

5:20 pm on Jul 11, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



1. nl2br [ca2.php.net]
2. str_replace [ca2.php.net] or preg_replace [ca2.php.net]
3. don't quite understand this question

>>I am storing the posts in "text" fields within the mysql database, is this the best way

sounds good to me

httpwebwitch

2:16 pm on Jul 12, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



To change the style of text between [quote] brackets (much like the style codes here at WebmasterWorld), use preg_replace to put a <span class='quote'></span> around the text, then define a stylesheet class for "quote".