phpBB

Code Changes

File: includes/mcp/mcp_queue.php

  Unmodified   Added   Modified   Removed
Line 72Line 72
			case 'delete':
$post_id_list = $request->variable('post_id_list', array(0));
$topic_id_list = $request->variable('topic_id_list', array(0));

			case 'delete':
$post_id_list = $request->variable('post_id_list', array(0));
$topic_id_list = $request->variable('topic_id_list', array(0));

 
				$delete_reason = $request->variable('delete_reason', '', true);


if (!empty($post_id_list))
{


if (!empty($post_id_list))
{

Line 80Line 81
						global $phpbb_root_path, $phpEx;
include($phpbb_root_path . 'includes/mcp/mcp_main.' . $phpEx);
}

						global $phpbb_root_path, $phpEx;
include($phpbb_root_path . 'includes/mcp/mcp_main.' . $phpEx);
}

					mcp_delete_post($post_id_list, false, '', $action);

					mcp_delete_post($post_id_list, false, $delete_reason, $action);

				}
else if (!empty($topic_id_list))
{

				}
else if (!empty($topic_id_list))
{

Line 89Line 90
						global $phpbb_root_path, $phpEx;
include($phpbb_root_path . 'includes/mcp/mcp_main.' . $phpEx);
}

						global $phpbb_root_path, $phpEx;
include($phpbb_root_path . 'includes/mcp/mcp_main.' . $phpEx);
}

					mcp_delete_topic($topic_id_list, false, '', $action);

					mcp_delete_topic($topic_id_list, false, $delete_reason, $action);

				}
else
{

				}
else
{

Line 283Line 284
				$template->assign_vars(array(
'S_MCP_QUEUE' => true,
'U_APPROVE_ACTION' => append_sid("{$phpbb_root_path}mcp.$phpEx", "i=queue&p=$post_id&f=$forum_id"),

				$template->assign_vars(array(
'S_MCP_QUEUE' => true,
'U_APPROVE_ACTION' => append_sid("{$phpbb_root_path}mcp.$phpEx", "i=queue&p=$post_id&f=$forum_id"),

 
					'S_CAN_DELETE_POST'		=> $auth->acl_get('m_delete', $post_info['forum_id']),

					'S_CAN_VIEWIP'			=> $auth->acl_get('m_info', $post_info['forum_id']),
'S_POST_REPORTED' => $post_info['post_reported'],
'S_POST_UNAPPROVED' => $post_info['post_visibility'] == ITEM_UNAPPROVED || $post_info['post_visibility'] == ITEM_REAPPROVE,

					'S_CAN_VIEWIP'			=> $auth->acl_get('m_info', $post_info['forum_id']),
'S_POST_REPORTED' => $post_info['post_reported'],
'S_POST_UNAPPROVED' => $post_info['post_visibility'] == ITEM_UNAPPROVED || $post_info['post_visibility'] == ITEM_REAPPROVE,

Line 404Line 406
				$forum_options = '<option value="0"' . (($forum_id == 0) ? ' selected="selected"' : '') . '>' . $user->lang['ALL_FORUMS'] . '</option>';
foreach ($forum_list_approve as $row)
{

				$forum_options = '<option value="0"' . (($forum_id == 0) ? ' selected="selected"' : '') . '>' . $user->lang['ALL_FORUMS'] . '</option>';
foreach ($forum_list_approve as $row)
{

					$forum_options .= '<option value="' . $row['forum_id'] . '"' . (($forum_id == $row['forum_id']) ? ' selected="selected"' : '') . '>' . str_repeat('&nbsp; &nbsp;', $row['padding']) . $row['forum_name'] . '</option>';

					$forum_options .= '<option value="' . $row['forum_id'] . '"' . (($forum_id == $row['forum_id']) ? ' selected="selected"' : '') . '>' . str_repeat('&nbsp; &nbsp;', $row['padding']) . truncate_string($row['forum_name'], 30, 255, false, $user->lang['ELLIPSIS']) . '</option>';

				}

$sort_days = $total = 0;

				}

$sort_days = $total = 0;

Line 616Line 618
	*/
static public function approve_posts($action, $post_id_list, $id, $mode)
{

	*/
static public function approve_posts($action, $post_id_list, $id, $mode)
{

		global $db, $template, $user, $config, $request, $phpbb_container;

		global $db, $template, $user, $config, $request, $phpbb_container, $phpbb_dispatcher;

		global $phpEx, $phpbb_root_path;

if (!phpbb_check_ids($post_id_list, POSTS_TABLE, 'post_id', array('m_approve')))

		global $phpEx, $phpbb_root_path;

if (!phpbb_check_ids($post_id_list, POSTS_TABLE, 'post_id', array('m_approve')))

Line 763Line 765
			{
$success_msg = (sizeof($post_info) == 1) ? 'POST_' . strtoupper($action) . 'D_SUCCESS' : 'POSTS_' . strtoupper($action) . 'D_SUCCESS';
}

			{
$success_msg = (sizeof($post_info) == 1) ? 'POST_' . strtoupper($action) . 'D_SUCCESS' : 'POSTS_' . strtoupper($action) . 'D_SUCCESS';
}

 

/**
* Perform additional actions during post(s) approval
*
* @event core.approve_posts_after
* @var string action Variable containing the action we perform on the posts ('approve' or 'restore')
* @var array post_info Array containing info for all posts being approved
* @var array topic_info Array containing info for all parent topics of the posts
* @var int num_topics Variable containing number of topics
* @var bool notify_poster Variable telling if the post should be notified or not
* @var string success_msg Variable containing the language key for the success message
* @var string redirect Variable containing the redirect url
* @since 3.1.4-RC1
*/
$vars = array(
'action',
'post_info',
'topic_info',
'num_topics',
'notify_poster',
'success_msg',
'redirect',
);
extract($phpbb_dispatcher->trigger_event('core.approve_posts_after', compact($vars)));


meta_refresh(3, $redirect);
$message = $user->lang[$success_msg];


meta_refresh(3, $redirect);
$message = $user->lang[$success_msg];

Line 840Line 866
	static public function approve_topics($action, $topic_id_list, $id, $mode)
{
global $db, $template, $user, $config;

	static public function approve_topics($action, $topic_id_list, $id, $mode)
{
global $db, $template, $user, $config;

		global $phpEx, $phpbb_root_path, $request, $phpbb_container;

		global $phpEx, $phpbb_root_path, $request, $phpbb_container, $phpbb_dispatcher;


if (!phpbb_check_ids($topic_id_list, TOPICS_TABLE, 'topic_id', array('m_approve')))
{


if (!phpbb_check_ids($topic_id_list, TOPICS_TABLE, 'topic_id', array('m_approve')))
{

Line 944Line 970
					}
}
}

					}
}
}

 

/**
* Perform additional actions during topics(s) approval
*
* @event core.approve_topics_after
* @var string action Variable containing the action we perform on the posts ('approve' or 'restore')
* @var mixed topic_info Array containing info for all topics being approved
* @var array first_post_ids Array containing ids of all first posts
* @var bool notify_poster Variable telling if the poster should be notified or not
* @var string success_msg Variable containing the language key for the success message
* @var string redirect Variable containing the redirect url
* @since 3.1.4-RC1
*/
$vars = array(
'action',
'topic_info',
'first_post_ids',
'notify_poster',
'success_msg',
'redirect',
);
extract($phpbb_dispatcher->trigger_event('core.approve_topics_after', compact($vars)));


meta_refresh(3, $redirect);
$message = $user->lang[$success_msg];


meta_refresh(3, $redirect);
$message = $user->lang[$success_msg];

Line 1008Line 1056
	*/
static public function disapprove_posts($post_id_list, $id, $mode)
{

	*/
static public function disapprove_posts($post_id_list, $id, $mode)
{

		global $db, $template, $user, $config, $phpbb_container;

		global $db, $template, $user, $config, $phpbb_container, $phpbb_dispatcher;

		global $phpEx, $phpbb_root_path, $request;

if (!phpbb_check_ids($post_id_list, POSTS_TABLE, 'post_id', array('m_approve')))

		global $phpEx, $phpbb_root_path, $request;

if (!phpbb_check_ids($post_id_list, POSTS_TABLE, 'post_id', array('m_approve')))

Line 1084Line 1132
			// Build a list of posts to be disapproved and get the related topics real replies count
foreach ($post_info as $post_id => $post_data)
{

			// Build a list of posts to be disapproved and get the related topics real replies count
foreach ($post_info as $post_id => $post_data)
{

 
				if ($mode === 'unapproved_topics' && $post_data['post_visibility'] == ITEM_APPROVED)
{
continue;
}


				$post_disapprove_list[$post_id] = $post_data['topic_id'];
if (!isset($topic_posts_unapproved[$post_data['topic_id']]))
{

				$post_disapprove_list[$post_id] = $post_data['topic_id'];
if (!isset($topic_posts_unapproved[$post_data['topic_id']]))
{

Line 1091Line 1144
					$topic_posts_unapproved[$post_data['topic_id']] = 0;
}
$topic_posts_unapproved[$post_data['topic_id']]++;

					$topic_posts_unapproved[$post_data['topic_id']] = 0;
}
$topic_posts_unapproved[$post_data['topic_id']]++;

 
			}

// Do not try to disapprove if no posts are selected
if (empty($post_disapprove_list))
{
trigger_error('NO_POST_SELECTED');

			}

// Now we build the log array

			}

// Now we build the log array

Line 1194Line 1253
						continue;
}


						continue;
}


					$post_data['disapprove_reason'] = '';

					$post_data['disapprove_reason'] = $disapprove_reason;

					if (isset($disapprove_reason_lang))
{
// Okay we need to get the reason from the posters language

					if (isset($disapprove_reason_lang))
{
// Okay we need to get the reason from the posters language

Line 1238Line 1297
					}
}
}

					}
}
}


unset($lang_reasons, $post_info, $disapprove_reason, $disapprove_reason_lang);

 

if ($num_disapproved_topics)
{


if ($num_disapproved_topics)
{

Line 1274Line 1331
					$redirect = append_sid($phpbb_root_path . 'viewforum.' . $phpEx, 'f=' . $request->variable('f', 0));
}
}

					$redirect = append_sid($phpbb_root_path . 'viewforum.' . $phpEx, 'f=' . $request->variable('f', 0));
}
}

 

/**
* Perform additional actions during post(s) disapproval
*
* @event core.disapprove_posts_after
* @var array post_info Array containing info for all posts being disapproved
* @var array topic_information Array containing information for the topics
* @var array topic_posts_unapproved Array containing list of topic ids and the count of disapproved posts in them
* @var array post_disapprove_list Array containing list of posts and their topic id
* @var int num_disapproved_topics Variable containing the number of disapproved topics
* @var int num_disapproved_posts Variable containing the number of disapproved posts
* @var array lang_reasons Array containing the language keys for reasons
* @var string disapprove_reason Variable containing the language key for the success message
* @var string disapprove_reason_lang Variable containing the language key for the success message
* @var bool is_disapproving Variable telling if anything is going to be disapproved
* @var bool notify_poster Variable telling if the post should be notified or not
* @var string success_msg Variable containing the language key for the success message
* @var string redirect Variable containing the redirect url
* @since 3.1.4-RC1
*/
$vars = array(
'post_info',
'topic_information',
'topic_posts_unapproved',
'post_disapprove_list',
'num_disapproved_topics',
'num_disapproved_posts',
'lang_reasons',
'disapprove_reason',
'disapprove_reason_lang',
'is_disapproving',
'notify_poster',
'success_msg',
'redirect',
);
extract($phpbb_dispatcher->trigger_event('core.disapprove_posts_after', compact($vars)));

unset($lang_reasons, $post_info, $disapprove_reason, $disapprove_reason_lang);


meta_refresh(3, $redirect);
$message = $user->lang[$success_msg];


meta_refresh(3, $redirect);
$message = $user->lang[$success_msg];