mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-28 12:30:42 +02:00
- fixed permissions for mcp (global permission settings are false if user is only able to moderate one to x forums)
- determine permission settings for submodules - further approve/disapprove work (approve_details added) git-svn-id: file:///svn/phpbb/trunk@4925 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
@@ -928,4 +928,89 @@ function load_drafts($topic_id = 0, $forum_id = 0, $id = 0)
|
||||
}
|
||||
}
|
||||
|
||||
// Topic Review
|
||||
function topic_review($topic_id, $forum_id, $mode = 'topic_review', $cur_post_id = 0, $show_quote_button = true)
|
||||
{
|
||||
global $user, $auth, $db, $template, $bbcode, $template;
|
||||
global $config, $phpbb_root_path, $phpEx, $SID;
|
||||
|
||||
// Go ahead and pull all data for this topic
|
||||
$sql = 'SELECT u.username, u.user_id, u.user_karma, p.post_id, p.post_username, p.post_subject, p.post_text, p.enable_smilies, p.bbcode_uid, p.bbcode_bitfield, p.post_time
|
||||
FROM ' . POSTS_TABLE . ' p, ' . USERS_TABLE . " u
|
||||
WHERE p.topic_id = $topic_id
|
||||
AND p.poster_id = u.user_id
|
||||
" . ((!$auth->acl_get('m_approve', $forum_id)) ? 'AND p.post_approved = 1' : '') . '
|
||||
' . (($mode == 'post_review') ? " AND p.post_id > $cur_post_id" : '') . '
|
||||
ORDER BY p.post_time DESC';
|
||||
$result = $db->sql_query_limit($sql, $config['posts_per_page']);
|
||||
|
||||
if (!$row = $db->sql_fetchrow($result))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
$bbcode_bitfield = 0;
|
||||
do
|
||||
{
|
||||
$rowset[] = $row;
|
||||
$bbcode_bitfield |= $row['bbcode_bitfield'];
|
||||
}
|
||||
while ($row = $db->sql_fetchrow($result));
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
// Instantiate BBCode class
|
||||
if (!isset($bbcode) && $bbcode_bitfield)
|
||||
{
|
||||
include_once($phpbb_root_path . 'includes/bbcode.'.$phpEx);
|
||||
$bbcode = new bbcode($bbcode_bitfield);
|
||||
}
|
||||
|
||||
foreach ($rowset as $i => $row)
|
||||
{
|
||||
$poster_id = $row['user_id'];
|
||||
$poster = $row['username'];
|
||||
|
||||
// Handle anon users posting with usernames
|
||||
if ($poster_id == ANONYMOUS && $row['post_username'])
|
||||
{
|
||||
$poster = $row['post_username'];
|
||||
$poster_rank = $user->lang['GUEST'];
|
||||
}
|
||||
|
||||
$post_subject = $row['post_subject'];
|
||||
$message = $row['post_text'];
|
||||
|
||||
if ($row['bbcode_bitfield'])
|
||||
{
|
||||
$bbcode->bbcode_second_pass($message, $row['bbcode_uid'], $row['bbcode_bitfield']);
|
||||
}
|
||||
|
||||
$message = smilie_text($message, !$row['enable_smilies']);
|
||||
|
||||
$post_subject = censor_text($post_subject);
|
||||
$message = censor_text($message);
|
||||
|
||||
$template->assign_block_vars($mode . '_row', array(
|
||||
'POSTER_NAME' => $poster,
|
||||
'POST_SUBJECT' => $post_subject,
|
||||
'MINI_POST_IMG' => $user->img('icon_post', $user->lang['POST']),
|
||||
'POST_DATE' => $user->format_date($row['post_time']),
|
||||
'MESSAGE' => str_replace("\n", '<br />', $message),
|
||||
|
||||
'U_POST_ID' => $row['post_id'],
|
||||
'U_MINI_POST' => "{$phpbb_root_path}viewtopic.$phpEx$SID&p=" . $row['post_id'] . '#' . $row['post_id'],
|
||||
'U_MCP_DETAILS' => ($auth->acl_get('m_', $forum_id)) ? "{$phpbb_root_path}mcp.$phpEx$SID&mode=post_details&p=" . $row['post_id'] : '',
|
||||
'U_QUOTE' => ($show_quote_button && $auth->acl_get('f_quote', $forum_id)) ? 'javascript:addquote(' . $row['post_id'] . ", '" . str_replace("'", "\\'", $poster) . "')" : '')
|
||||
);
|
||||
unset($rowset[$i]);
|
||||
}
|
||||
|
||||
if ($mode == 'topic_review')
|
||||
{
|
||||
$template->assign_var('QUOTE_IMG', $user->img('btn_quote', $user->lang['REPLY_WITH_QUOTE']));
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
?>
|
Reference in New Issue
Block a user