Some time ago I updated a board to 3.2.8. I noticed only today that some custom code is broken post that update.
I have some "plain viewtopic" pages of this kind since 2.x and 3.x -- always worked fine. They are basically like this:
Code: Select all
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/functions_display.' . $phpEx);
include($phpbb_root_path . 'includes/bbcode.' . $phpEx);
// Start session management
$user->session_begin();
$auth->acl($user->data);
$user->setup();
$pagination = $phpbb_container->get('pagination');
$bbcode_bitfield = '';
$sql = 'SELECT post_text, bbcode_uid, bbcode_bitfield FROM ' . POSTS_TABLE . " WHERE post_id = 123456";
$result = $db->sql_query_limit($sql, 1);
$row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
$message = "";
if ($row) {
$bbcode_bitfield = $bbcode_bitfield | base64_decode($row['bbcode_bitfield']);
if ($bbcode_bitfield !== '') {
$bbcode = new bbcode(base64_encode($bbcode_bitfield));
}
$message = $row['post_text'];
if ($row['bbcode_bitfield']) {
$bbcode->bbcode_second_pass($message, $row['bbcode_uid'], $row['bbcode_bitfield']);
}
$message = bbcode_nl2br($message);
$message = smiley_text($message);
}
$template->assign_vars(array(
'MESSAGE' => $message,
));
// Output the page
page_header("foo foo foo", false);
$template->set_filenames(array(
'body' => 'whatever.html')
);
page_footer();
I tried snooping the code of 3.2.8 and simplified the above with just:
Code: Select all
if ($row) {
$uid = $row['bbcode_uid'];
$bitfield = $row['bbcode_bitfield'];
$message = $row['post_text'];
$bbcode = new bbcode($bitfield);
$bbcode->bbcode_second_pass($message, $uid);
$message = bbcode_nl2br($message);
$message = smiley_text($message);
}
Thanks