0
votes

I want to integrate specific posts from my phpbb3 forum into other areas of my website.

I have already written the sql code to isolate the right posts and pull out the right post, but it comes out as one giant messy string.

What internal method inside the phpbb3 classes formats the long mess string from the data base into the properly formatted post that you view when you open the forum, including displaying attached images.

I am doing this with php.

Thanks

1

1 Answers

1
votes

I believe one of my previous answers, slightly modified, can provide you with information you need.

Display the 5 most recent posts on an external page

The short answer to your question is this chunk of code. This will clean up various aspects of your data.

     $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);

As I mention in the previous answer, that code is based on Example 4 the PHPBB Wiki.