mirror of
https://github.com/phpbb/phpbb.git
synced 2025-05-02 22:02:07 +02:00
Added indicators for reported and/or unapproved items. Note that moderators with m_approve permission can now read unapproved topics and posts normally.
git-svn-id: file:///svn/phpbb/trunk@3640 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
4577cf61d1
commit
f408ac052d
@ -53,7 +53,18 @@
|
|||||||
<!-- IF S_TOPIC_ICONS -->
|
<!-- IF S_TOPIC_ICONS -->
|
||||||
<td class="row1" align="center" valign="middle">{topicrow.TOPIC_ICON_IMG}</td>
|
<td class="row1" align="center" valign="middle">{topicrow.TOPIC_ICON_IMG}</td>
|
||||||
<!-- ENDIF -->
|
<!-- ENDIF -->
|
||||||
<td class="row1" width="100%"><span class="topictitle">{topicrow.NEWEST_POST_IMG}{topicrow.TOPIC_TYPE}<a href="{topicrow.U_VIEW_TOPIC}">{topicrow.TOPIC_TITLE}</a></span><span class="gensmall"><br />{topicrow.GOTO_PAGE}</span></td>
|
<td class="row1" width="100%">
|
||||||
|
<!-- IF topicrow.S_TOPIC_UNAPPROVED or topicrow.S_TOPIC_REPORTED -->
|
||||||
|
<table width="100%" border="0" cellspacing="0" cellpadding="0">
|
||||||
|
<tr align="left" valign="middle" class="topictitle">
|
||||||
|
<td><!-- IF topicrow.S_TOPIC_UNAPPROVED --><a href="{topicrow.U_MCP_QUEUE}">{UNAPPROVED_IMG}</a> <!-- ENDIF --><!-- IF topicrow.S_TOPIC_REPORTED --><a href="{topicrow.U_MCP_REPORT}">{REPORTED_IMG}</a> <!-- ENDIF --></td>
|
||||||
|
<td width="100%">{topicrow.NEWEST_POST_IMG}{topicrow.TOPIC_TYPE}<a href="{topicrow.U_VIEW_TOPIC}">{topicrow.TOPIC_TITLE}</a></span><span class="gensmall"><br />{topicrow.GOTO_PAGE}</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
<!-- ELSE -->
|
||||||
|
<span class="topictitle">{topicrow.NEWEST_POST_IMG}{topicrow.TOPIC_TYPE}<a href="{topicrow.U_VIEW_TOPIC}">{topicrow.TOPIC_TITLE}</a></span><span class="gensmall"><br />{topicrow.GOTO_PAGE}</span>
|
||||||
|
<!-- ENDIF -->
|
||||||
|
</td>
|
||||||
<td class="row2" align="center" valign="middle"><span class="name">{topicrow.TOPIC_AUTHOR}</span></td>
|
<td class="row2" align="center" valign="middle"><span class="name">{topicrow.TOPIC_AUTHOR}</span></td>
|
||||||
<td class="row1" align="center" valign="middle"><span class="postdetails">{topicrow.REPLIES}</span></td>
|
<td class="row1" align="center" valign="middle"><span class="postdetails">{topicrow.REPLIES}</span></td>
|
||||||
<td class="row2" align="center" valign="middle"><span class="postdetails">{topicrow.VIEWS}</span></td>
|
<td class="row2" align="center" valign="middle"><span class="postdetails">{topicrow.VIEWS}</span></td>
|
||||||
@ -130,7 +141,6 @@
|
|||||||
|
|
||||||
<table width="100%" cellspacing="0" cellpadding="0" border="0">
|
<table width="100%" cellspacing="0" cellpadding="0" border="0">
|
||||||
<tr>
|
<tr>
|
||||||
<td align="left"><!-- IF S_SHOW_SEARCHBOX --><!-- INCLUDE searchbox.html --><!-- ENDIF --></td>
|
|
||||||
<td align="right"><!-- INCLUDE jumpbox.html --></td>
|
<td align="right"><!-- INCLUDE jumpbox.html --></td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
@ -105,14 +105,28 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<td colspan="2"><hr /></td>
|
<td colspan="2"><hr /></td>
|
||||||
</tr>
|
</tr>
|
||||||
<!-- IF postrow.S_POST_REPORTED -->
|
<!-- IF postrow.S_POST_UNAPPROVED -->
|
||||||
<tr>
|
<tr><td><table width="100%" border="0" cellspacing="0" cellpadding="0">
|
||||||
<td colspan="2" class="gen"><a href="{postrow.U_MCP_REPORT}">{L_POST_BEEN_REPORTED}</a></td>
|
<tr align="left" valign="middle">
|
||||||
</tr>
|
<td><a href="{postrow.U_MCP_POST_DETAILS}">{UNAPPROVED_IMG}</a></td>
|
||||||
|
<td class="gensmall" width="100%"> {L_POST_NOT_BEEN_APPROVED} <a href="{postrow.U_MCP_APPROVE}">{L_APPROVE_POST}</a></td>
|
||||||
|
</tr>
|
||||||
|
</table></td></tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="2"><hr /></td>
|
<td colspan="2"><hr /></td>
|
||||||
</tr>
|
</tr>
|
||||||
<!-- ENDIF -->
|
<!-- ENDIF -->
|
||||||
|
<!-- IF postrow.S_POST_REPORTED -->
|
||||||
|
<tr><td><table width="100%" border="0" cellspacing="0" cellpadding="0">
|
||||||
|
<tr align="left" valign="middle">
|
||||||
|
<td><a href="{postrow.U_MCP_REPORT}">{REPORTED_IMG}</a></td>
|
||||||
|
<td class="gensmall" width="100%"> <a href="{postrow.U_MCP_REPORT}">{L_POST_BEEN_REPORTED}</a></td>
|
||||||
|
</tr>
|
||||||
|
</table></td></tr>
|
||||||
|
<tr>
|
||||||
|
<td colspan="2"><hr /></td>
|
||||||
|
</tr>
|
||||||
|
<!-- ENDIF -->
|
||||||
<tr>
|
<tr>
|
||||||
<td><span class="postbody">{postrow.MESSAGE}{postrow.SIGNATURE}</span><span class="gensmall">{postrow.EDITED_MESSAGE}</span></td>
|
<td><span class="postbody">{postrow.MESSAGE}{postrow.SIGNATURE}</span><span class="gensmall">{postrow.EDITED_MESSAGE}</span></td>
|
||||||
</tr>
|
</tr>
|
||||||
@ -175,7 +189,6 @@
|
|||||||
|
|
||||||
<table width="100%" cellspacing="0" cellpadding="0" border="0">
|
<table width="100%" cellspacing="0" cellpadding="0" border="0">
|
||||||
<tr>
|
<tr>
|
||||||
<td align="left"><!-- IF S_SHOW_SEARCHBOX --><!-- INCLUDE searchbox.html --><!-- ENDIF --></td>
|
|
||||||
<td align="right"><!-- INCLUDE jumpbox.html --></td>
|
<td align="right"><!-- INCLUDE jumpbox.html --></td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
@ -230,6 +230,9 @@ if ($forum_data['forum_postable'])
|
|||||||
'FOLDER_ANNOUNCE_IMG' => $user->img('folder_announce', 'POST_ANNOUNCEMENT'),
|
'FOLDER_ANNOUNCE_IMG' => $user->img('folder_announce', 'POST_ANNOUNCEMENT'),
|
||||||
'FOLDER_ANNOUNCE_NEW_IMG'=> $user->img('folder_announce_new', 'POST_ANNOUNCEMENT'),
|
'FOLDER_ANNOUNCE_NEW_IMG'=> $user->img('folder_announce_new', 'POST_ANNOUNCEMENT'),
|
||||||
|
|
||||||
|
'REPORTED_IMG' => $user->img('item_reported', 'TOPIC_BEEN_REPORTED'),
|
||||||
|
'UNAPPROVED_IMG' => $user->img('item_unapproved', 'TOPIC_NOT_BEEN_APPROVED'),
|
||||||
|
|
||||||
'L_NO_TOPICS' => ($forum_data['forum_status'] == ITEM_LOCKED) ? $user->lang['POST_FORUM_LOCKED'] : $user->lang['NO_TOPICS'],
|
'L_NO_TOPICS' => ($forum_data['forum_status'] == ITEM_LOCKED) ? $user->lang['POST_FORUM_LOCKED'] : $user->lang['NO_TOPICS'],
|
||||||
|
|
||||||
'S_IS_POSTABLE' => TRUE,
|
'S_IS_POSTABLE' => TRUE,
|
||||||
@ -284,7 +287,7 @@ if ($forum_data['forum_postable'])
|
|||||||
LEFT JOIN ' . LASTREAD_TABLE . ' lr ON lr.topic_id = t.topic_id
|
LEFT JOIN ' . LASTREAD_TABLE . ' lr ON lr.topic_id = t.topic_id
|
||||||
AND lr.user_id = ' . $user->data['user_id'] . ")
|
AND lr.user_id = ' . $user->data['user_id'] . ")
|
||||||
WHERE t.forum_id = $forum_id
|
WHERE t.forum_id = $forum_id
|
||||||
AND t.topic_approved = 1
|
" . (($auth->acl_gets('m_approve', 'a_', $forum_id)) ? '' : 'AND t.topic_approved = 1') . "
|
||||||
AND t.topic_type <> " . POST_ANNOUNCE . "
|
AND t.topic_type <> " . POST_ANNOUNCE . "
|
||||||
$limit_topics_time
|
$limit_topics_time
|
||||||
ORDER BY t.topic_type DESC, $sort_order_sql
|
ORDER BY t.topic_type DESC, $sort_order_sql
|
||||||
@ -488,6 +491,7 @@ if ($forum_data['forum_postable'])
|
|||||||
'S_USER_POSTED' => ($row['lastread_type'] == LASTREAD_POSTED) ? true : false,
|
'S_USER_POSTED' => ($row['lastread_type'] == LASTREAD_POSTED) ? true : false,
|
||||||
|
|
||||||
'S_TOPIC_REPORTED' => (!empty($row['topic_reported']) && $auth->acl_gets('m_', 'a_', $forum_id)) ? TRUE : FALSE,
|
'S_TOPIC_REPORTED' => (!empty($row['topic_reported']) && $auth->acl_gets('m_', 'a_', $forum_id)) ? TRUE : FALSE,
|
||||||
|
'S_TOPIC_UNAPPROVED' => (!$row['topic_approved'] && $auth->acl_gets('m_approve', 'a_', $forum_id)) ? TRUE : FALSE,
|
||||||
|
|
||||||
'U_VIEW_TOPIC' => $view_topic_url)
|
'U_VIEW_TOPIC' => $view_topic_url)
|
||||||
);
|
);
|
||||||
|
@ -51,6 +51,9 @@ if (empty($topic_id) && empty($post_id))
|
|||||||
// Start session management
|
// Start session management
|
||||||
$user->start();
|
$user->start();
|
||||||
|
|
||||||
|
// Configure style, language, etc.
|
||||||
|
$user->setup(false, $forum_style);
|
||||||
|
$auth->acl($user->data);
|
||||||
|
|
||||||
// Find topic id if user requested a newer or older topic
|
// Find topic id if user requested a newer or older topic
|
||||||
if (isset($_GET['view']) && empty($post_id))
|
if (isset($_GET['view']) && empty($post_id))
|
||||||
@ -64,7 +67,7 @@ if (isset($_GET['view']) && empty($post_id))
|
|||||||
WHERE s.session_id = '$user->session_id'
|
WHERE s.session_id = '$user->session_id'
|
||||||
AND u.user_id = s.session_user_id
|
AND u.user_id = s.session_user_id
|
||||||
AND p.topic_id = $topic_id
|
AND p.topic_id = $topic_id
|
||||||
AND p.post_approved = 1
|
" . (($auth->acl_gets('m_approve', 'a_', $forum_id)) ? '' : 'AND p.post_approved = 1') . "
|
||||||
AND p.post_time >= u.user_lastvisit
|
AND p.post_time >= u.user_lastvisit
|
||||||
ORDER BY p.post_time ASC";
|
ORDER BY p.post_time ASC";
|
||||||
$result = $db->sql_query_limit($sql, 1);
|
$result = $db->sql_query_limit($sql, 1);
|
||||||
@ -113,7 +116,21 @@ if (isset($_GET['view']) && empty($post_id))
|
|||||||
// also allows for direct linking to a post (and the calculation of which
|
// also allows for direct linking to a post (and the calculation of which
|
||||||
// page the post is on and the correct display of viewtopic)
|
// page the post is on and the correct display of viewtopic)
|
||||||
$join_sql_table = (!$post_id) ? '' : ', ' . POSTS_TABLE . ' p, ' . POSTS_TABLE . ' p2 ';
|
$join_sql_table = (!$post_id) ? '' : ', ' . POSTS_TABLE . ' p, ' . POSTS_TABLE . ' p2 ';
|
||||||
$join_sql = (!$post_id) ? "t.topic_id = $topic_id" : "p.post_id = $post_id AND p.post_approved = " . TRUE . " AND t.topic_id = p.topic_id AND p2.topic_id = p.topic_id AND p2.post_approved = " . TRUE . " AND p2.post_id <= $post_id";
|
if (!$post_id)
|
||||||
|
{
|
||||||
|
$join_sql = "t.topic_id = $topic_id";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if ($auth->acl_gets('m_approve', 'a_', $forum_id))
|
||||||
|
{
|
||||||
|
$join_sql = (!$post_id) ? "t.topic_id = $topic_id" : "p.post_id = $post_id AND t.topic_id = p.topic_id AND p2.topic_id = p.topic_id AND p2.post_id <= $post_id";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$join_sql = (!$post_id) ? "t.topic_id = $topic_id" : "p.post_id = $post_id AND p.post_approved = 1 AND t.topic_id = p.topic_id AND p2.topic_id = p.topic_id AND p2.post_approved = 1 AND p2.post_id <= $post_id";
|
||||||
|
}
|
||||||
|
}
|
||||||
$extra_fields = (!$post_id) ? '' : ", COUNT(p2.post_id) AS prev_posts";
|
$extra_fields = (!$post_id) ? '' : ", COUNT(p2.post_id) AS prev_posts";
|
||||||
$order_sql = (!$post_id) ? '' : "GROUP BY p.post_id, t.topic_id, t.topic_title, t.topic_status, t.topic_replies, t.topic_time, t.topic_type, f.forum_name, f.forum_desc, f.forum_parents, f.parent_id, f.left_id, f.right_id, f.forum_status, f.forum_id, f.forum_style ORDER BY p.post_id ASC";
|
$order_sql = (!$post_id) ? '' : "GROUP BY p.post_id, t.topic_id, t.topic_title, t.topic_status, t.topic_replies, t.topic_time, t.topic_type, f.forum_name, f.forum_desc, f.forum_parents, f.parent_id, f.left_id, f.right_id, f.forum_status, f.forum_id, f.forum_style ORDER BY p.post_id ASC";
|
||||||
|
|
||||||
@ -153,11 +170,6 @@ if (!$topic_data = $db->sql_fetchrow($result))
|
|||||||
extract($topic_data);
|
extract($topic_data);
|
||||||
|
|
||||||
|
|
||||||
// Configure style, language, etc.
|
|
||||||
$user->setup(false, $forum_style);
|
|
||||||
$auth->acl($user->data);
|
|
||||||
|
|
||||||
|
|
||||||
// Start auth check
|
// Start auth check
|
||||||
if (!$auth->acl_gets('f_read', 'm_', 'a_', $forum_id))
|
if (!$auth->acl_gets('f_read', 'm_', 'a_', $forum_id))
|
||||||
{
|
{
|
||||||
@ -204,7 +216,7 @@ if ($sort_days)
|
|||||||
FROM ' . POSTS_TABLE . "
|
FROM ' . POSTS_TABLE . "
|
||||||
WHERE topic_id = $topic_id
|
WHERE topic_id = $topic_id
|
||||||
AND post_time >= $min_post_time
|
AND post_time >= $min_post_time
|
||||||
AND post_approved = 1";
|
" . (($auth->acl_gets('m_approve', 'a_', $forum_id)) ? '' : 'AND p.post_approved = 1');
|
||||||
$result = $db->sql_query($sql);
|
$result = $db->sql_query($sql);
|
||||||
|
|
||||||
$start = 0;
|
$start = 0;
|
||||||
@ -340,6 +352,9 @@ $template->assign_vars(array(
|
|||||||
'POST_IMG' => $post_img,
|
'POST_IMG' => $post_img,
|
||||||
'REPLY_IMG' => $reply_img,
|
'REPLY_IMG' => $reply_img,
|
||||||
|
|
||||||
|
'REPORTED_IMG' => $user->img('item_reported', 'POST_BEEN_REPORTED'),
|
||||||
|
'UNAPPROVED_IMG' => $user->img('item_unapproved', 'POST_NOT_BEEN_APPROVED'),
|
||||||
|
|
||||||
'S_TOPIC_LINK' => 't',
|
'S_TOPIC_LINK' => 't',
|
||||||
'S_SELECT_SORT_DIR' => $s_sort_dir,
|
'S_SELECT_SORT_DIR' => $s_sort_dir,
|
||||||
'S_SELECT_SORT_KEY' => $s_sort_key,
|
'S_SELECT_SORT_KEY' => $s_sort_key,
|
||||||
@ -442,7 +457,7 @@ $i = 0;
|
|||||||
$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_avatar, u.user_avatar_type, p.*
|
$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_avatar, u.user_avatar_type, p.*
|
||||||
FROM " . POSTS_TABLE . " p, " . USERS_TABLE . " u
|
FROM " . POSTS_TABLE . " p, " . USERS_TABLE . " u
|
||||||
WHERE p.topic_id = $topic_id
|
WHERE p.topic_id = $topic_id
|
||||||
AND p.post_approved = " . TRUE . "
|
" . (($auth->acl_gets('m_approve', 'a_', $forum_id)) ? '' : 'AND p.post_approved = 1') . "
|
||||||
$limit_posts_time
|
$limit_posts_time
|
||||||
AND u.user_id = p.poster_id
|
AND u.user_id = p.poster_id
|
||||||
ORDER BY $sort_order";
|
ORDER BY $sort_order";
|
||||||
@ -852,7 +867,9 @@ if ($row = $db->sql_fetchrow($result))
|
|||||||
'L_MINI_POST_ALT' => $mini_post_alt,
|
'L_MINI_POST_ALT' => $mini_post_alt,
|
||||||
|
|
||||||
'S_ROW_COUNT' => $i++,
|
'S_ROW_COUNT' => $i++,
|
||||||
'S_POST_APPROVED' => (!empty($row['post_approved'])) ? TRUE : FALSE,
|
|
||||||
|
'S_POST_UNAPPROVED' => (!empty($row['post_approved'])) ? TRUE : FALSE,
|
||||||
|
'U_MCP_APPROVE' => "mcp.$phpEx$SID&mode=approve&p=" . $row['post_id'],
|
||||||
|
|
||||||
'U_MINI_POST' => $mini_post_url,
|
'U_MINI_POST' => $mini_post_url,
|
||||||
'U_POST_ID' => $u_post_id
|
'U_POST_ID' => $u_post_id
|
||||||
|
Loading…
x
Reference in New Issue
Block a user