diff --git a/phpBB/includes/mcp/mcp_main.php b/phpBB/includes/mcp/mcp_main.php index f4c0910a50..3f7b752c26 100644 --- a/phpBB/includes/mcp/mcp_main.php +++ b/phpBB/includes/mcp/mcp_main.php @@ -452,6 +452,7 @@ class mcp_main extends mcp 'U_MCP_QUEUE' => $this->url . '&mode=approve&t=' . $row['topic_id'], 'U_MCP_REPORT' => $this->url . '&mode=reports&t=' . $row['topic_id'], + 'ATTACH_ICON_IMG' => ($auth->acl_gets('f_download', 'u_download', $row['forum_id']) && $row['topic_attachment']) ? $user->img('icon_attach', sprintf($user->lang['TOTAL_ATTACHMENTS'], $row['topic_attachment'])) : '', 'TOPIC_FOLDER_IMG' => $folder_img, 'TOPIC_TYPE' => $topic_type, 'TOPIC_TITLE' => $topic_title, diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php index ae22b5e432..96a8e6977c 100644 --- a/phpBB/viewtopic.php +++ b/phpBB/viewtopic.php @@ -619,8 +619,9 @@ if (!empty($poll_start)) setcookie($config['cookie_name'] . '_poll_' . $topic_id, implode(',', $voted_id), time() + 31536000, $config['cookie_path'], $config['cookie_domain'], $config['cookie_secure']); } +//, topic_last_post_time = ' . time() . " $sql = 'UPDATE ' . TOPICS_TABLE . ' - SET poll_last_vote = ' . time() . ', topic_last_post_time = ' . time() . " + SET poll_last_vote = ' . time() . " WHERE topic_id = $topic_id"; $db->sql_query($sql); @@ -744,7 +745,7 @@ while ($row = $db->sql_fetchrow($result)) { if ($row['user_karma'] < $user->data['user_min_karma']) { - $rowset[] = array( + $rowset[$row['post_id']] = array( 'below_karma' => TRUE, 'post_id' => $row['post_id'], 'poster' => $poster, @@ -755,7 +756,7 @@ while ($row = $db->sql_fetchrow($result)) } else if ($row['foe']) { - $rowset[] = array( + $rowset[$row['post_id']] = array( 'foe' => TRUE, 'post_id' => $row['post_id'], 'poster' => $poster, @@ -1004,13 +1005,15 @@ if (count($attach_list)) $db->sql_query($sql); } } - elseif ($has_attachments && !$topic_data['topic_attachment']) + else if ($has_attachments && !$topic_data['topic_attachment']) { // Topic has approved attachments but its flag is wrong $sql = 'UPDATE ' . TOPICS_TABLE . " SET topic_attachment = 1 WHERE topic_id = $topic_id"; $db->sql_query($sql); + + $topic_data['topic_attachment'] = 1; } } else @@ -1084,7 +1087,7 @@ for ($i = 0; $i < count($post_list); ++$i) // End signature parsing, only if needed if ($user_cache[$poster_id]['sig'] && empty($user_cache[$poster_id]['sig_parsed'])) { - $user_cache[$poster_id]['sig'] = ($config['enable_smilies']) ? preg_replace('##', '\1', $user_cache[$poster_id]['sig']) : str_replace('