mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-05 00:07:44 +02:00
[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
This commit is contained in:
committed by
Joas Schilling
parent
1128ff1e58
commit
b8c55291ed
@@ -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)
|
||||
|
Reference in New Issue
Block a user