|
@@ -545,148 +545,6 @@ function ModBlockGroupRequests()
|
|
return 'group_requests_block';
|
|
return 'group_requests_block';
|
|
}
|
|
}
|
|
|
|
|
|
-/**
|
|
|
|
- * Browse all the reported posts...
|
|
|
|
- * @todo this needs to be given its own file?
|
|
|
|
- */
|
|
|
|
-function ReportedPosts()
|
|
|
|
-{
|
|
|
|
- global $txt, $context, $scripturl, $user_info, $smcFunc;
|
|
|
|
-
|
|
|
|
- loadTemplate('ModerationCenter');
|
|
|
|
-
|
|
|
|
- // Set an empty var for the server response.
|
|
|
|
- $context['report_post_action'] = '';
|
|
|
|
-
|
|
|
|
- // Put the open and closed options into tabs, because we can...
|
|
|
|
- $context[$context['moderation_menu_name']]['tab_data'] = array(
|
|
|
|
- 'title' => $txt['mc_reported_posts'],
|
|
|
|
- 'help' => '',
|
|
|
|
- 'description' => $txt['mc_reported_posts_desc'],
|
|
|
|
- );
|
|
|
|
-
|
|
|
|
- // This comes under the umbrella of moderating posts.
|
|
|
|
- if ($user_info['mod_cache']['bq'] == '0=1')
|
|
|
|
- isAllowedTo('moderate_forum');
|
|
|
|
-
|
|
|
|
- // Are they wanting to view a particular report?
|
|
|
|
- if (!empty($_REQUEST['report']))
|
|
|
|
- return ModReport();
|
|
|
|
-
|
|
|
|
- // Set up the comforting bits...
|
|
|
|
- $context['page_title'] = $txt['mc_reported_posts'];
|
|
|
|
- $context['sub_template'] = 'reported_posts';
|
|
|
|
-
|
|
|
|
- // Are we viewing open or closed reports?
|
|
|
|
- $context['view_closed'] = isset($_GET['sa']) && $_GET['sa'] == 'closed' ? 1 : 0;
|
|
|
|
-
|
|
|
|
- // Are we doing any work?
|
|
|
|
- if ((isset($_GET['ignore']) || isset($_GET['close'])) && isset($_GET['rid']))
|
|
|
|
- {
|
|
|
|
- checkSession('get');
|
|
|
|
- $_GET['rid'] = (int) $_GET['rid'];
|
|
|
|
-
|
|
|
|
- // Update the report...
|
|
|
|
- $smcFunc['db_query']('', '
|
|
|
|
- UPDATE {db_prefix}log_reported
|
|
|
|
- SET ' . (isset($_GET['ignore']) ? 'ignore_all = {int:ignore_all}' : 'closed = {int:closed}') . '
|
|
|
|
- WHERE id_report = {int:id_report}
|
|
|
|
- AND ' . $user_info['mod_cache']['bq'],
|
|
|
|
- array(
|
|
|
|
- 'ignore_all' => isset($_GET['ignore']) ? (int) $_GET['ignore'] : 0,
|
|
|
|
- 'closed' => isset($_GET['close']) ? (int) $_GET['close'] : 0,
|
|
|
|
- 'id_report' => $_GET['rid'],
|
|
|
|
- )
|
|
|
|
- );
|
|
|
|
-
|
|
|
|
- // Get the board, topic and message for this report
|
|
|
|
- $request = $smcFunc['db_query']('', '
|
|
|
|
- SELECT id_board, id_topic, id_msg
|
|
|
|
- FROM {db_prefix}log_reported
|
|
|
|
- WHERE id_report = {int:id_report}',
|
|
|
|
- array(
|
|
|
|
- 'id_report' => $_GET['rid'],
|
|
|
|
- )
|
|
|
|
- );
|
|
|
|
-
|
|
|
|
- // Set up the data for the log...
|
|
|
|
- $extra = array('report' => $_GET['rid']);
|
|
|
|
- list ($extra['board'], $extra['topic'], $extra['message']) = $smcFunc['db_fetch_row']($request);
|
|
|
|
- $smcFunc['db_free_result']($request);
|
|
|
|
-
|
|
|
|
- // Tell the user about it.
|
|
|
|
- $context['report_post_action'] = isset($_GET['ignore']) ? (!empty($_GET['ignore']) ? 'ignore' : 'unignore') : (!empty($_GET['close']) ? 'close' : 'open');
|
|
|
|
-
|
|
|
|
- // Log this action
|
|
|
|
- logAction($context['report_post_action'] . '_report', $extra);
|
|
|
|
-
|
|
|
|
- // Time to update.
|
|
|
|
- updateSettings(array('last_mod_report_action' => time()));
|
|
|
|
- recountOpenReports();
|
|
|
|
- }
|
|
|
|
- elseif (isset($_POST['close']) && isset($_POST['close_selected']))
|
|
|
|
- {
|
|
|
|
- checkSession();
|
|
|
|
-
|
|
|
|
- // All the ones to update...
|
|
|
|
- $toClose = array();
|
|
|
|
- foreach ($_POST['close'] as $rid)
|
|
|
|
- $toClose[] = (int) $rid;
|
|
|
|
-
|
|
|
|
- if (!empty($toClose))
|
|
|
|
- {
|
|
|
|
- // Get the data for each of these reports
|
|
|
|
- $request = $smcFunc['db_query']('', '
|
|
|
|
- SELECT id_report, id_board, id_topic, id_msg
|
|
|
|
- FROM {db_prefix}log_reported
|
|
|
|
- WHERE id_report IN ({array_int:report_list})
|
|
|
|
- AND ' . $user_inf['mod_cache']['bq'],
|
|
|
|
- array(
|
|
|
|
- 'id_report' => $_GET['rid'],
|
|
|
|
- )
|
|
|
|
- );
|
|
|
|
-
|
|
|
|
- while ($reports = $smcFunc['db_fetch_assoc']($request))
|
|
|
|
- {
|
|
|
|
- $report_data = array(
|
|
|
|
- 'report' => $row['id_report'],
|
|
|
|
- 'board' => $row['id_board'],
|
|
|
|
- 'topic' => $row['id_topic'],
|
|
|
|
- 'message' => $row['id_msg'],
|
|
|
|
- );
|
|
|
|
-
|
|
|
|
- // Log that this report was closed
|
|
|
|
- logAction('close_report', $report_data);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- $smcFunc['db_free_result']($request);
|
|
|
|
-
|
|
|
|
- $smcFunc['db_query']('', '
|
|
|
|
- UPDATE {db_prefix}log_reported
|
|
|
|
- SET closed = {int:is_closed}
|
|
|
|
- WHERE id_report IN ({array_int:report_list})
|
|
|
|
- AND ' . $user_info['mod_cache']['bq'],
|
|
|
|
- array(
|
|
|
|
- 'report_list' => $toClose,
|
|
|
|
- 'is_closed' => 1,
|
|
|
|
- )
|
|
|
|
- );
|
|
|
|
-
|
|
|
|
- // Time to update.
|
|
|
|
- updateSettings(array('last_mod_report_action' => time()));
|
|
|
|
- recountOpenReports();
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- // Go on and tell the result.
|
|
|
|
- $context['report_post_action'] = 'close_all';
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- // Do we deleted a message?
|
|
|
|
- if (isset($_REQUEST['done']))
|
|
|
|
- $context['report_post_action'] = 'message_deleted';
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
/**
|
|
/**
|
|
* Act as an entrace for all group related activity.
|
|
* Act as an entrace for all group related activity.
|
|
* @todo As for most things in this file, this needs to be moved somewhere appropriate?
|
|
* @todo As for most things in this file, this needs to be moved somewhere appropriate?
|