[PHP] BBcode
I tested BBcode (Pear extension) with that code: if (!empty($_POST['bbcode'])) { require_once 'HTML/BBCodeParser.php'; $parser = new HTML_BBCodeParser(parse_ini_file('BBCodeParser.ini')); echo $parser-qParse($_POST['bbcode']); } ? form action=?php echo $_SERVER['PHP_SELF']; ? method=POST textarea name=bbcode ?php echo @$_POST['bbcode']; ? /textarea input type=submit / /form it works! I added it to a production page, by moving BBCodeParser.ini ouside of htdocs directory. Added at the beginning of the php file: require_once 'HTML/BBCodeParser.php'; and at the wished output: echo TD bgcolor='yellow'; $parser = new HTML_BBCodeParser(parse_ini_file('../BBCodeParser.ini')); echo FONT face=$FFACE color=$FCOLOR; echo $parser-qParse($DB_DETAIL); echo /TD; I tested the input of my form with: [list] [*]normal [*][b]bold[/b] [*][u]underline[/u] [*][i]italic[/i] [/list] The database field in got these data, but the output on the screen is also just: [list] [*]normal [*][b]bold[/b] [*][u]underline[/u] [*][i]italic[/i] [/list] What am I doing wrong? bye Ronald -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] BBcode - Solved
I copied BBCodeParse.ini to the wrong place, Ronald Wiplinger wrote: I tested BBcode (Pear extension) with that code: if (!empty($_POST['bbcode'])) { require_once 'HTML/BBCodeParser.php'; $parser = new HTML_BBCodeParser(parse_ini_file('BBCodeParser.ini')); echo $parser-qParse($_POST['bbcode']); } ? form action=?php echo $_SERVER['PHP_SELF']; ? method=POST textarea name=bbcode ?php echo @$_POST['bbcode']; ? /textarea input type=submit / /form it works! I added it to a production page, by moving BBCodeParser.ini ouside of htdocs directory. Added at the beginning of the php file: require_once 'HTML/BBCodeParser.php'; and at the wished output: echo TD bgcolor='yellow'; $parser = new HTML_BBCodeParser(parse_ini_file('../BBCodeParser.ini')); echo FONT face=$FFACE color=$FCOLOR; echo $parser-qParse($DB_DETAIL); echo /TD; I tested the input of my form with: [list] [*]normal [*][b]bold[/b] [*][u]underline[/u] [*][i]italic[/i] [/list] The database field in got these data, but the output on the screen is also just: [list] [*]normal [*][b]bold[/b] [*][u]underline[/u] [*][i]italic[/i] [/list] What am I doing wrong? bye Ronald -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] BBCode?
I'm working on adding simple BBCode to my site. I'm currently using the [i] tag for testing, with the following code: ?php function bbcode($text){ $text = ereg_replace('\\[i\\](.{1,})\\[/i\\]','i\\1/i',$text); return $text; } print bbcode('[i]This[/i] is a [i]test[/i].'); ? But it prints iThis[/i] is a [i]test/i. Is there a better way to do this? -- The above message is encrypted with double rot13 encoding. Any unauthorized attempt to decrypt it will be prosecuted to the full extent of the law. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] bbcode
I'm planning to make a forum built into my site. I know all of the forums have bbcode, and I doubt they all programmed it themselves. Is there somewhere I can get the code for bbcode? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] bbcode
Why not download a forum, such as phpbb (www.phpbb.com) and check out their code? =) Jeff At 03:41 PM 2/22/2002 -0500, Leif K-Brooks wrote: I'm planning to make a forum built into my site. I know all of the forums have bbcode, and I doubt they all programmed it themselves. Is there somewhere I can get the code for bbcode? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php