Jump to content

bbcode problems


Noskiw

Recommended Posts

anything wrong with this?

 

<?php

function topic($input){ 

$input = htmlentities($input);
$basic_search = array('/\[b\](.*?)\[\/b\]/is', '/\[i\](.*?)\[\/i\]/is', '/\[u\](.*?)\[\/u\]/is', '/\[lb\]/is', '/\[url\=(.*?)\](.*?)\[\/url\]/is', '/\[img\](.*?)[/\img\]/is','/\[code](.*?)[\/code\]/is');
$basic_replace = array('<b>$1</b>', '<i>$1</i>', '<u>$1</u>', '<br>', '<a href="$1" target="_new" class="full">$2</a>', '<img src="$1"', '/>', '<font color=\"#CC0000\" size=\"2\" style=\"padding:2px;\">Code:</font><br><div id=\"code\"><tt>', '</tt></div>');
$str = preg_replace($basic_search, $basic_replace, $input);
return nl2br($str);

return nl2br(strip_tags(stripslashes(htmlspecialchars($input)))); 

} 

?>

 

because the posts arent showing up.

 

you can see it here, http://nostrich.freetzi.com/forum-index.php?act=topic&id=21&page=1

anything wrong with this?

 

<?php

function topic($input){ 

$input = htmlentities($input);
$basic_search = array('/\[b\](.*?)\[\/b\]/is', '/\[i\](.*?)\[\/i\]/is', '/\[u\](.*?)\[\/u\]/is', '/\[lb\]/is', '/\[url\=(.*?)\](.*?)\[\/url\]/is', '/\[img\](.*?)[/\img\]/is','/\[code](.*?)[\/code\]/is');
$basic_replace = array('<b>$1</b>', '<i>$1</i>', '<u>$1</u>', '<br>', '<a href="$1" target="_new" class="full">$2</a>', '<img src="$1"', '/>', '<font color=\"#CC0000\" size=\"2\" style=\"padding:2px;\">Code:</font><br><div id=\"code\"><tt>', '</tt></div>');
$str = preg_replace($basic_search, $basic_replace, $input);
return nl2br($str);

return nl2br(strip_tags(stripslashes(htmlspecialchars($input)))); 

} 

?>

 

because the posts arent showing up.

 

you can see it here, http://nostrich.freetzi.com/forum-index.php?act=topic&id=21&page=1

 

can we please keep it in the old format i had, because that one actually worked apart from the url one. and thats all i need help with. then i will almost have a complete forum system.

anything wrong with this?

 

<?php

function topic($input){ 

$input = htmlentities($input);
$basic_search = array('/\[b\](.*?)\[\/b\]/is', '/\[i\](.*?)\[\/i\]/is', '/\[u\](.*?)\[\/u\]/is', '/\[lb\]/is', '/\[url\=(.*?)\](.*?)\[\/url\]/is', '/\[img\](.*?)[/\img\]/is','/\[code](.*?)[\/code\]/is');
$basic_replace = array('<b>$1</b>', '<i>$1</i>', '<u>$1</u>', '<br>', '<a href="$1" target="_new" class="full">$2</a>', '<img src="$1"', '/>', '<font color=\"#CC0000\" size=\"2\" style=\"padding:2px;\">Code:</font><br><div id=\"code\"><tt>', '</tt></div>');
$str = preg_replace($basic_search, $basic_replace, $input);
return nl2br($str);

return nl2br(strip_tags(stripslashes(htmlspecialchars($input)))); 

} 

?>

 

because the posts arent showing up.

 

you can see it here, http://nostrich.freetzi.com/forum-index.php?act=topic&id=21&page=1

 

can we please keep it in the old format i had, because that one actually worked apart from the url one. and thats all i need help with. then i will almost have a complete forum system.

 

anyone gonna help? i'm seriously stuck

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.