phpBB

Code Changes

File: includes/mcp/mcp_main.php

  Unmodified   Added   Modified   Removed
Line 164Line 164
				* @var	string	action		Topic quick moderation action name
* @var bool quickmod Flag indicating whether MCP is in quick moderation mode
* @since 3.1.0-a4

				* @var	string	action		Topic quick moderation action name
* @var bool quickmod Flag indicating whether MCP is in quick moderation mode
* @since 3.1.0-a4

				* @change 3.1.0-RC4 Added variables: action, quickmod

				* @changed 3.1.0-RC4 Added variables: action, quickmod

				*/
$vars = array('action', 'quickmod');
extract($phpbb_dispatcher->trigger_event('core.modify_quickmod_actions', compact($vars)));

				*/
$vars = array('action', 'quickmod');
extract($phpbb_dispatcher->trigger_event('core.modify_quickmod_actions', compact($vars)));

Line 226Line 226
			break;

default:

			break;

default:

 
				if ($quickmod)
{
switch ($action)
{
case 'lock':
case 'unlock':
case 'make_announce':
case 'make_sticky':
case 'make_global':
case 'make_normal':
case 'make_onindex':
case 'move':
case 'fork':
case 'delete_topic':
trigger_error('TOPIC_NOT_EXIST');
break;

case 'lock_post':
case 'unlock_post':
case 'delete_post':
trigger_error('POST_NOT_EXIST');
break;
}
}


				trigger_error('NO_MODE', E_USER_ERROR);
break;
}

				trigger_error('NO_MODE', E_USER_ERROR);
break;
}

Line 237Line 262
*/
function lock_unlock($action, $ids)
{

*/
function lock_unlock($action, $ids)
{

	global $auth, $user, $db, $phpEx, $phpbb_root_path, $request;

	global $auth, $user, $db, $phpEx, $phpbb_root_path, $request, $phpbb_dispatcher;


if ($action == 'lock' || $action == 'unlock')
{


if ($action == 'lock' || $action == 'unlock')
{

Line 296Line 321
		{
add_log('mod', $row['forum_id'], $row['topic_id'], 'LOG_' . strtoupper($action), $row['topic_title']);
}

		{
add_log('mod', $row['forum_id'], $row['topic_id'], 'LOG_' . strtoupper($action), $row['topic_title']);
}

 

/**
* Perform additional actions after locking/unlocking posts/topics
*
* @event core.mcp_lock_unlock_after
* @var string action Variable containing the action we perform on the posts/topics ('lock', 'unlock', 'lock_post' or 'unlock_post')
* @var array ids Array containing the post/topic IDs that have been locked/unlocked
* @var array data Array containing posts/topics data
* @since 3.1.7-RC1
*/
$vars = array(
'action',
'ids',
'data',
);
extract($phpbb_dispatcher->trigger_event('core.mcp_lock_unlock_after', compact($vars)));


$success_msg = $l_prefix . ((sizeof($ids) == 1) ? '' : 'S') . '_' . (($action == 'lock' || $action == 'lock_post') ? 'LOCKED' : 'UNLOCKED') . '_SUCCESS';



$success_msg = $l_prefix . ((sizeof($ids) == 1) ? '' : 'S') . '_' . (($action == 'lock' || $action == 'lock_post') ? 'LOCKED' : 'UNLOCKED') . '_SUCCESS';


Line 422Line 463
*/
function mcp_move_topic($topic_ids)
{

*/
function mcp_move_topic($topic_ids)
{

	global $auth, $user, $db, $template, $phpbb_log, $request;

	global $auth, $user, $db, $template, $phpbb_log, $request, $phpbb_dispatcher;

	global $phpEx, $phpbb_root_path;

// Here we limit the operation to one forum only

	global $phpEx, $phpbb_root_path;

// Here we limit the operation to one forum only

Line 583Line 624
					'poll_max_options'		=>	(int) $row['poll_max_options'],
'poll_last_vote' => (int) $row['poll_last_vote']
);

					'poll_max_options'		=>	(int) $row['poll_max_options'],
'poll_last_vote' => (int) $row['poll_last_vote']
);

 

/**
* Perform actions before shadow topic is created.
*
* @event core.mcp_main_modify_shadow_sql
* @var array shadow SQL array to be used by $db->sql_build_array
* @var array row Topic data
* @since 3.1.11-RC1
* @changed 3.1.11-RC1 Added variable: row
*/
$vars = array(
'shadow',
'row',
);
extract($phpbb_dispatcher->trigger_event('core.mcp_main_modify_shadow_sql', compact($vars)));


$db->sql_query('INSERT INTO ' . TOPICS_TABLE . $db->sql_build_array('INSERT', $shadow));



$db->sql_query('INSERT INTO ' . TOPICS_TABLE . $db->sql_build_array('INSERT', $shadow));


Line 812Line 868
		global $template;

$user->add_lang('posting');

		global $template;

$user->add_lang('posting');

 

// If there are only shadow topics, we neither need a reason nor softdelete
$sql = 'SELECT topic_id
FROM ' . TOPICS_TABLE . '
WHERE ' . $db->sql_in_set('topic_id', $topic_ids) . '
AND topic_moved_id = 0';
$result = $db->sql_query_limit($sql, 1);
$only_shadow = !$db->sql_fetchfield('topic_id');
$db->sql_freeresult($result);


$only_softdeleted = false;


$only_softdeleted = false;

		if ($auth->acl_get('m_delete', $forum_id) && $auth->acl_get('m_softdelete', $forum_id))

		if (!$only_shadow && $auth->acl_get('m_delete', $forum_id) && $auth->acl_get('m_softdelete', $forum_id))

		{
// If there are only soft deleted topics, we display a message why the option is not available
$sql = 'SELECT topic_id

		{
// If there are only soft deleted topics, we display a message why the option is not available
$sql = 'SELECT topic_id

Line 827Line 892
		}

$template->assign_vars(array(

		}

$template->assign_vars(array(

			'S_SOFTDELETED'			=> $only_softdeleted,
'S_TOPIC_MODE' => true,
'S_ALLOWED_DELETE' => $auth->acl_get('m_delete', $forum_id),
'S_ALLOWED_SOFTDELETE' => $auth->acl_get('m_softdelete', $forum_id),



			'S_SHADOW_TOPICS'					=> $only_shadow,
'S_SOFTDELETED' => $only_softdeleted,
'S_TOPIC_MODE' => true,
'S_ALLOWED_DELETE' => $auth->acl_get('m_delete', $forum_id),
'S_ALLOWED_SOFTDELETE' => $auth->acl_get('m_softdelete', $forum_id),
'DELETE_TOPIC_PERMANENTLY_EXPLAIN' => $user->lang('DELETE_TOPIC_PERMANENTLY', sizeof($topic_ids)),

		));

$l_confirm = (sizeof($topic_ids) == 1) ? 'DELETE_TOPIC' : 'DELETE_TOPICS';

		));

$l_confirm = (sizeof($topic_ids) == 1) ? 'DELETE_TOPIC' : 'DELETE_TOPICS';

Line 839Line 906
			$l_confirm .= '_PERMANENTLY';
$s_hidden_fields['delete_permanent'] = '1';
}

			$l_confirm .= '_PERMANENTLY';
$s_hidden_fields['delete_permanent'] = '1';
}

		else if (!$auth->acl_get('m_softdelete', $forum_id))

		else if ($only_shadow || !$auth->acl_get('m_softdelete', $forum_id))

		{
$s_hidden_fields['delete_permanent'] = '1';
}

		{
$s_hidden_fields['delete_permanent'] = '1';
}

Line 1065Line 1132
		}

$template->assign_vars(array(

		}

$template->assign_vars(array(

			'S_SOFTDELETED'			=> $only_softdeleted,
'S_ALLOWED_DELETE' => $auth->acl_get('m_delete', $forum_id),
'S_ALLOWED_SOFTDELETE' => $auth->acl_get('m_softdelete', $forum_id),


			'S_SOFTDELETED'						=> $only_softdeleted,
'S_ALLOWED_DELETE' => $auth->acl_get('m_delete', $forum_id),
'S_ALLOWED_SOFTDELETE' => $auth->acl_get('m_softdelete', $forum_id),
'DELETE_POST_PERMANENTLY_EXPLAIN' => $user->lang('DELETE_POST_PERMANENTLY', sizeof($post_ids)),

		));

$l_confirm = (sizeof($post_ids) == 1) ? 'DELETE_POST' : 'DELETE_POSTS';

		));

$l_confirm = (sizeof($post_ids) == 1) ? 'DELETE_POST' : 'DELETE_POSTS';

Line 1109Line 1177
function mcp_fork_topic($topic_ids)
{
global $auth, $user, $db, $template, $config;

function mcp_fork_topic($topic_ids)
{
global $auth, $user, $db, $template, $config;

	global $phpEx, $phpbb_root_path;

	global $phpEx, $phpbb_root_path, $phpbb_dispatcher;


if (!phpbb_check_ids($topic_ids, TOPICS_TABLE, 'topic_id', array('m_')))
{


if (!phpbb_check_ids($topic_ids, TOPICS_TABLE, 'topic_id', array('m_')))
{

Line 1187Line 1255
				}

$error = false;

				}

$error = false;

				$search = new $search_type($error, $phpbb_root_path, $phpEx, $auth, $config, $db, $user);

				$search = new $search_type($error, $phpbb_root_path, $phpEx, $auth, $config, $db, $user, $phpbb_dispatcher);

				$search_mode = 'post';

if ($error)

				$search_mode = 'post';

if ($error)

Line 1227Line 1295
				'poll_max_options'			=> (int) $topic_row['poll_max_options'],
'poll_vote_change' => (int) $topic_row['poll_vote_change'],
);

				'poll_max_options'			=> (int) $topic_row['poll_max_options'],
'poll_vote_change' => (int) $topic_row['poll_vote_change'],
);

 

/**
* Perform actions before forked topic is created.
*
* @event core.mcp_main_modify_fork_sql
* @var array sql_ary SQL array to be used by $db->sql_build_array
* @var array topic_row Topic data
* @since 3.1.11-RC1
* @changed 3.1.11-RC1 Added variable: topic_row
*/
$vars = array(
'sql_ary',
'topic_row',
);
extract($phpbb_dispatcher->trigger_event('core.mcp_main_modify_fork_sql', compact($vars)));


$db->sql_query('INSERT INTO ' . TOPICS_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary));
$new_topic_id = $db->sql_nextid();


$db->sql_query('INSERT INTO ' . TOPICS_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary));
$new_topic_id = $db->sql_nextid();

Line 1266Line 1349

$db->sql_query('INSERT INTO ' . POLL_OPTIONS_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary));
}


$db->sql_query('INSERT INTO ' . POLL_OPTIONS_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary));
}

 
				$db->sql_freeresult($result);

			}

$sql = 'SELECT *

			}

$sql = 'SELECT *