хочу отображать ветку форума на своей странице с поддержкой бб кодов, сам вывод текстовки на странице труда не составил, а вот чтобы подключить бб форматирование не катит

в начале кода вставил
- Код: выделить все
define('PHPBB_ROOT_PATH', './forum/');
define('IN_PHPBB', true);
$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.' . $phpEx);
include($phpbb_root_path . 'includes/bbcode.' . $phpEx);
include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
в месте где должно отображаться форумная ветка
- Код: выделить все
$db1=mysql_connect(HostName,UserName,Password);// подключение к mysql
mysql_select_db(DBName,$db1);// подключение к базе данных
$sqlUTF = @"set names utf8";//Волшебный запросик чтобы вопросиков не было
@mysql_query($sqlUTF,$db1);
$sql = "SELECT *,FROM_UNIXTIME( post_time ) AS post_date FROM phpbb_posts WHERE topic_id=$topic and forum_id=$forum order by post_id desc";
$res=@mysql_query($sql,$db1);
//echo($sql);
$nmax=@mysql_num_rows($res);
for ($n=0;$n<$nmax;$n++)
{
$stime=mysql_result($res,$n,"post_date");
$stopic=mysql_result($res,$n,"post_subject");
$message=mysql_result($res,$n,"post_text");
$post_id=mysql_result($res,$n,"post_id");
$topic_id=mysql_result($res,$n,"topic_id");
$forum_id=mysql_result($res,$n,"forum_id");
$bbcode = new bbcode(base64_encode(true));
$message = censor_text($message);
$bbcode->bbcode_second_pass($message, '', true);
$message = str_replace("\n", '<br />', $message);
$message = smiley_text($message);
printf("<b>$stime - $stopic</b><br> $message<br>");
}
@mysql_close($db1);
Warning: Cannot modify header information - headers already sent by (output started at W:\home\localhost\www\akc\news.php:8) in W:\home\localhost\www\akc\forum\includes\functions.php on line 3553
Fatal error: Call to a member function sql_close() on a non-object in W:\home\localhost\www\akc\forum\includes\functions.php on line 4432
при отключении строк
- Код: выделить все
$bbcode = new bbcode(base64_encode(true));
$bbcode->bbcode_second_pass($message, '', true);
или замене
true на
false отображается без ошибок, но и без форматирования