$author = $bbcode->make_clickable($author); // Mighty Gorgon: shall we still need these utf8_encode? /* $topic_title = utf8_encode($topic_title); $post_subject = utf8_encode($post_subject); $message = utf8_encode($message); */ // Assign "item" variables to template $template->assign_block_vars('post_item', array( 'POST_URL' => $viewpost_url . '?' . POST_POST_URL . '=' . $post['post_id'] . '#p' . $post['post_id'], 'FIRST_POST_URL' => $viewpost_url . '?' . POST_POST_URL . '=' . $post['topic_first_post_id'] . '#p' . $post['topic_first_post_id'], 'REPLY_URL' => $replypost_url . '&' . POST_POST_URL . '=' . $post['post_id'], 'AUTHOR0' => htmlspecialchars($author0), 'ATOM_TIME' => gmdate('Y-m-d\TH:i:s', $post['post_time']) . 'Z', 'ATOM_TIME_M' => (($post['post_edit_time'] <> '') ? gmdate('Y-m-d\TH:i:s', $post['post_edit_time']) . 'Z' : gmdate('Y-m-d\TH:i:s', $post['post_time']) . 'Z'), 'UTF_TIME' => RSSTimeFormat($post['post_time'],$user->data['user_timezone']), 'FORUM_NAME' => $post['forum_name'], //'TOPIC_TITLE' => htmlspecialchars($bbcode->undo_htmlspecialchars($topic_title)), 'TOPIC_TITLE' => $bbcode->undo_htmlspecialchars($topic_title), 'AUTHOR' => $author, 'POST_TIME' => create_date($config['default_dateformat'], $post['post_time'], $config['board_timezone']) . ' (GMT ' . $config['board_timezone'] . ')', 'POST_SUBJECT' => $post_subject, //'POST_TEXT' => htmlspecialchars(preg_replace('|[\x00-\x08\x0B\x0C\x0E-\x1f]|', '', $message)), 'POST_TEXT' => $message, 'USER_SIG' => $user_sig, 'TOPIC_REPLIES' => $post['topic_replies'] ) );
if ($post['post_id'] != $post['topic_first_post_id']) { $topic_title = 'RE: ' . $topic_title; } // Variable reassignment and reformatting for author $author = $post['username']; $author0 = $author; if ($post['user_id'] != -1) { $author = '<a href="' . $index_url . 'profile.' . $phpEx . '?mode=viewprofile&u=' . $post['user_id'] . '" target="_blank">' . $author . '</a>'; } else { // Uncomment next string if you want or $author0=='Anonymus'. // $author0= $post['post_username']; $author = $post['post_username']; } $author = make_clickable($author); // Assign "item" variables to template $template->assign_block_vars('post_item', array('POST_URL' => $viewpost_url . '?' . POST_POST_URL . '=' . $post['post_id'] . '#' . $post['post_id'], 'FIRST_POST_URL' => $viewpost_url . '?' . POST_POST_URL . '=' . $post['topic_first_post_id'] . '#' . $post['topic_first_post_id'], 'REPLY_URL' => $replypost_url . "&" . POST_POST_URL . "=" . $post['post_id'], 'TOPIC_TITLE' => htmlspecialchars(undo_htmlspecialchars($topic_title)), 'AUTHOR0' => htmlspecialchars($author0), 'AUTHOR' => htmlspecialchars($author), 'POST_TIME' => create_date($board_config['default_dateformat'], $post['post_time'], $board_config['board_timezone']) . ' (GMT ' . $board_config['board_timezone'] . ')', 'ATOM_TIME' => gmdate("Y-m-d\\TH:i:s", $post['post_time']) . "Z", 'ATOM_TIME_M' => $post['post_edit_time'] != "" ? gmdate("Y-m-d\\TH:i:s", $post['post_edit_time']) . "Z" : gmdate("Y-m-d\\TH:i:s", $post['post_time']) . "Z", 'POST_SUBJECT' => $post_subject, 'FORUM_NAME' => htmlspecialchars($post['forum_name']), 'UTF_TIME' => RSSTimeFormat($post['post_time'], $userdata['user_timezone']), 'POST_TEXT' => htmlspecialchars(preg_replace('|[\\x00-\\x08\\x0B\\x0C\\x0E-\\x1f]|', '', $message)), 'USER_SIG' => htmlspecialchars($user_sig), 'TOPIC_REPLIES' => $post['topic_replies'])); } // // END "item" loop // if ($user_id != ANONYMOUS && UPDATE_VIEW_COUNT) { $updlist = ''; foreach ($SeenTopics as $topic_id => $tcount) { $updlist .= empty($updlist) ? $topic_id : "," . $topic_id; if (defined('TOPIC_VIEW_TABLE') and AUTO_WVT_MOD) { $sql = 'UPDATE ' . TOPIC_VIEW_TABLE . ' SET topic_id="' . $topic_id . '", view_time="' . time() . '", view_count=view_count+1 WHERE topic_id=' . $topic_id . ' AND user_id=' . $user_id; if (!$db->sql_query($sql) || !$db->sql_affectedrows()) { $sql = 'INSERT IGNORE INTO ' . TOPIC_VIEW_TABLE . ' (topic_id, user_id, view_time,view_count) VALUES (' . $topic_id . ', "' . $user_id . '", "' . time() . '","1")'; if (!$db->sql_query($sql)) { ExitWithHeader("500 Internal Server Error", 'Error create user view topic information');