if ($board_config['allow_smilies']) { $preview_subject = smilies_pass($preview_subject); } // End Smilies Invasion Mod //-- mod : quick title edition ------------------------------------------------- //-- delete /*-MOD $template->assign_vars(array( 'TOPIC_TITLE' => $preview_subject, MOD-*/ //-- add $attribute = $topic_attribute . ',' . $userdata['user_id'] . ',' . time(); $template->assign_vars(array('TOPIC_TITLE' => $qte->attr($preview_subject, $attribute), 'POST_SUBJECT' => $preview_subject, 'POSTER_NAME' => $preview_username, 'POST_DATE' => create_date($board_config['default_dateformat'], time(), $board_config['board_timezone']), 'MESSAGE' => $preview_message, 'L_POST_SUBJECT' => $lang['Post_subject'], 'L_PREVIEW' => $lang['Preview'], 'L_POSTED' => $lang['Posted'], 'L_POST' => $lang['Post'])); //-- mod : post description ---------------------------------------------------- //-- add display_sub_title('', $sub_title, $board_config['sub_title_length']); //-- fin mod : post description ------------------------------------------------ $template->assign_var_from_handle('POST_PREVIEW_BOX', 'preview'); } else { if ($error_msg != '') { $template->set_filenames(array('reg_header' => 'error_body.tpl')); $template->assign_vars(array('ERROR_MESSAGE' => $error_msg)); $template->assign_var_from_handle('ERROR_BOX', 'reg_header'); } } } else { // // User default entry point // $postreport = isset($HTTP_GET_VARS['postreport']) ? intval($HTTP_GET_VARS['postreport']) : 0; if ($postreport) {
$topic_mod = ''; if ($is_auth['auth_mod']) { $topic_mod .= '<div style="float:right; margin-right: 10px; display: inline-block;">'; $topic_mod .= '<span class="topicmod" id="tmod_' . $topic_id . '">'; $topic_mod .= "<a href=\"modcp.{$phpEx}?" . POST_TOPIC_URL . "={$topic_id}&mode=delete&sid=" . $userdata['session_id'] . '"><img src="' . $images['topic_mod_delete'] . '" alt="' . $lang['Delete_topic'] . '" title="' . $lang['Delete_topic'] . '" border="0" /></a> '; $topic_mod .= "<a href=\"modcp.{$phpEx}?" . POST_TOPIC_URL . "={$topic_id}&mode=move&sid=" . $userdata['session_id'] . '"><img src="' . $images['topic_mod_move'] . '" alt="' . $lang['Move_topic'] . '" title="' . $lang['Move_topic'] . '" border="0" /></a> '; $topic_mod .= $topic_rowset[$i]['topic_status'] == TOPIC_UNLOCKED ? "<a href=\"modcp.{$phpEx}?" . POST_TOPIC_URL . "={$topic_id}&mode=lock&sid=" . $userdata['session_id'] . '"><img src="' . $images['topic_mod_lock'] . '" alt="' . $lang['Lock_topic'] . '" title="' . $lang['Lock_topic'] . '" border="0" /></a> ' : "<a href=\"modcp.{$phpEx}?" . POST_TOPIC_URL . "={$topic_id}&mode=unlock&sid=" . $userdata['session_id'] . '"><img src="' . $images['topic_mod_unlock'] . '" alt="' . $lang['Unlock_topic'] . '" title="' . $lang['Unlock_topic'] . '" border="0" /></a> '; $topic_mod .= "<a href=\"modcp.{$phpEx}?" . POST_TOPIC_URL . "={$topic_id}&mode=split&sid=" . $userdata['session_id'] . '"><img src="' . $images['topic_mod_split'] . '" alt="' . $lang['Split_topic'] . '" title="' . $lang['Split_topic'] . '" border="0" /></a> '; $topic_mod .= '</span>'; $topic_mod .= '</div>'; } if ($board_config['allow_smilies']) { $topic_title = smilies_pass($topic_title); } $template->assign_block_vars('topicrow', array('ROW_COLOR' => $row_color, 'ROW_CLASS' => $row_class, 'FORUM_ID' => $forum_id, 'TOPIC_ID' => $topic_id, 'TOPIC_FOLDER_IMG' => $folder_image, 'HYPERCELL_CLASS' => get_hypercell_class($topic_rowset[$i]['topic_status'], $folder_image == $folder_new, $topic_rowset[$i]['topic_type'], $replies), 'TOPIC_AUTHOR' => $topic_author, 'GOTO_PAGE' => $goto_page, 'REPLIES' => $replies, 'NEWEST_POST_IMG' => $newest_post_img, 'TOPIC_ATTACHMENT_IMG' => topic_attachment_image($topic_rowset[$i]['topic_attachment']), 'TOPIC_TITLE' => $topic_title, 'TOPIC_TYPE' => $topic_type, 'VIEWS' => $views, 'FIRST_POST_TIME' => $first_post_time, 'LAST_POST_TIME' => $last_post_time, 'LAST_POST_AUTHOR' => $last_post_author, 'LAST_POST_IMG' => $last_post_url, 'TOPIC_MOD' => $topic_mod, 'L_TOPIC_FOLDER_ALT' => $folder_alt, 'U_VIEW_TOPIC' => $view_topic_url)); display_sub_title('topicrow', $topic_sub_title, $board_config['sub_title_length']); if (array_key_exists($i, $dividers)) { $template->assign_block_vars('topicrow.divider', array('L_DIV_HEADERS' => $dividers[$i])); } } $topics_count -= $total_announcements; $topics_count += $total_global_announcements; $template->assign_vars(array('PAGINATION' => generate_pagination("viewforum.{$phpEx}?" . POST_FORUM_URL . "={$forum_id}&topicdays={$topic_days}&sort={$sort_value}&order={$order_value}", $topics_count, $board_config['topics_per_page'], $start), 'PAGE_NUMBER' => sprintf($lang['Page_of'], floor($start / $board_config['topics_per_page']) + 1, ceil($topics_count / $board_config['topics_per_page'])), 'L_GOTO_PAGE' => $lang['Goto_page'])); // V: better add a switch rather than an ugly empty line at the bottom when no topics $template->assign_var('HAS_TOPICS', true); } else { // // No topics // $no_topics_msg = $forum_row['forum_status'] == FORUM_LOCKED ? $lang['Forum_locked'] : $lang['No_topics_post_one']; $template->assign_vars(array('L_NO_TOPICS' => $no_topics_msg));
if ($poster_id == ANONYMOUS) { $on_off_hidden = ''; } else { $on_off_hidden = '<img src="' . $images['icon_offline'] . '" alt="' . $lang['Offline'] . '" title="' . $lang['Offline'] . '" border="0" />'; } } } //Online/Offline // Start Smilies Invasion Mod if ($board_config['allow_smilies']) { $post_subject = smilies_pass($post_subject); } // End Smilies Invasion Mod $message = AddClicksCounter($message); $template->assign_block_vars('postrow', array('ROW_COLOR' => '#' . $row_color, 'ROW_CLASS' => $row_class, 'ADR_TOPIC_BOX' => $adr_topic_box, 'RABBITOSHI_LINK' => $rabbitoshi_link, 'POSTER_NAME' => $poster_id == ANONYMOUS ? $postrow[$i]['post_username'] != '' ? $postrow[$i]['post_username'] : $lang['Guest'] : $rcs->get_colors($postrow[$i], $postrow[$i]['username']), 'PAGERANK' => $PageRank, 'POSTER_RANK' => $poster_rank, 'POSTER_GENDER' => $gender_image, 'RANK_IMAGE' => $rank_image, 'POSTER_JOINED' => $poster_joined, 'POSTER_POSTS' => $poster_posts, 'POSTER_FROM' => $poster_from, 'POSTER_AVATAR' => $poster_avatar, 'POSTER_ONLINE' => $on_off_hidden, 'POST_DATE' => $post_date, 'POST_SUBJECT' => $post_subject, 'MESSAGE' => $message, 'POST_NUMBER' => $post_number, 'POST_ID' => $post_id, 'SIGNATURE' => $user_sig, 'EDITED_MESSAGE' => $l_edited_by, 'S_NUM_ROW' => $num_row, 'S_NAV_BUTTONS' => $nav_buttons, 'I_MINITIME' => $images['icon_minitime'], 'MINI_POST_IMG' => $mini_post_img, 'PROFILE_IMG' => $profile_img, 'PROFILE' => $profile, 'MINI_PROFILE_IMG' => $mini_profile_img, 'MINI_PROFILE' => $mini_profile, 'SEARCH_IMG' => $search_img, 'SEARCH' => $search, 'PM_IMG' => $pm_img, 'PM' => $pm, 'EMAIL_IMG' => $email_img, 'EMAIL' => $email, 'WWW_IMG' => $www_img, 'WWW' => $www, 'ICQ_STATUS_IMG' => $icq_status_img, 'ICQ_IMG' => $icq_img, 'ICQ' => $icq, 'AIM_IMG' => $aim_img, 'AIM' => $aim, 'MSN_IMG' => $msn_img, 'MSN' => $msn, 'YIM_IMG' => $yim_img, 'YIM' => $yim, 'EDIT_IMG' => $edit_img, 'EDIT' => $edit, 'QUOTE_IMG' => $quote_img, 'QUOTE' => $quote, 'IP_IMG' => $ip_img, 'IP' => $ip, 'DELETE_IMG' => $delpost_img, 'DELETE' => $delpost, 'I_QP_QUOTE' => $qp_quote_img, 'L_GENDER' => $lang['Gender'], 'POINTS' => $user_points, 'DONATE_POINTS' => $donate_points, 'USER_WARNINGS' => $user_warnings, 'CARD_IMG' => $card_img, 'CARD_HIDDEN_FIELDS' => $card_hidden, 'CARD_EXTRA_SPACE' => $r_card_img || $y_card_img || $g_card_img || $b_card_img ? ' ' : '', 'L_MINI_POST_ALT' => $mini_post_alt, 'KEEP_UNREAD_IMG' => $keep_unread_img, 'L_POST' => $lang['Post'], 'U_MINI_POST' => $mini_post_url, 'U_G_CARD' => $g_card_img, 'U_Y_CARD' => $y_card_img, 'U_R_CARD' => $r_card_img, 'U_B_CARD' => $b_card_img, 'S_CARD' => append_sid("card." . $phpEx), 'U_VIEW_POSTER_PROFILE' => $userdata['user_level'] != ADMIN ? append_sid("profile.{$phpEx}?mode=viewprofile&" . POST_USERS_URL . "=" . $poster_id) : append_sid("admin/admin_users.{$phpEx}?mode=edit&" . POST_USERS_URL . "=" . $poster_id . "&sid=" . $userdata['session_id']), 'POSTER_STYLE' => $poster_style_color, 'U_POST_ID' => $postrow[$i]['post_id'])); display_post_attachments($postrow[$i]['post_id'], $postrow[$i]['post_attachment']); //-- mod : birthday ------------------------------------------------------------ $birthday->display_details($poster_birthday, $poster_zodiac, false, 'postrow'); //-- mod : flags --------------------------------------------------------------- display_flag($poster_flag, false, 'postrow'); //-- mod : post description ---------------------------------------------------- display_sub_title('postrow', $post_sub_title, $board_config['sub_title_length']); //-- mod : topics enhanced ----------------------------------------------------- if ($i != $total_posts - 1) { $template->assign_block_vars('postrow.spacing', array()); } } include $phpbb_root_path . 'includes/functions_related.' . $phpEx; get_related_topics($topic_id); $template->pparse('body'); include $phpbb_root_path . 'includes/page_tail.' . $phpEx;
$topic_author .= $searchset[$i]['user_id'] != ANONYMOUS ? $searchset[$i]['username'] : ($searchset[$i]['post_username'] != '' ? $searchset[$i]['post_username'] : $lang['Guest']); $topic_author .= $searchset[$i]['user_id'] != ANONYMOUS ? '</a>' : ''; $first_post_time = create_date2($board_config['default_dateformat'], $searchset[$i]['topic_time'], $board_config['board_timezone']); $last_post_time = create_date2($board_config['default_dateformat'], $searchset[$i]['post_time'], $board_config['board_timezone']); $last_post_author_color = $rcs->get_colors($searchset[$i], '', false, 'group_id2', 'color2', 'level2'); $last_post_author = $searchset[$i]['id2'] == ANONYMOUS ? $searchset[$i]['post_username2'] != '' ? $searchset[$i]['post_username2'] : $lang['Guest'] : '<a href="' . append_sid('profile.' . $phpEx . '?mode=viewprofile&' . POST_USERS_URL . '=' . $searchset[$i]['id2']) . '"' . $last_post_author_color . '>' . $searchset[$i]['user2'] . '</a>'; $last_post_url = '<a href="' . append_sid("viewtopic.{$phpEx}?" . POST_POST_URL . '=' . $searchset[$i]['topic_last_post_id']) . '#' . $searchset[$i]['topic_last_post_id'] . '"><img src="' . $images['icon_latest_reply'] . '" alt="' . $lang['View_latest_post'] . '" title="' . $lang['View_latest_post'] . '" border="0" /></a>'; // Start Smilies Invasion Mod if ($board_config['allow_smilies']) { $searchset[$i]['forum_name'] = smilies_pass($searchset[$i]['forum_name']); $topic_title = smilies_pass($topic_title); } $template->assign_block_vars('searchresults', array('FORUM_NAME' => $searchset[$i]['forum_name'], 'FORUM_ID' => $forum_id, 'TOPIC_ID' => $topic_id, 'FOLDER' => $folder_image, 'NEWEST_POST_IMG' => $newest_post_img, 'TOPIC_FOLDER_IMG' => $folder_image, 'HYPERCELL_CLASS' => get_hypercell_class($searchset[$i]['topic_status'], $folder_image == $folder_new, $searchset[$i]['topic_type'], $replies), 'GOTO_PAGE' => $goto_page, 'REPLIES' => $replies, 'TOPIC_TITLE' => $topic_title, 'TOPIC_TYPE' => $topic_type, 'VIEWS' => $views, 'TOPIC_AUTHOR' => $topic_author, 'FIRST_POST_TIME' => $first_post_time, 'LAST_POST_TIME' => $last_post_time, 'LAST_POST_AUTHOR' => $last_post_author, 'LAST_POST_IMG' => $last_post_url, 'L_TOPIC_FOLDER_ALT' => $folder_alt, 'U_VIEW_FORUM' => $forum_url, 'U_VIEW_TOPIC' => $topic_url)); //-- mod : post description ---------------------------------------------------- //-- add display_sub_title('searchresults', $topic_sub_title, $board_config['sub_title_length']); //-- fin mod : post description ------------------------------------------------ } } $base_url = "search.{$phpEx}?search_id={$search_id}"; $template->assign_vars(array('PAGINATION' => generate_pagination($base_url, $total_match_count, $per_page, $start), 'PAGE_NUMBER' => sprintf($lang['Page_of'], floor($start / $per_page) + 1, ceil($total_match_count / $per_page)), 'L_AUTHOR' => $lang['Author'], 'L_MESSAGE' => $lang['Message'], 'L_FORUM' => $lang['Forum'], 'L_TOPICS' => $lang['Topics'], 'L_REPLIES' => $lang['Replies'], 'L_VIEWS' => $lang['Views'], 'L_POSTS' => $lang['Posts'], 'L_LASTPOST' => $lang['Last_Post'], 'L_POSTED' => $lang['Posted'], 'L_SUBJECT' => $lang['Subject'], 'L_GOTO_PAGE' => $lang['Goto_page'])); $template->pparse('body'); include $phpbb_root_path . 'includes/page_tail.' . $phpEx; } else { message_die(GENERAL_MESSAGE, $lang['No_search_match']); } } } // // Search forum //
function topic_review($topic_id, $is_inline_review) { global $db, $board_config, $template, $lang, $images, $theme, $phpEx, $phpbb_root_path; global $userdata, $user_ip; global $orig_word, $replacement_word; global $starttime; //-- mod : rank color system --------------------------------------------------- //-- add global $rcs, $get; //-- fin mod : rank color system ----------------------------------------------- if (!$is_inline_review) { if (!isset($topic_id) || !$topic_id) { message_die(GENERAL_MESSAGE, 'Topic_post_not_exist'); } // // Get topic info ... // $sql = "SELECT t.topic_title, f.forum_id, f.auth_view, f.auth_read, f.auth_post, f.auth_reply, f.auth_edit, f.auth_delete, f.auth_sticky, f.auth_announce, f.auth_pollcreate, f.auth_vote, f.auth_attachments \r\n\t\t\tFROM " . TOPICS_TABLE . " t, " . FORUMS_TABLE . " f \r\n\t\t\tWHERE t.topic_id = {$topic_id}\r\n\t\t\t\tAND f.forum_id = t.forum_id"; $tmp = ''; attach_setup_viewtopic_auth($tmp, $sql); if (!($result = $db->sql_query($sql))) { message_die(GENERAL_ERROR, 'Could not obtain topic information', '', __LINE__, __FILE__, $sql); } if (!($forum_row = $db->sql_fetchrow($result))) { message_die(GENERAL_MESSAGE, 'Topic_post_not_exist'); } $db->sql_freeresult($result); $forum_id = $forum_row['forum_id']; $topic_title = $forum_row['topic_title']; // // Start session management // $userdata = session_pagestart($user_ip, $forum_id); init_userprefs($userdata); // // End session management // $is_auth = array(); $is_auth = auth(AUTH_ALL, $forum_id, $userdata, $forum_row); if (!$is_auth['auth_read']) { message_die(GENERAL_MESSAGE, sprintf($lang['Sorry_auth_read'], $is_auth['auth_read_type'])); } } // // Define censored word matches // if (empty($orig_word) && empty($replacement_word)) { $orig_word = array(); $replacement_word = array(); obtain_word_list($orig_word, $replacement_word); } // // Dump out the page header and load viewtopic body template // if (!$is_inline_review) { $gen_simple_header = TRUE; $page_title = $lang['Topic_review'] . ' - ' . $topic_title; include $phpbb_root_path . 'includes/page_header.' . $phpEx; $template->set_filenames(array('reviewbody' => 'posting_topic_review.tpl')); } // // Go ahead and pull all data for this topic // $sql = "SELECT u.username, u.user_id, u.user_colortext, p.*, pt.post_text, pt.post_subject, pt.bbcode_uid\r\n\t\tFROM " . POSTS_TABLE . " p, " . USERS_TABLE . " u, " . POSTS_TEXT_TABLE . " pt\r\n\t\tWHERE p.topic_id = {$topic_id}\r\n\t\t\tAND p.poster_id = u.user_id\r\n\t\t\tAND p.post_id = pt.post_id\r\n\t\tORDER BY p.post_time DESC\r\n\t\tLIMIT " . $board_config['posts_per_page']; //-- mod : post description ---------------------------------------------------- //-- add $sql = str_replace(', pt.post_subject', ', pt.post_subject, pt.post_sub_title', $sql); //-- fin mod : post description ------------------------------------------------ //-- mod : rank color system --------------------------------------------------- //-- add $sql = str_replace('SELECT ', 'SELECT u.user_level, u.user_color, u.user_group_id, ', $sql); //-- fin mod : rank color system ----------------------------------------------- if (!($result = $db->sql_query($sql))) { message_die(GENERAL_ERROR, 'Could not obtain post/user information', '', __LINE__, __FILE__, $sql); } init_display_review_attachments($is_auth); // // Okay, let's do the loop, yeah come on baby let's do the loop // and it goes like this ... // if ($row = $db->sql_fetchrow($result)) { //-- mod : addon hide for bbcbxr ----------------------------------------------- //-- add $valid = false; if ($userdata['session_logged_in']) { $sql = 'SELECT p.poster_id, p.topic_id FROM ' . POSTS_TABLE . ' p WHERE p.topic_id = ' . $topic_id . ' AND p.poster_id = ' . $userdata['user_id']; $hideresult = $db->sql_query($sql); $valid = $db->sql_numrows($hideresult) ? true : false; } //-- fin mod : addon hide for bbcbxr ------------------------------------------- $mini_post_img = $images['icon_minipost']; $mini_post_alt = $lang['Post']; $i = 0; do { $poster_id = $row['user_id']; $poster = $row['username']; $post_date = create_date($board_config['default_dateformat'], $row['post_created'], $board_config['board_timezone']); // // Handle anon users posting with usernames // if ($poster_id == ANONYMOUS && $row['post_username'] != '') { $poster = $row['post_username']; $poster_rank = $lang['Guest']; } elseif ($poster_id == ANONYMOUS) { $poster = $lang['Guest']; $poster_rank = ''; } $post_subject = $row['post_subject'] != '' ? $row['post_subject'] : ''; //-- mod : post description ---------------------------------------------------- //-- add $post_sub_title = !empty($row['post_sub_title']) ? count($orig_word) ? preg_replace($orig_word, $replacement_word, $row['post_sub_title']) : $row['post_sub_title'] : ''; //-- fin mod : post description ------------------------------------------------ $message = $row['post_text']; $bbcode_uid = $row['bbcode_uid']; // // If the board has HTML off but the post has HTML // on then we process it, else leave it alone // if (!$board_config['allow_html'] && $row['enable_html']) { $message = preg_replace('#(<)([\\/]?.*?)(>)#is', '<\\2>', $message); } if ($bbcode_uid != "") { $message = $board_config['allow_bbcode'] ? bbencode_second_pass($message, $bbcode_uid) : preg_replace('/\\:[0-9a-z\\:]+\\]/si', ']', $message); //-- mod : addon hide for bbcbxr ----------------------------------------------- //-- add $message = bbencode_third_pass($message, $bbcode_uid, $valid); //-- fin mod : addon hide for bbcbxr ------------------------------------------- } $message = make_clickable($message); if (count($orig_word)) { $post_subject = preg_replace($orig_word, $replacement_word, $post_subject); $message = preg_replace($orig_word, $replacement_word, $message); } if ($board_config['allow_smilies'] && $row['enable_smilies']) { $message = smilies_pass($message); } $message = str_replace("\n", '<br />', $message); if ($board_config['allow_colortext']) { if ($row['user_colortext'] != '') { $message = '<font color="' . $row['user_colortext'] . '">' . $message . '</font>'; } } // // Again this will be handled by the templating // code at some point // $row_color = !($i % 2) ? $theme['td_color1'] : $theme['td_color2']; $row_class = !($i % 2) ? $theme['td_class1'] : $theme['td_class2']; // Start Smilies Invasion Mod if ($board_config['allow_smilies']) { $post_subject = smilies_pass($post_subject); } // End Smilies Invasion Mod $template->assign_block_vars('postrow', array('ROW_COLOR' => '#' . $row_color, 'ROW_CLASS' => $row_class, 'MINI_POST_IMG' => $mini_post_img, 'POSTER_NAME' => $poster_id == ANONYMOUS ? $row['post_username'] != '' ? $row['post_username'] : $lang['Guest'] : $rcs->get_colors($row, $row['username']), 'POST_DATE' => $post_date, 'POST_SUBJECT' => $post_subject, 'MESSAGE' => $message, 'L_MINI_POST_ALT' => $mini_post_alt)); display_review_attachments($row['post_id'], $row['post_attachment'], $is_auth); //-- mod : post description ---------------------------------------------------- //-- add display_sub_title('postrow', $post_sub_title, $board_config['sub_title_length']); //-- fin mod : post description ------------------------------------------------ $i++; } while ($row = $db->sql_fetchrow($result)); } else { message_die(GENERAL_MESSAGE, 'Topic_post_not_exist', '', __LINE__, __FILE__, $sql); } $db->sql_freeresult($result); $template->assign_vars(array('L_AUTHOR' => $lang['Author'], 'L_MESSAGE' => $lang['Message'], 'L_POSTED' => $lang['Posted'], 'L_POST_SUBJECT' => $lang['Post_subject'], 'L_TOPIC_REVIEW' => $lang['Topic_review'])); if (!$is_inline_review) { $template->pparse('reviewbody'); include $phpbb_root_path . 'includes/page_tail.' . $phpEx; } }