phpBB

Code Changes

File: includes/mcp/mcp_main.php

  Unmodified   Added   Modified   Removed
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 812Line 853
		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 877
		}

$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 891
			$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 1117
		}

$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 1162
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 1240
				}

$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 1266Line 1319

$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 *