1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-06 16:56:44 +02:00

- fork/copy topic

- resync topics
- possible to show only reported posts in topic_view
- view reports in post details
- mcp_queue (show unapproved items)


git-svn-id: file:///svn/phpbb/trunk@4924 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Meik Sievertsen
2004-07-10 22:47:43 +00:00
parent bdd1643a7d
commit 6a69106501
12 changed files with 988 additions and 384 deletions

View File

@@ -33,6 +33,21 @@ function mcp_forum_view($id, $mode, $action, $url, $forum_info)
$post_id_list = request_var('post_id_list', 0);
$topic_id = request_var('t', 0);
// Resync Topics
if ($action == 'resync')
{
$topic_ids = get_array('topic_id_list', 0);
if (!$topic_ids)
{
$template->assign_var('MESSAGE', $user->lang['NO_TOPIC_SELECTED']);
}
else
{
mcp_resync_topics($topic_ids);
}
}
$selected_ids = '';
if ($post_id_list)
{
@@ -166,7 +181,7 @@ function mcp_forum_view($id, $mode, $action, $url, $forum_info)
'S_SELECT_TOPIC' => ($action == 'merge_select' && $row['topic_id'] != $topic_id) ? true : false,
'U_SELECT_TOPIC' => $url . '&mode=topic_view&action=merge&to_topic_id=' . $row['topic_id'] . $selected_ids,
'U_MCP_QUEUE' => $url . '&i=queue&mode=approve&t=' . $row['topic_id'],
'U_MCP_REPORT' => $url . '&mode=reports&t=' . $row['topic_id'],
'U_MCP_REPORT' => "mcp.$phpEx$SID&i=main&mode=topic_view&t={$row['topic_id']}&action=reports",
'ATTACH_ICON_IMG' => ($auth->acl_gets('f_download', 'u_download', $row['forum_id']) && $row['topic_attachment']) ? $user->img('icon_attach', sprintf($user->lang['TOTAL_ATTACHMENTS'], $row['topic_attachment'])) : '',
'TOPIC_FOLDER_IMG' => $folder_img,
@@ -184,4 +199,41 @@ function mcp_forum_view($id, $mode, $action, $url, $forum_info)
unset($topic_rows);
}
function mcp_resync_topics($topic_ids)
{
global $auth, $db, $template, $phpEx, $user, $SID, $phpbb_root_path;
if (!($forum_id = check_ids($topic_ids, TOPICS_TABLE, 'topic_id', 'm_')))
{
return;
}
if (!sizeof($topic_ids))
{
$template->assign_var('MESSAGE', $user->lang['NO_TOPIC_SELECTED']);
return;
}
// Sync everything and perform extra checks separately
sync('topic_reported', 'topic_id', $topic_ids, false, true);
sync('topic_attachment', 'topic_id', $topic_ids, false, true);
sync('topic', 'topic_id', $topic_ids, true, false);
$sql = 'SELECT topic_id, forum_id, topic_title
FROM ' . TOPICS_TABLE . '
WHERE topic_id IN (' . implode(', ', $topic_ids) . ')';
$result = $db->sql_query($sql);
// Log this action
while ($row = $db->sql_fetchrow($result))
{
add_log('mod', $row['forum_id'], $row['topic_id'], 'LOG_TOPIC_RESYNC', $row['topic_title']);
}
$msg = (sizeof($topic_ids) == 1) ? $user->lang['TOPIC_RESYNC_SUCCESS'] : $user->lang['TOPICS_RESYNC_SUCCESS'];
$template->assign_var('MESSAGE', $msg);
return;
}
?>