Computer Science Canada Form Features for Final Project |
Author: | Tycoon [ Tue Jan 09, 2007 11:04 pm ] |
Post subject: | Form Features for Final Project |
I have been working on my final project for computer programming class (I will post a link to the site once its done and needs testing) and I am currently working on the message section of the members area. But I have run into a problem, how do I make the posting section like the one they have on this forum. With Bold, Italics, Underlining and the quote feature, thats all I need. Currently I have it replacing the codes, etc., with <b></b> using str_replace but I don't know how the |quote][/quote| (disabled it) function works. I am sorry if something like this has already been posted. Thanks, Tycoon. |
Author: | Amailer [ Wed Jan 10, 2007 12:26 am ] | ||
Post subject: | RE:Form Features for Final Project | ||
Thats how phpBB does it; I am no good with regular expressions, not sure if it works-- but try $new_msg = replace_quote($message) |
Author: | Tycoon [ Wed Jan 10, 2007 10:03 am ] |
Post subject: | Re: Form Features for Final Project |
Oooh lovely. Thank you - I will test it out and get back to you. edit -------------- Great, it works, but now I need to change the regular expression to read the quote box if |quote=<username] is added I will do my best to edit the expression myself but I haven't learned those yet so I might fail. 2nd edit ---------- By using trial and error and a very basic understanding of the preg expression, I managed to figure it out Original expression (expression 1): "#\|quote](.*?)\[/quote]#si" - please note the | is actually [ Edited expression (expression2): "#\[quote=(.*?)](.*?)\[/quote]#si" By using the second expression, combined with the first (in 2 separate loops) I can now have |quote]text[/quote| and |quote=<anything>]text[/quote| -------------------- -------------------- |
Author: | Amailer [ Thu Jan 11, 2007 7:29 pm ] | ||
Post subject: | Re: Form Features for Final Project | ||
Nice, glad you got it. And by the way, insted of doing |quote], you should have just put your information in
|
Author: | Clayton [ Thu Jan 11, 2007 11:23 pm ] |
Post subject: | Re: Form Features for Final Project |
Just like you should've |
Author: | Amailer [ Fri Jan 12, 2007 12:01 am ] |
Post subject: | RE:Form Features for Final Project |
I...i...I got attacked by the sessions bug and it logged me off, I was unable to! *runs* Yeah Thought I did? XD |
Author: | Tycoon [ Sat Jan 13, 2007 2:03 am ] |
Post subject: | Re: Form Features for Final Project |
Yeah, I could do that.... lol [quote][/quote] |