diff options
author | Josh Woody <a_jelly_doughnut@phpbb.com> | 2010-06-17 23:58:18 -0500 |
---|---|---|
committer | Joas Schilling <nickvergessen@gmx.de> | 2012-08-29 17:49:37 +0200 |
commit | b8c55291ed7ed86565be2bc651bf20eb1a9ed4dd (patch) | |
tree | 1fc8b7f01084dc64243476683de5587278406110 /phpBB/includes/mcp/mcp_forum.php | |
parent | 1128ff1e580361db7f7ecc72d496fdd347cbe0f2 (diff) | |
download | forums-b8c55291ed7ed86565be2bc651bf20eb1a9ed4dd.tar forums-b8c55291ed7ed86565be2bc651bf20eb1a9ed4dd.tar.gz forums-b8c55291ed7ed86565be2bc651bf20eb1a9ed4dd.tar.bz2 forums-b8c55291ed7ed86565be2bc651bf20eb1a9ed4dd.tar.xz forums-b8c55291ed7ed86565be2bc651bf20eb1a9ed4dd.zip |
[feature/soft-delete] Lay the groundwork for a soft-delete feature
So far, I've added no new functionality. The biggest change here is adjusting the DB column names to "visibility" rather than "approved". Some things here are pretty likely to change, for example the name and location of the topic_visibility class. Happy birthday phpBB :)
PHPBB3-9657
Diffstat (limited to 'phpBB/includes/mcp/mcp_forum.php')
-rw-r--r-- | phpBB/includes/mcp/mcp_forum.php | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/phpBB/includes/mcp/mcp_forum.php b/phpBB/includes/mcp/mcp_forum.php index 7b3bc82093..48b9c7c2d3 100644 --- a/phpBB/includes/mcp/mcp_forum.php +++ b/phpBB/includes/mcp/mcp_forum.php @@ -154,7 +154,7 @@ function mcp_forum_view($id, $mode, $action, $forum_info) $sql = 'SELECT t.topic_id FROM ' . TOPICS_TABLE . ' t WHERE t.forum_id = ' . $forum_id . ' - ' . (($auth->acl_get('m_approve', $forum_id)) ? '' : 'AND t.topic_approved = 1') . " + ' . topic_visibility::get_visibility_sql('topic', $forum_id, 't.') . " $limit_time_sql ORDER BY t.topic_type DESC, $sort_order_sql"; $result = $db->sql_query_limit($sql, $topics_per_page, $start); @@ -220,9 +220,10 @@ function mcp_forum_view($id, $mode, $action, $forum_info) $topic_title = censor_text($row['topic_title']); - $topic_unapproved = (!$row['topic_approved'] && $auth->acl_get('m_approve', $row['forum_id'])) ? true : false; - $posts_unapproved = ($row['topic_approved'] && $row['topic_replies'] < $row['topic_replies_real'] && $auth->acl_get('m_approve', $row['forum_id'])) ? true : false; + $topic_unapproved = ($row['topic_visibility'] == ITEM_UNAPPROVED && $auth->acl_get('m_approve', $row['forum_id'])) ? true : false; + $posts_unapproved = ($row['topic_visibility'] == ITEM_APPROVED && $row['topic_replies'] < $row['topic_replies_real'] && $auth->acl_get('m_approve', $row['forum_id'])) ? true : false; $u_mcp_queue = ($topic_unapproved || $posts_unapproved) ? $url . '&i=queue&mode=' . (($topic_unapproved) ? 'approve_details' : 'unapproved_posts') . '&t=' . $row['topic_id'] : ''; + $topic_deleted = ($row['topic_visibility'] == ITEM_DELETED) ? true : false; $topic_row = array( 'ATTACH_ICON_IMG' => ($auth->acl_get('u_download') && $auth->acl_get('f_download', $row['forum_id']) && $row['topic_attachment']) ? $user->img('icon_topic_attach', $user->lang['TOTAL_ATTACHMENTS']) : '', @@ -232,6 +233,7 @@ function mcp_forum_view($id, $mode, $action, $forum_info) 'TOPIC_ICON_IMG_WIDTH' => (!empty($icons[$row['icon_id']])) ? $icons[$row['icon_id']]['width'] : '', 'TOPIC_ICON_IMG_HEIGHT' => (!empty($icons[$row['icon_id']])) ? $icons[$row['icon_id']]['height'] : '', 'UNAPPROVED_IMG' => ($topic_unapproved || $posts_unapproved) ? $user->img('icon_topic_unapproved', ($topic_unapproved) ? 'TOPIC_UNAPPROVED' : 'POSTS_UNAPPROVED') : '', + 'DELETED_IMG' => ($topic_deleted) ? $user->img(/*TODO*/) : '', 'TOPIC_AUTHOR' => get_username_string('username', $row['topic_poster'], $row['topic_first_poster_name'], $row['topic_first_poster_colour']), 'TOPIC_AUTHOR_COLOUR' => get_username_string('colour', $row['topic_poster'], $row['topic_first_poster_name'], $row['topic_first_poster_colour']), @@ -254,7 +256,9 @@ function mcp_forum_view($id, $mode, $action, $forum_info) 'S_TOPIC_REPORTED' => (!empty($row['topic_reported']) && empty($row['topic_moved_id']) && $auth->acl_get('m_report', $row['forum_id'])) ? true : false, 'S_TOPIC_UNAPPROVED' => $topic_unapproved, 'S_POSTS_UNAPPROVED' => $posts_unapproved, + 'S_TOPIC_DELETED' => $topic_deleted, 'S_UNREAD_TOPIC' => $unread_topic, + ); if ($row['topic_status'] == ITEM_MOVED) |