diff --git a/phpBB/language/en/lang_main.php b/phpBB/language/en/lang_main.php index a96d77aded..75447faf8d 100644 --- a/phpBB/language/en/lang_main.php +++ b/phpBB/language/en/lang_main.php @@ -27,64 +27,65 @@ $lang = array_merge($lang, array( 'DATE_FORMAT' => 'd M Y', 'FORUM' => 'Forum', - 'Subforum' => 'Subforum', - 'Subforums' => 'Subforums', - 'Category' => 'Category', + 'SUBFORUM' => 'Subforum', + 'SUBFORUMS' => 'Subforums', + 'CATEGORY' => 'Category', 'TOPIC' => 'Topic', 'TOPICS' => 'Topics', 'REPLIES' => 'Replies', 'VIEWS' => 'Views', 'POST' => 'Post', 'POSTS' => 'Posts', - 'Posted' => 'Posted', + 'POSTED' => 'Posted', 'RATING' => 'Rating', 'USERNAME' => 'Username', 'PASSWORD' => 'Password', - 'Email' => 'Email', - 'Poster' => 'Poster', - 'Author' => 'Author', - 'Time' => 'Time', - 'Hours' => 'Hours', - 'Message' => 'Message', - '1_Day' => '1 Day', - '7_Days' => '7 Days', - '2_Weeks' => '2 Weeks', - '1_Month' => '1 Month', - '3_Months' => '3 Months', - '6_Months' => '6 Months', - '1_Year' => '1 Year', - 'Ascending' => 'Ascending', - 'Descending' => 'Descending', - 'Post_time' => 'Post time', - 'Go' => 'Go', - 'Jump_to' => 'Jump to', + 'EMAIL' => 'Email', + 'POSTER' => 'Poster', + 'AUTHOR' => 'Author', + 'TIME' => 'Time', + 'HOURS' => 'Hours', + 'MESSAGE' => 'Message', + '1_DAY' => '1 Day', + '7_DAYS' => '7 Days', + '2_WEEKS' => '2 Weeks', + '1_MONTH' => '1 Month', + '3_MONTHS' => '3 Months', + '6_MONTHS' => '6 Months', + '1_YEAR' => '1 Year', + 'ASCENDING' => 'Ascending', + 'DESCENDING' => 'Descending', + 'POST_TIME' => 'Post time', + 'GO' => 'Go', + 'JUMP_TO' => 'Jump to', 'SUBMIT' => 'Submit', - 'Reset' => 'Reset', + 'RESET' => 'Reset', 'CANCEL' => 'Cancel', 'PREVIEW' => 'Preview', - 'Confirm' => 'Confirm', - 'Delete' => 'Delete', + 'CONFIRM' => 'Confirm', + 'DELETE' => 'Delete', 'SPELLCHECK' => 'Spellcheck', 'YES' => 'Yes', 'NO' => 'No', - 'Enabled' => 'Enabled', - 'Disabled' => 'Disabled', - 'Error' => 'Error', - 'Next' => 'Next', - 'Previous' => 'Previous', - 'Goto_page' => 'Goto page', - 'Start_page' => 'Make my start page', - 'Joined' => 'Joined', - 'IP_Address' => 'IP Address', - 'Select_forum' => 'Select a forum', - 'View_latest_post' => 'View latest post', - 'View_newest_post' => 'View newest post', - 'Page_of' => 'Page %d of %d', + 'ENABLED' => 'Enabled', + 'DISABLED' => 'Disabled', + 'ERROR' => 'Error', + 'NEXT' => 'Next', + 'PREVIOUS' => 'Previous', + 'GOTO_PAGE' => 'Goto page', + 'START_PAGE' => 'Make my start page', + 'JOINED' => 'Joined', + 'IP_ADDRESS' => 'IP Address', + 'SELECT_FORUM' => 'Select a forum', + 'VIEW_LATEST_POST' => 'View latest post', + 'VIEW_NEWEST_POST' => 'View newest post', + 'PAGE_OF' => 'Page %d of %d', 'ICQ' => 'ICQ Number', 'AIM' => 'AIM Address', 'MSNM' => 'MSN Messenger', 'YIM' => 'Yahoo Messenger', - 'Forum_Index' => 'Board Index', + 'Forum_Index' => 'Board Index', + 'Post_new_topic' => 'Post new topic', 'Reply_to_topic' => 'Reply to topic', 'Reply_with_quote' => 'Reply with quote', @@ -215,26 +216,26 @@ $lang = array_merge($lang, array( 'No_longer_watching_forum' => 'You are no longer watching this forum', 'You_are_watching_forum' => 'You are now watching this forum', 'View_topic' => 'View topic', - 'Guest' => 'Guest', + 'GUEST' => 'Guest', 'POST_SUBJECT' => 'Post subject', 'PRINT_TOPIC' => 'Printable version', - 'View_next_topic' => 'View next topic', - 'View_previous_topic' => 'View previous topic', - 'Submit_vote' => 'Submit Vote', - 'View_results' => 'View Results', + 'VIEW_NEXT_TOPIC' => 'View next topic', + 'VIEW_PREVIOUS_TOPIC' => 'View previous topic', + 'VIEW_RESULTS' => 'View Results', 'No_newer_topics' => 'There are no newer topics in this forum', 'No_older_topics' => 'There are no older topics in this forum', 'Topic_post_not_exist' => 'The topic or post you requested does not exist', - 'No_posts_topic' => 'No posts exist for this topic', - 'Display_posts' => 'Display posts from previous', - 'All_Posts' => 'All Posts', - 'Back_to_top' => 'Back to top', - 'Read_profile' => 'View users profile', - 'Send_email' => 'Send email', - 'Visit_website' => 'Visit posters website', - 'ICQ_status' => 'ICQ Status', - 'Edit_delete_post' => 'Edit/Delete this post', - 'View_IP' => 'View IP of poster', + 'No_posts_topic' => 'No posts exist for this topic', + 'POST_BELOW_KARMA' => 'This post was made by user %s whose karma is below your desired minimum. To display this post click %sHERE%s.', + 'DISPLAY_POSTS' => 'Display posts from previous', + 'ALL_POSTS' => 'All Posts', + 'BACK_TO_TOP' => 'Back to top', + 'READ_PROFILE' => 'View users profile', + 'SEND_EMAIL' => 'Send email', + 'VISIT_WEBSITE' => 'Visit posters website', + 'ICQ_STATUS' => 'ICQ Status', + 'EDIT_DELETE_POST' => 'Edit/Delete this post', + 'VIEW_IP' => 'View IP of poster', 'DELETE_POST' => 'Delete this post', 'DELETE_POST_WARN' => 'Once deleted the post cannot be recovered', 'wrote' => 'wrote', @@ -242,13 +243,13 @@ $lang = array_merge($lang, array( 'Code' => 'Code', 'Edited_time_total' => 'Last edited by %s on %s, edited %d time in total', 'Edited_times_total' => 'Last edited by %s on %s, edited %d times in total', - 'Quick_mod' => 'Quick-mod tools', - 'Lock_topic' => 'Lock topic', - 'Unlock_topic' => 'Unlock topic', - 'Move_topic' => 'Move topic', - 'Delete_topic' => 'Delete topic', - 'Split_topic' => 'Split topic', - 'Merge_topic' => 'Merge topic', + 'QUICK_MOD' => 'Quick-mod tools', + 'LOCK_TOPIC' => 'Lock topic', + 'UNLOCK_TOPIC' => 'Unlock topic', + 'MOVE_TOPIC' => 'Move topic', + 'DELETE_TOPIC' => 'Delete topic', + 'SPLIT_TOPIC' => 'Split topic', + 'MERGE_TOPIC' => 'Merge topic', 'Stop_watching_topic' => 'Stop watching this topic', 'Start_watching_topic' => 'Watch this topic for replies', 'No_longer_watching_topic' => 'You are no longer watching this topic', @@ -430,11 +431,11 @@ $lang = array_merge($lang, array( 'Profile_info_warn' => 'This information will be publicly viewable', 'Avatar_panel' => 'Avatar control panel', 'Avatar_gallery' => 'Avatar gallery', - 'Website' => 'Website', - 'Location' => 'Location', - 'Contact' => 'Contact', - 'Email_address' => 'Email address', - 'Send_private_message' => 'Send private message', + 'WEBSITE' => 'Website', + 'LOCATION' => 'Location', + 'CONTACT' => 'Contact', + 'EMAIL_ADDRESS' => 'Email address', + 'SEND_PRIVATE_MESSAGE' => 'Send private message', 'Hidden_email' => '[ Hidden ]', 'Search_user_posts' => 'Find all posts by %s', 'Interests' => 'Interests', diff --git a/phpBB/templates/subSilver/viewtopic_body.html b/phpBB/templates/subSilver/viewtopic_body.html index 85aebbcc0c..461b619253 100644 --- a/phpBB/templates/subSilver/viewtopic_body.html +++ b/phpBB/templates/subSilver/viewtopic_body.html @@ -85,6 +85,15 @@ {L_MESSAGE} + + + + + + + {postrow.L_IGNORE_POST} + + @@ -123,6 +132,7 @@ + diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php index 9a955e6c2f..454cceb2a5 100644 --- a/phpBB/viewtopic.php +++ b/phpBB/viewtopic.php @@ -42,7 +42,7 @@ $user->start(); // Find topic id if user requested a newer or older topic if (isset($_GET['view']) && empty($post_id)) { - if ($_GET['view'] == 'newest' || $_GET['view'] == 'latest') + if ($_GET['view'] == 'newest') { if ($user->session_id) { @@ -64,10 +64,10 @@ if (isset($_GET['view']) && empty($post_id)) $post_id = $row['post_id']; $newest_post_id = $post_id; -// redirect("viewtopic.$phpEx$SID&p=$post_id#$post_id"); + redirect("viewtopic.$phpEx$SID&p=$post_id#$post_id"); } -// redirect("index.$phpEx"); + redirect("index.$phpEx"); } else if ($_GET['view'] == 'next' || $_GET['view'] == 'previous') { @@ -167,9 +167,13 @@ $s_watching_topic = ''; $s_watching_topic_img = ''; watch_topic_forum('topic', $s_watching_topic, $s_watching_topic_img, $user->data['user_id'], $topic_id, $notify_status); + + + + // Post ordering options -$previous_days = array(0 => $user->lang['All_Posts'], 1 => $user->lang['1_Day'], 7 => $user->lang['7_Days'], 14 => $user->lang['2_Weeks'], 30 => $user->lang['1_Month'], 90 => $user->lang['3_Months'], 180 => $user->lang['6_Months'], 364 => $user->lang['1_Year']); -$sort_by_text = array('a' => $user->lang['Author'], 't' => $user->lang['Post_time'], 's' => $user->lang['Subject']); +$previous_days = array(0 => $user->lang['ALL_POSTS'], 1 => $user->lang['1_DAY'], 7 => $user->lang['7_DAYS'], 14 => $user->lang['2_WEEKS'], 30 => $user->lang['1_MONTH'], 90 => $user->lang['3_MONTHS'], 180 => $user->lang['6_MONTHS'], 364 => $user->lang['1_YEAR']); +$sort_by_text = array('a' => $user->lang['AUTHOR'], 't' => $user->lang['POST_TIME'], 's' => $user->lang['SUBJECT']); $sort_by = array('a' => 'u.username', 't' => 'p.post_id', 's' => 'pt.post_subject'); if (isset($_POST['sort'])) @@ -227,7 +231,7 @@ foreach ($sort_by_text as $key => $text) $select_sort .= ''; $select_sort_dir = ''; $select_post_days = ''; + + + + + $sql = "SELECT * FROM " . RANKS_TABLE; $result = $db->sql_query($sql); @@ -249,27 +258,9 @@ while ($row = $db->sql_fetchrow($result)) } $db->sql_freeresult($result); -$rating = ''; -if ($user->data['user_id'] != ANONYMOUS) -{ - $rating_text = array(-5 => $user->lang['Very_poor'], -2 => $user->lang['Quite_poor'], 0 => $user->lang['Unrated'], 2 => $user->lang['Quite_good'], 5 => $user->lang['Very_good']); - $sql = "SELECT rating - FROM " . TOPICS_RATINGS_TABLE . " - WHERE topic_id = $topic_id - AND user_id = " . $user->data['user_id']; - $result = $db->sql_query($sql); - $user_rating = ($row = $db->sql_fetchrow($result)) ? $row['rating'] : 0; - for($i = -5; $i < 6; $i++) - { - $selected = ($user_rating == $i) ? ' selected="selected"' : ''; - $rating .= ''; - } - - $rating = ''; -} // Was a highlight request part of the URI? $highlight_match = $highlight = ''; @@ -295,11 +286,11 @@ $s_forum_rules = ''; get_forum_rules('topic', $s_forum_rules, $forum_id); $topic_mod = ''; -$topic_mod .= ($auth->acl_gets('m_lock', 'a_', $forum_id)) ? ((intval($topic_status) == ITEM_UNLOCKED) ? '' : '') : ''; -$topic_mod .= ($auth->acl_gets('m_delete', 'a_', $forum_id)) ? '' : ''; -$topic_mod .= ($auth->acl_gets('m_move', 'a_', $forum_id)) ? '' : ''; -$topic_mod .= ($auth->acl_gets('m_split', 'a_', $forum_id)) ? '' : ''; -$topic_mod .= ($auth->acl_gets('m_merge', 'a_', $forum_id)) ? '' : ''; +$topic_mod .= ($auth->acl_gets('m_lock', 'a_', $forum_id)) ? ((intval($topic_status) == ITEM_UNLOCKED) ? '' : '') : ''; +$topic_mod .= ($auth->acl_gets('m_delete', 'a_', $forum_id)) ? '' : ''; +$topic_mod .= ($auth->acl_gets('m_move', 'a_', $forum_id)) ? '' : ''; +$topic_mod .= ($auth->acl_gets('m_split', 'a_', $forum_id)) ? '' : ''; +$topic_mod .= ($auth->acl_gets('m_merge', 'a_', $forum_id)) ? '' : ''; // If we've got a hightlight set pass it on to pagination. $pagination = ($highlight_match) ? generate_pagination("viewtopic.$phpEx$SID&t=$topic_id&postdays=$post_days&postorder=$post_order&highlight=$highlight", $topic_replies, $config['posts_per_page'], $start) : generate_pagination("viewtopic.$phpEx$SID&t=$topic_id&postdays=$post_days&postorder=$post_order", $topic_replies, $config['posts_per_page'], $start); @@ -335,9 +326,6 @@ if (count($orig_word)) $topic_title = preg_replace($orig_word, $replacement_word, $topic_title); } - - - // Navigation links ... common to several scripts so we need // to look at centralising this ... major issue is variable naming // complicated particularly by viewtopic ... @@ -385,6 +373,9 @@ $template->assign_block_vars('navlinks', array( $forum_moderators = array(); get_moderators($forum_moderators, $forum_id); + + + $server_path = (($config['cookie_secure']) ? 'https://' : 'http://' ) . trim($config['server_name']) . (($config['server_port'] <> 80) ? ':' . trim($config['server_port']) . '/' : '/') . trim($config['script_path']) . '/'; // Send vars to template @@ -396,30 +387,12 @@ $template->assign_vars(array( 'TOPIC_TITLE' => $topic_title, 'PAGINATION' => $pagination, 'PAGE_NUMBER' => on_page($topic_replies, $config['posts_per_page'], $start), - 'MOD_CP' => ($auth->acl_gets('m_', 'a_', $forum_id)) ? sprintf($user->lang['MCP'], '', '') : '', + 'MCP' => ($auth->acl_gets('m_', 'a_', $forum_id)) ? sprintf($user->lang['MCP'], '', '') : '', 'MODERATORS' => (sizeof($forum_moderators[$forum_id])) ? implode(', ', $forum_moderators[$forum_id]) : $user->lang['None'], 'POST_IMG' => $post_img, 'REPLY_IMG' => $reply_img, - 'L_AUTHOR' => $user->lang['Author'], - 'L_MESSAGE' => $user->lang['Message'], - 'L_POSTED' => $user->lang['Posted'], - 'L_POST_SUBJECT' => $user->lang['Post_subject'], - 'L_VIEW_NEXT_TOPIC' => $user->lang['View_next_topic'], - 'L_VIEW_PREVIOUS_TOPIC' => $user->lang['View_previous_topic'], - 'L_BACK_TO_TOP' => $user->lang['Back_to_top'], - 'L_DISPLAY_POSTS' => $user->lang['Display_posts'], - 'L_LOCK_TOPIC' => $user->lang['Lock_topic'], - 'L_UNLOCK_TOPIC' => $user->lang['Unlock_topic'], - 'L_MOVE_TOPIC' => $user->lang['Move_topic'], - 'L_SPLIT_TOPIC' => $user->lang['Split_topic'], - 'L_DELETE_TOPIC' => $user->lang['Delete_topic'], - 'L_GOTO_PAGE' => $user->lang['Goto_page'], - 'L_SORT_BY' => $user->lang['Sort_by'], - 'L_RATE_TOPIC' => $user->lang['Rate_topic'], - 'L_QUICK_MOD' => $user->lang['Quick_mod'], - 'S_TOPIC_LINK' => 't', 'S_SELECT_SORT_DIR' => $select_sort_dir, 'S_SELECT_SORT_KEY' => $select_sort, @@ -428,7 +401,7 @@ $template->assign_vars(array( 'S_TOPIC_ACTION' => "viewtopic.$phpEx$SID&t=" . $topic_id . "&start=$start", 'S_AUTH_LIST' => $s_forum_rules, 'S_TOPIC_MOD' => ( $topic_mod != '' ) ? '' : '', - 'S_MOD_ACTION' => "modcp.$phpEx$SID&t=$topic_id", + 'S_MOD_ACTION' => "mcp.$phpEx$SID&t=$topic_id", 'S_WATCH_TOPIC' => $s_watching_topic, 'U_VIEW_TOPIC' => "viewtopic.$phpEx$SID&t=$topic_id&start=$start&postdays=$post_days&postorder=$post_order&highlight=$highlight", @@ -456,6 +429,10 @@ $nav_links['up'] = array( 'title' => $forum_name ); + + + + // Does this topic contain a poll? if (!empty($poll_start)) { @@ -523,12 +500,15 @@ if (!empty($poll_start)) ); } + + + // Container for user details, only process once -$poster_details = array(); +$user_cache = $attach_list = array(); $i = 0; // Go ahead and pull all data for this topic -$sql = "SELECT u.username, u.user_id, u.user_posts, u.user_from, u.user_website, u.user_email, u.user_icq, u.user_aim, u.user_yim, u.user_regdate, u.user_msnm, u.user_viewemail, u.user_rank, u.user_sig, u.user_sig_bbcode_uid, u.user_avatar, u.user_avatar_type, u.user_allowavatar, u.user_allowsmile, p.*, pt.post_text, pt.post_subject, pt.bbcode_uid +$sql = "SELECT u.username, u.user_id, u.user_posts, u.user_from, u.user_karma, u.user_website, u.user_email, u.user_icq, u.user_aim, u.user_yim, u.user_regdate, u.user_msnm, u.user_viewemail, u.user_rank, u.user_sig, u.user_sig_bbcode_uid, u.user_avatar, u.user_avatar_type, p.*, pt.post_text, pt.post_subject, pt.bbcode_uid FROM " . POSTS_TABLE . " p, " . USERS_TABLE . " u, " . POSTS_TEXT_TABLE . " pt WHERE p.topic_id = $topic_id AND p.post_approved = " . TRUE . " @@ -544,42 +524,58 @@ if ($row = $db->sql_fetchrow($result)) do { $poster_id = $row['user_id']; - $poster = (!$poster_id) ? $user->lang['Guest'] : $row['username']; + $poster = (!$poster_id) ? $user->lang['GUEST'] : $row['username']; - $poster_posts = ($row['user_id']) ? $user->lang['Posts'] . ': ' . $row['user_posts'] : ''; - - $poster_from = ($row['user_from'] && $row['user_id']) ? $user->lang['Location'] . ': ' . $row['user_from'] : ''; - - if (!isset($poster_details[$poster_id]['joined'])) + // Should we display this post? At present this is just karma but + // it will also check the ignore list in future ... outputting the + // appropriate message of course. + if ($row['user_karma'] < $user->data['user_min_karma'] && (empty($_GET['view']) || $_GET['view'] != 'karma' || $post_id != $row['post_id'])) { - $poster_details[$poster_id]['joined'] = ($row['user_id']) ? $user->lang['Joined'] . ': ' . $user->format_date($row['user_regdate'], $user->lang['DATE_FORMAT']) : ''; + $template->assign_block_vars('postrow', array( + 'S_BELOW_MIN_KARMA' => true, + 'S_ROW_COUNT' => $i++, + + 'L_IGNORE_POST' => sprintf($user->lang['POST_BELOW_KARMA'], $poster, '', '')) + ); + + continue; } - if (isset($poster_details[$poster_id]['avatar'])) + // Display the post + $poster_posts = ($row['user_id']) ? $user->lang['POSTS'] . ': ' . $row['user_posts'] : ''; + + $poster_from = ($row['user_from'] && $row['user_id']) ? $user->lang['LOCATION'] . ': ' . $row['user_from'] : ''; + + if (!isset($user_cache[$poster_id]['joined'])) + { + $user_cache[$poster_id]['joined'] = ($row['user_id']) ? $user->lang['JOINED'] . ': ' . $user->format_date($row['user_regdate'], $user->lang['DATE_FORMAT']) : ''; + } + + if (isset($user_cache[$poster_id]['avatar'])) { if ($row['user_avatar_type'] && $poster_id && $row['user_allowavatar']) { switch ($row['user_avatar_type']) { case USER_AVATAR_UPLOAD: - $poster_details[$poster_id]['avatar'] = ($config['allow_avatar_upload']) ? '' : ''; + $user_cache[$poster_id]['avatar'] = ($config['allow_avatar_upload']) ? '' : ''; break; case USER_AVATAR_REMOTE: - $poster_details[$poster_id]['avatar'] = ($config['allow_avatar_remote']) ? '' : ''; + $user_cache[$poster_id]['avatar'] = ($config['allow_avatar_remote']) ? '' : ''; break; case USER_AVATAR_GALLERY: - $poster_details[$poster_id]['avatar'] = ($config['allow_avatar_local']) ? '' : ''; + $user_cache[$poster_id]['avatar'] = ($config['allow_avatar_local']) ? '' : ''; break; } } else { - $poster_details[$poster_id]['avatar'] = ''; + $user_cache[$poster_id]['avatar'] = ''; } } // Generate ranks, set them to empty string initially. - if (!isset($poster_details[$poster_id]['rank_title'])) + if (!isset($user_cache[$poster_id]['rank_title'])) { if ($row['user_rank']) { @@ -587,8 +583,8 @@ if ($row = $db->sql_fetchrow($result)) { if ($row['user_rank'] == $ranksrow[$j]['rank_id'] && $ranksrow[$j]['rank_special']) { - $poster_details[$poster_id]['rank_title'] = $ranksrow[$j]['rank_title']; - $poster_details[$poster_id]['rank_image'] = ($ranksrow[$j]['rank_image']) ? '' . $poster_rank . '
' : ''; + $user_cache[$poster_id]['rank_title'] = $ranksrow[$j]['rank_title']; + $user_cache[$poster_id]['rank_image'] = ($ranksrow[$j]['rank_image']) ? '' . $poster_rank . '
' : ''; } } } @@ -598,8 +594,8 @@ if ($row = $db->sql_fetchrow($result)) { if ($row['user_posts'] >= $ranksrow[$j]['rank_min'] && !$ranksrow[$j]['rank_special']) { - $poster_details[$poster_id]['rank_title'] = $ranksrow[$j]['rank_title']; - $poster_details[$poster_id]['rank_image'] = ($ranksrow[$j]['rank_image']) ? '' . $poster_rank . '
' : ''; + $user_cache[$poster_id]['rank_title'] = $ranksrow[$j]['rank_title']; + $user_cache[$poster_id]['rank_image'] = ($ranksrow[$j]['rank_image']) ? '' . $poster_rank . '
' : ''; } } } @@ -609,63 +605,63 @@ if ($row = $db->sql_fetchrow($result)) if (!$poster_id && $row['post_username'] != '') { $poster = $row['post_username']; - $poster_rank = $user->lang['Guest']; + $poster_rank = $user->lang['GUEST']; } - if (!isset($poster_details[$poster_id]['profile']) && $poster_id) + if (!isset($user_cache[$poster_id]['profile']) && $poster_id) { $temp_url = "ucp.$phpEx$SID&mode=viewprofile&u=$poster_id"; - $poster_details[$poster_id]['profile_img'] = '' . $user->img('icon_profile', $user->lang['Read_profile']) . ''; - $poster_details[$poster_id]['profile'] = '' . $user->lang['Read_profile'] . ''; + $user_cache[$poster_id]['profile_img'] = '' . $user->img('icon_profile', $user->lang['READ_PROFILE']) . ''; + $user_cache[$poster_id]['profile'] = '' . $user->lang['READ_PROFILE'] . ''; $temp_url = "privmsg.$phpEx$SID&mode=post&u=$poster_id"; - $poster_details[$poster_id]['pm_img'] = '' . $user->img('icon_pm', $user->lang['Send_private_message']) . ''; - $poster_details[$poster_id]['pm'] = '' . $user->lang['Send_private_message'] . ''; + $user_cache[$poster_id]['pm_img'] = '' . $user->img('icon_pm', $user->lang['SEND_PRIVATE_MESSAGE']) . ''; + $user_cache[$poster_id]['pm'] = '' . $user->lang['SEND_PRIVATE_MESSAGE'] . ''; - if (!empty($row['user_viewemail']) || $auth->acl_get('m_', $forum_id)) + if (!empty($row['user_viewemail']) || $auth->acl_gets('m_', 'a_', $forum_id)) { $email_uri = ($config['board_email_form'] && $config['email_enable']) ? "ucp.$phpEx$SID&mode=email&u=" . $poster_id : 'mailto:' . $row['user_email']; - $poster_details[$poster_id]['email_img'] = '' . $user->img('icon_email', $user->lang['Send_email']) . ''; - $poster_details[$poster_id]['email'] = '' . $user->lang['Send_email'] . ''; + $user_cache[$poster_id]['email_img'] = '' . $user->img('icon_email', $user->lang['SEND_EMAIL']) . ''; + $user_cache[$poster_id]['email'] = '' . $user->lang['SEND_EMAIL'] . ''; } else { - $poster_details[$poster_id]['email_img'] = ''; - $poster_details[$poster_id]['email'] = ''; + $user_cache[$poster_id]['email_img'] = ''; + $user_cache[$poster_id]['email'] = ''; } - $poster_details[$poster_id]['www_img'] = ($row['user_website']) ? '' . $user->img('icon_www', $user->lang['Visit_website']) . '' : ''; - $poster_details[$poster_id]['www'] = ($row['user_website']) ? '' . $user->lang['Visit_website'] . '' : ''; + $user_cache[$poster_id]['www_img'] = ($row['user_website']) ? '' . $user->img('icon_www', $user->lang['VISIT_WEBSITE']) . '' : ''; + $user_cache[$poster_id]['www'] = ($row['user_website']) ? '' . $user->lang['VISIT_WEBSITE'] . '' : ''; if (!empty($row['user_icq'])) { - $poster_details[$poster_id]['icq_status_img'] = ''; - $poster_details[$poster_id]['icq_img'] = '' . $user->img('icon_icq', $user->lang['ICQ']) . ''; - $poster_details[$poster_id]['icq'] = '' . $user->lang['ICQ'] . ''; + $user_cache[$poster_id]['icq_status_img'] = ''; + $user_cache[$poster_id]['icq_img'] = '' . $user->img('icon_icq', $user->lang['ICQ']) . ''; + $user_cache[$poster_id]['icq'] = '' . $user->lang['ICQ'] . ''; } else { - $poster_details[$poster_id]['icq_status_img'] = ''; - $poster_details[$poster_id]['icq_img'] = ''; - $poster_details[$poster_id]['icq'] = ''; + $user_cache[$poster_id]['icq_status_img'] = ''; + $user_cache[$poster_id]['icq_img'] = ''; + $user_cache[$poster_id]['icq'] = ''; } - $poster_details[$poster_id]['aim_img'] = ($row['user_aim']) ? '' . $user->img('icon_aim', $user->lang['AIM']) . '' : ''; - $poster_details[$poster_id]['aim'] = ($row['user_aim']) ? '' . $user->lang['AIM'] . '' : ''; + $user_cache[$poster_id]['aim_img'] = ($row['user_aim']) ? '' . $user->img('icon_aim', $user->lang['AIM']) . '' : ''; + $user_cache[$poster_id]['aim'] = ($row['user_aim']) ? '' . $user->lang['AIM'] . '' : ''; $temp_url = "ucp.$phpEx$SID&mode=viewprofile&u=$poster_id"; - $poster_details[$poster_id]['msn_img'] = ($row['user_msnm']) ? '' . $user->img('icon_msnm', $user->lang['MSNM']) . '' : ''; - $poster_details[$poster_id]['msn'] = ($row['user_msnm']) ? '' . $user->lang['MSNM'] . '' : ''; + $user_cache[$poster_id]['msn_img'] = ($row['user_msnm']) ? '' . $user->img('icon_msnm', $user->lang['MSNM']) . '' : ''; + $user_cache[$poster_id]['msn'] = ($row['user_msnm']) ? '' . $user->lang['MSNM'] . '' : ''; - $poster_details[$poster_id]['yim_img'] = ($row['user_yim']) ? '' . $user->img('icon_yim', $user->lang['YIM']) . '' : ''; - $poster_details[$poster_id]['yim'] = ($row['user_yim']) ? '' . $user->lang['YIM'] . '' : ''; + $user_cache[$poster_id]['yim_img'] = ($row['user_yim']) ? '' . $user->img('icon_yim', $user->lang['YIM']) . '' : ''; + $user_cache[$poster_id]['yim'] = ($row['user_yim']) ? '' . $user->lang['YIM'] . '' : ''; if ($auth->acl_get('f_search', $forum_id)) { $temp_url = 'search.' . $phpEx . $SID . '&search_author=' . urlencode($row['username']) .'"&showresults=posts'; - $search_img = '' . $user->img('icon_search', $user->lang['Search_user_posts']) . ''; - $search ='' . $user->lang['Search_user_posts'] . ''; + $search_img = '' . $user->img('icon_search', $user->lang['SEARCH_USER_POSTS']) . ''; + $search ='' . $user->lang['SEARCH_USER_POSTS'] . ''; } else { @@ -676,35 +672,35 @@ if ($row = $db->sql_fetchrow($result)) } else if (!$poster_id) { - $poster_details[$poster_id]['profile_img'] = ''; - $poster_details[$poster_id]['profile'] = ''; - $poster_details[$poster_id]['pm_img'] = ''; - $poster_details[$poster_id]['pm'] = ''; - $poster_details[$poster_id]['email_img'] = ''; - $poster_details[$poster_id]['email'] = ''; - $poster_details[$poster_id]['www_img'] = ''; - $poster_details[$poster_id]['www'] = ''; - $poster_details[$poster_id]['icq_status_img'] = ''; - $poster_details[$poster_id]['icq_img'] = ''; - $poster_details[$poster_id]['icq'] = ''; - $poster_details[$poster_id]['aim_img'] = ''; - $poster_details[$poster_id]['aim'] = ''; - $poster_details[$poster_id]['msn_img'] = ''; - $poster_details[$poster_id]['msn'] = ''; - $poster_details[$poster_id]['search_img'] = ''; - $poster_details[$poster_id]['search'] = ''; + $user_cache[$poster_id]['profile_img'] = ''; + $user_cache[$poster_id]['profile'] = ''; + $user_cache[$poster_id]['pm_img'] = ''; + $user_cache[$poster_id]['pm'] = ''; + $user_cache[$poster_id]['email_img'] = ''; + $user_cache[$poster_id]['email'] = ''; + $user_cache[$poster_id]['www_img'] = ''; + $user_cache[$poster_id]['www'] = ''; + $user_cache[$poster_id]['icq_status_img'] = ''; + $user_cache[$poster_id]['icq_img'] = ''; + $user_cache[$poster_id]['icq'] = ''; + $user_cache[$poster_id]['aim_img'] = ''; + $user_cache[$poster_id]['aim'] = ''; + $user_cache[$poster_id]['msn_img'] = ''; + $user_cache[$poster_id]['msn'] = ''; + $user_cache[$poster_id]['search_img'] = ''; + $user_cache[$poster_id]['search'] = ''; } // Non-user specific images/text $temp_url = 'posting.' . $phpEx . $SID . '&mode=quote&p=' . $row['post_id']; - $quote_img = '' . $user->img('icon_quote', $user->lang['Reply_with_quote']) . ''; - $quote = '' . $user->lang['Reply_with_quote'] . ''; + $quote_img = '' . $user->img('icon_quote', $user->lang['REPLY_WITH_QUOTE']) . ''; + $quote = '' . $user->lang['REPLY_WITH_QUOTE'] . ''; if (($user->data['user_id'] == $poster_id && $auth->acl_get('f_edit', $forum_id)) || $auth->acl_gets('m_edit', 'a_', $forum_id)) { $temp_url = "posting.$phpEx$SID&mode=edit&f=" . $row['forum_id'] . "&p=" . $row['post_id']; - $edit_img = '' . $user->img('icon_edit', $user->lang['Edit_delete_post']) . ''; - $edit = '' . $user->lang['Edit_delete_post'] . ''; + $edit_img = '' . $user->img('icon_edit', $user->lang['EDIT_DELETE_POST']) . ''; + $edit = '' . $user->lang['EDIT_DELETE_POST'] . ''; } else { @@ -714,9 +710,9 @@ if ($row = $db->sql_fetchrow($result)) if ($auth->acl_gets('m_ip', 'a_', $forum_id)) { - $temp_url = "modcp.$phpEx$SID&mode=ip&p=" . $row['post_id'] . "&t=" . $topic_id; - $ip_img = '' . $user->img('icon_ip', $user->lang['View_IP']) . ''; - $ip = '' . $user->lang['View_IP'] . ''; + $temp_url = "mcp.$phpEx$SID&mode=ip&p=" . $row['post_id'] . "&t=" . $topic_id; + $ip_img = '' . $user->img('icon_ip', $user->lang['VIEW_IP']) . ''; + $ip = '' . $user->lang['VIEW_IP'] . ''; } else { @@ -727,8 +723,8 @@ if ($row = $db->sql_fetchrow($result)) if (($user->data['user_id'] == $poster_id && $auth->acl_get('f_delete', $forum_id) && $forum_topic_data['topic_last_post_id'] == $row['post_id']) || $auth->acl_gets('m_delete', 'a_', $forum_id)) { $temp_url = "posting.$phpEx$SID&mode=delete&p=" . $row['post_id']; - $delpost_img = '' . $user->img('icon_delete', $user->lang['Delete_post']) . ''; - $delpost = '' . $user->lang['Delete_post'] . ''; + $delpost_img = '' . $user->img('icon_delete', $user->lang['DELETE_POST']) . ''; + $delpost = '' . $user->lang['DELETE_POST'] . ''; } else { @@ -736,6 +732,12 @@ if ($row = $db->sql_fetchrow($result)) $delpost = ''; } + // Does post have an attachment? If so, add it to the list + if ($row['post_attach']) + { + $attach_list[] = $post_id; + } + // Parse the message and subject $post_subject = ($row['post_subject'] != '') ? $row['post_subject'] : ''; $message = $row['post_text']; @@ -776,7 +778,7 @@ if ($row = $db->sql_fetchrow($result)) if (count($orig_word)) { $post_subject = preg_replace($orig_word, $replacement_word, $post_subject); - $message = preg_replace($orig_word, $replacement_word, $message); + $message = str_replace('\"', '"', substr(preg_replace('#(\>(((?>([^><]+|(?R)))*)\<))#se', "preg_replace(\$orig_word, \$replacement_word, '\\0')", '>' . $message . '<'), 1, -1)); } $message = nl2br($message); @@ -794,7 +796,7 @@ if ($row = $db->sql_fetchrow($result)) } // Signature - if (!isset($poster_details[$poster_id]['sig'])) + if (!isset($user_cache[$poster_id]['sig'])) { $user_sig = ($row['enable_sig'] && $row['user_sig'] != '' && $config['allow_sig']) ? $row['user_sig'] : ''; $user_sig_bbcode_uid = $row['user_sig_bbcode_uid']; @@ -806,25 +808,21 @@ if ($row = $db->sql_fetchrow($result)) $user_sig = preg_replace('#(<)([\/]?.*?)(>)#is', "<\\2>", $user_sig); } -// $poster_details[$poster_id]['sig'] = bbencode_second_pass($user_sig, $user_sig_bbcode_uid, $auth->acl_get('f_img', $forum_id)); - -// $poster_details[$poster_id]['sig'] = make_clickable($poster_details[$poster_id]['sig']); - if ($row['user_allowsmile']) { - $poster_details[$poster_id]['sig'] = str_replace('(((?>([^><]+|(?R)))*)\<))#se', "preg_replace(\$orig_word, \$replacement_word, '\\0')", '>' . $user_sig . '<'), 1, -1)); } - $poster_details[$poster_id]['sig'] = '
_________________
' . nl2br($poster_details[$poster_id]['sig']); + $user_cache[$poster_id]['sig'] = '
_________________
' . nl2br($user_cache[$poster_id]['sig']); } else { - $poster_details[$poster_id]['sig'] = ''; + $user_cache[$poster_id]['sig'] = ''; } } @@ -838,17 +836,17 @@ if ($row = $db->sql_fetchrow($result)) // Dump vars into template $template->assign_block_vars('postrow', array( 'POSTER_NAME' => $poster, - 'POSTER_RANK' => $poster_details[$poster_id]['rank_title'], - 'RANK_IMAGE' => $poster_details[$poster_id]['rank_image'], - 'POSTER_JOINED' => $poster_details[$poster_id]['joined'], + 'POSTER_RANK' => $user_cache[$poster_id]['rank_title'], + 'RANK_IMAGE' => $user_cache[$poster_id]['rank_image'], + 'POSTER_JOINED' => $user_cache[$poster_id]['joined'], 'POSTER_POSTS' => $poster_posts, 'POSTER_FROM' => $poster_from, - 'POSTER_AVATAR' => $poster_details[$poster_id]['avatar'], + 'POSTER_AVATAR' => $user_cache[$poster_id]['avatar'], 'POST_DATE' => $user->format_date($row['post_time']), 'POST_SUBJECT' => $post_subject, 'MESSAGE' => $message, - 'SIGNATURE' => $poster_details[$poster_id]['sig'], + 'SIGNATURE' => $user_cache[$poster_id]['sig'], 'EDITED_MESSAGE'=> $l_edited_by, 'MINI_POST_IMG' => $mini_post_img, @@ -861,25 +859,25 @@ if ($row = $db->sql_fetchrow($result)) 'DELETE_IMG' => $delpost_img, 'DELETE' => $delpost, - 'PROFILE_IMG' => $poster_details[$poster_id]['profile_img'], - 'PROFILE' => $poster_details[$poster_id]['profile'], - 'SEARCH_IMG' => $poster_details[$poster_id]['search_img'], - 'SEARCH' => $poster_details[$poster_id]['search'], - 'PM_IMG' => $poster_details[$poster_id]['pm_img'], - 'PM' => $poster_details[$poster_id]['pm'], - 'EMAIL_IMG' => $poster_details[$poster_id]['email_img'], - 'EMAIL' => $poster_details[$poster_id]['email'], - 'WWW_IMG' => $poster_details[$poster_id]['www_img'], - 'WWW' => $poster_details[$poster_id]['www'], - 'ICQ_STATUS_IMG'=> $poster_details[$poster_id]['icq_status_img'], - 'ICQ_IMG' => $poster_details[$poster_id]['icq_img'], - 'ICQ' => $poster_details[$poster_id]['icq'], - 'AIM_IMG' => $poster_details[$poster_id]['aim_img'], - 'AIM' => $poster_details[$poster_id]['aim'], - 'MSN_IMG' => $poster_details[$poster_id]['msn_img'], - 'MSN' => $poster_details[$poster_id]['msn'], - 'YIM_IMG' => $poster_details[$poster_id]['yim_img'], - 'YIM' => $poster_details[$poster_id]['yim'], + 'PROFILE_IMG' => $user_cache[$poster_id]['profile_img'], + 'PROFILE' => $user_cache[$poster_id]['profile'], + 'SEARCH_IMG' => $user_cache[$poster_id]['search_img'], + 'SEARCH' => $user_cache[$poster_id]['search'], + 'PM_IMG' => $user_cache[$poster_id]['pm_img'], + 'PM' => $user_cache[$poster_id]['pm'], + 'EMAIL_IMG' => $user_cache[$poster_id]['email_img'], + 'EMAIL' => $user_cache[$poster_id]['email'], + 'WWW_IMG' => $user_cache[$poster_id]['www_img'], + 'WWW' => $user_cache[$poster_id]['www'], + 'ICQ_STATUS_IMG'=> $user_cache[$poster_id]['icq_status_img'], + 'ICQ_IMG' => $user_cache[$poster_id]['icq_img'], + 'ICQ' => $user_cache[$poster_id]['icq'], + 'AIM_IMG' => $user_cache[$poster_id]['aim_img'], + 'AIM' => $user_cache[$poster_id]['aim'], + 'MSN_IMG' => $user_cache[$poster_id]['msn_img'], + 'MSN' => $user_cache[$poster_id]['msn'], + 'YIM_IMG' => $user_cache[$poster_id]['yim_img'], + 'YIM' => $user_cache[$poster_id]['yim'], 'L_MINI_POST_ALT' => $mini_post_alt, @@ -896,8 +894,63 @@ else trigger_error($user->lang['No_posts_topic']); } +$rating = ''; +if ($user->data['user_id'] != ANONYMOUS) +{ + $rating_text = array(0 => $user->lang['SPAM'], 5 => $user->lang['EXCELLENT']); + + $sql = "SELECT rating + FROM " . TOPICS_RATINGS_TABLE . " + WHERE user_id = " . $user->data['user_id'] . " + AND post_id IN ($post_id_sql)"; +// $result = $db->sql_query($sql); +} + +// If we have attachments, grab them ... based on Acyd Burns 2.0.x Mod +if (sizeof($attach_list)) +{ + $sql = "SELECT a.post_id, d.* + FROM " . ATTACHMENTS_TABLE . " a, " . ATTACHMENTS_DESC_TABLE . " d + WHERE a.post_id IN (" . implode(', ', $attach_list) . ") + AND a.attach_id = d.attach_id + ORDER BY d.filetime " . $display_order; + $result = $db->sql_query($sql); + + if ($db->sql_fetchrow($result)) + { + $template->assign_vars(array( + 'L_POSTED_ATTACHMENTS' => $lang['Posted_attachments'], + 'L_KILOBYTE' => $lang['KB']) + ); + + $i = 0; + + do + { + } + while ($db->sql_fetchrow($result)); + } + else + { + // No attachments exist, but post table thinks they do + // so go ahead and reset post_attach flags + $sql = "UPDATE " . POSTS_TABLE . " + SET post_attach = 0 + WHERE post_id IN (" . implode(', ', $attach_list) . ")"; + $db->sql_query($sql); + } + $db->sql_freeresult($result); +} + +// Mark topics read markread('topic', $forum_id, $topic_id, $forum_topic_data['topic_last_post_id']); +// Update the topic view counter +$sql = "UPDATE " . TOPICS_TABLE . " + SET topic_views = topic_views + 1 + WHERE topic_id = $topic_id"; +$db->sql_query($sql); + // Output the page $page_title = $user->lang['View_topic'] .' - ' . $topic_title; include($phpbb_root_path . 'includes/page_header.'.$phpEx); @@ -907,12 +960,8 @@ $template->set_filenames(array( ); make_jumpbox('viewforum.'.$phpEx, $forum_id); -// Update the topic view counter -$sql = "UPDATE " . TOPICS_TABLE . " - SET topic_views = topic_views + 1 - WHERE topic_id = $topic_id"; -$db->sql_query($sql); - include($phpbb_root_path . 'includes/page_tail.'.$phpEx); -?> +//, 'header' => 'overall_header.tpl', 'footer' => 'overall_footer.tpl' + +?> \ No newline at end of file