2013-04-03 65 views
0

我想將我的phpbb3論壇中的特定帖子整合到我網站的其他區域。格式化從phpbb3數據庫中提取的帖子數據

我已經寫了sql代碼來隔離正確的帖子,並提出正確的帖子,但它出來作爲一個巨大的雜亂的字符串。

phpbb3類中的內部方法將數據庫中的長混亂字符串格式化爲打開論壇時查看的格式正確的帖子,包括顯示附加圖像。

我正在做這個與PHP。

感謝

回答

1

我相信我以前的答案,略作修改的一個,可以爲您提供您所需要的信息。

Display the 5 most recent posts on an external page

簡短的回答你的問題是,這一塊的代碼。這將清理數據的各個方面。

 $topic_title  = $posts_row['topic_title']; 
    $post_author  = get_username_string('full', $posts_row['poster_id'], $posts_row['username'], $posts_row['user_colour']); 
    $post_date   = $user->format_date($posts_row['post_time']); 
    $post_link  = append_sid("{$phpbb_root_path}viewtopic.$phpEx", "p=" . $posts_row['post_id'] . "#p" . $posts_row['post_id']); 

    $post_text = nl2br($posts_row['post_text']); 

    $bbcode = new bbcode(base64_encode($bbcode_bitfield));   
    $bbcode->bbcode_second_pass($post_text, $posts_row['bbcode_uid'], $posts_row['bbcode_bitfield']); 

    $post_text = smiley_text($post_text); 

正如我在以前的答案提到,該代碼是基於Example 4的PHPBB的Wiki。