phpBB

Code Changes

File: includes/mcp/mcp_post.php

  Unmodified   Added   Modified   Removed
Line 26Line 26
{
global $phpEx, $phpbb_root_path, $config;
global $template, $db, $user, $auth, $cache;

{
global $phpEx, $phpbb_root_path, $config;
global $template, $db, $user, $auth, $cache;

 
	global $phpbb_dispatcher;


$user->add_lang('posting');



$user->add_lang('posting');


Line 104Line 105
					trigger_error('FORM_INVALID');
}
}

					trigger_error('FORM_INVALID');
}
}

 

break;

default:

/**
* This event allows you to handle custom post moderation options
*
* @event core.mcp_post_additional_options
* @var string action Post moderation action name
* @var array post_info Information on the affected post
* @since 3.1.5-RC1
*/
$vars = array('action', 'post_info');
extract($phpbb_dispatcher->trigger_event('core.mcp_post_additional_options', compact($vars)));


break;
}


break;
}

Line 197Line 213
		$l_deleted_by = '';
}


		$l_deleted_by = '';
}


	$template->assign_vars(array(

	$mcp_post_template_data = array(

		'U_MCP_ACTION'			=> "$url&i=main&quickmod=1&mode=post_details", // Use this for mode paramaters
'U_POST_ACTION' => "$url&i=$id&mode=post_details", // Use this for action parameters
'U_APPROVE_ACTION' => append_sid("{$phpbb_root_path}mcp.$phpEx", "i=queue&p=$post_id&f={$post_info['forum_id']}"),

		'U_MCP_ACTION'			=> "$url&i=main&quickmod=1&mode=post_details", // Use this for mode paramaters
'U_POST_ACTION' => "$url&i=$id&mode=post_details", // Use this for action parameters
'U_APPROVE_ACTION' => append_sid("{$phpbb_root_path}mcp.$phpEx", "i=queue&p=$post_id&f={$post_info['forum_id']}"),

Line 249Line 265

'U_LOOKUP_IP' => ($auth->acl_get('m_info', $post_info['forum_id'])) ? "$url&i=$id&mode=$mode&lookup={$post_info['poster_ip']}#ip" : '',
'U_WHOIS' => ($auth->acl_get('m_info', $post_info['forum_id'])) ? append_sid("{$phpbb_root_path}mcp.$phpEx", "i=$id&mode=$mode&action=whois&p=$post_id&ip={$post_info['poster_ip']}") : '',


'U_LOOKUP_IP' => ($auth->acl_get('m_info', $post_info['forum_id'])) ? "$url&i=$id&mode=$mode&lookup={$post_info['poster_ip']}#ip" : '',
'U_WHOIS' => ($auth->acl_get('m_info', $post_info['forum_id'])) ? append_sid("{$phpbb_root_path}mcp.$phpEx", "i=$id&mode=$mode&action=whois&p=$post_id&ip={$post_info['poster_ip']}") : '',

	));


























	);

$s_additional_opts = false;

/**
* Event to add/modify MCP post template data
*
* @event core.mcp_post_template_data
* @var array post_info Array with the post information
* @var array mcp_post_template_data Array with the MCP post template data
* @var array attachments Array with the post attachments, if any
* @var bool s_additional_opts Must be set to true in extension if additional options are presented in MCP post panel
* @since 3.1.5-RC1
*/
$vars = array(
'post_info',
'mcp_post_template_data',
'attachments',
's_additional_opts',
);
extract($phpbb_dispatcher->trigger_event('core.mcp_post_template_data', compact($vars)));

$template->assign_vars($mcp_post_template_data);
$template->assign_var('S_MCP_POST_ADDITIONAL_OPTS', $s_additional_opts);

unset($mcp_post_template_data);


// Get User Notes
$log_data = array();


// Get User Notes
$log_data = array();

Line 420Line 461
*/
function change_poster(&$post_info, $userdata)
{

*/
function change_poster(&$post_info, $userdata)
{

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

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


if (empty($userdata) || $userdata['user_id'] == $post_info['user_id'])
{


if (empty($userdata) || $userdata['user_id'] == $post_info['user_id'])
{

Line 497Line 538
	{
// We do some additional checks in the module to ensure it can actually be utilised
$error = false;

	{
// We do some additional checks in the module to ensure it can actually be utilised
$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);


if (!$error && method_exists($search, 'destroy_cache'))
{


if (!$error && method_exists($search, 'destroy_cache'))
{

Line 507Line 548

$from_username = $post_info['username'];
$to_username = $userdata['username'];


$from_username = $post_info['username'];
$to_username = $userdata['username'];

 

/**
* This event allows you to perform additional tasks after changing a post's poster
*
* @event core.mcp_change_poster_after
* @var array userdata Information on a post's new poster
* @var array post_info Information on the affected post
* @since 3.1.6-RC1
* @changed 3.1.7-RC1 Change location to prevent post_info from being set to the new post information
*/
$vars = array('userdata', 'post_info');
extract($phpbb_dispatcher->trigger_event('core.mcp_change_poster_after', compact($vars)));


// Renew post info
$post_info = phpbb_get_post_data(array($post_id), false, true);


// Renew post info
$post_info = phpbb_get_post_data(array($post_id), false, true);