mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-08 04:18:52 +00:00
[ticket/9837] Display unapproved posts to their authors
Basic functionality mock up. PHPBB3-9837
This commit is contained in:
parent
ce35aa8b0b
commit
eb94fe973b
4 changed files with 24 additions and 2 deletions
|
@ -144,7 +144,12 @@ class content_visibility
|
|||
*/
|
||||
public function is_visible($mode, $forum_id, $data)
|
||||
{
|
||||
$is_visible = $this->auth->acl_get('m_approve', $forum_id) || $data[$mode . '_visibility'] == ITEM_APPROVED;
|
||||
$visibility = $data[$mode . '_visibility'];
|
||||
$poster_key = ($mode === 'topic') ? 'topic_poster' : 'poster_id';
|
||||
$is_visible = $this->auth->acl_get('m_approve', $forum_id) || $visibility == ITEM_APPROVED || (
|
||||
($visibility == ITEM_UNAPPROVED || $visibility == ITEM_REAPPROVE) &&
|
||||
$this->user->data['user_id'] === $data[$poster_key]
|
||||
);
|
||||
|
||||
/**
|
||||
* Allow changing the result of calling is_visible
|
||||
|
@ -216,7 +221,13 @@ class content_visibility
|
|||
}
|
||||
else
|
||||
{
|
||||
$where_sql .= $table_alias . $mode . '_visibility = ' . ITEM_APPROVED;
|
||||
$field_name = ($mode === 'topic') ? 'topic_poster' : 'poster_id';
|
||||
$visibility_query = $table_alias . $mode . '_visibility = ';
|
||||
|
||||
$where_sql .= '(' . $visibility_query . ITEM_APPROVED . ')';
|
||||
$where_sql .= ' OR (';
|
||||
$where_sql .= '(' . $visibility_query . ITEM_UNAPPROVED . ' OR ' . $visibility_query . ITEM_REAPPROVE . ')';
|
||||
$where_sql .= ' AND ' . $table_alias . $field_name . ' = ' . ((int) $this->user->data['user_id']) . ')';
|
||||
}
|
||||
|
||||
return '(' . $where_sql . ')';
|
||||
|
|
|
@ -294,6 +294,7 @@
|
|||
<!-- EVENT viewtopic_body_postrow_post_details_after -->
|
||||
|
||||
<!-- IF postrow.S_POST_UNAPPROVED -->
|
||||
<!-- IF postrow.S_CAN_APPROVE -->
|
||||
<form method="post" class="mcp_approve" action="{postrow.U_APPROVE_ACTION}">
|
||||
<p class="post-notice unapproved">
|
||||
<span><i class="icon fa-question icon-red fa-fw" aria-hidden="true"></i></span>
|
||||
|
@ -304,6 +305,11 @@
|
|||
{S_FORM_TOKEN}
|
||||
</p>
|
||||
</form>
|
||||
<!-- ELSE -->
|
||||
<p class="information post-notice">
|
||||
{L_POST_UNAPPROVED}
|
||||
</p>
|
||||
<!-- ENDIF -->
|
||||
<!-- ELSEIF postrow.S_POST_DELETED -->
|
||||
<form method="post" class="mcp_approve" action="{postrow.U_APPROVE_ACTION}">
|
||||
<p class="post-notice deleted">
|
||||
|
|
|
@ -1161,3 +1161,7 @@ li.notification-reported strong, li.notification-disapproved strong {
|
|||
background-color: #D31141;
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
p.information {
|
||||
background-color: #b8d3e0;
|
||||
}
|
||||
|
|
|
@ -2092,6 +2092,7 @@ for ($i = 0, $end = count($post_list); $i < $end; ++$i)
|
|||
'S_HAS_ATTACHMENTS' => (!empty($attachments[$row['post_id']])) ? true : false,
|
||||
'S_MULTIPLE_ATTACHMENTS' => !empty($attachments[$row['post_id']]) && count($attachments[$row['post_id']]) > 1,
|
||||
'S_POST_UNAPPROVED' => ($row['post_visibility'] == ITEM_UNAPPROVED || $row['post_visibility'] == ITEM_REAPPROVE) ? true : false,
|
||||
'S_CAN_APPROVE' => $auth->acl_get('m_approve', $forum_id),
|
||||
'S_POST_DELETED' => ($row['post_visibility'] == ITEM_DELETED) ? true : false,
|
||||
'L_POST_DELETED_MESSAGE' => $l_deleted_message,
|
||||
'S_POST_REPORTED' => ($row['post_reported'] && $auth->acl_get('m_report', $forum_id)) ? true : false,
|
||||
|
|
Loading…
Add table
Reference in a new issue