mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-30 21:40:43 +02:00
Merge remote-tracking branch 'nickvergessen/feature/php-events-4' into develop
This commit is contained in:
@@ -21,7 +21,7 @@ if (!defined('IN_PHPBB'))
|
||||
function view_message($id, $mode, $folder_id, $msg_id, $folder, $message_row)
|
||||
{
|
||||
global $user, $template, $auth, $db, $cache;
|
||||
global $phpbb_root_path, $request, $phpEx, $config;
|
||||
global $phpbb_root_path, $request, $phpEx, $config, $phpbb_dispatcher;
|
||||
|
||||
$user->add_lang(array('viewtopic', 'memberlist'));
|
||||
|
||||
@@ -204,7 +204,7 @@ function view_message($id, $mode, $folder_id, $msg_id, $folder, $message_row)
|
||||
}
|
||||
}
|
||||
|
||||
$template->assign_vars(array(
|
||||
$msg_data = array(
|
||||
'MESSAGE_AUTHOR_FULL' => get_username_string('full', $author_id, $user_info['username'], $user_info['user_colour'], $user_info['username']),
|
||||
'MESSAGE_AUTHOR_COLOUR' => get_username_string('colour', $author_id, $user_info['username'], $user_info['user_colour'], $user_info['username']),
|
||||
'MESSAGE_AUTHOR' => get_username_string('username', $author_id, $user_info['username'], $user_info['user_colour'], $user_info['username']),
|
||||
@@ -265,9 +265,28 @@ function view_message($id, $mode, $folder_id, $msg_id, $folder, $message_row)
|
||||
'S_CUSTOM_FIELDS' => (!empty($cp_row['row'])) ? true : false,
|
||||
|
||||
'U_PRINT_PM' => ($config['print_pm'] && $auth->acl_get('u_pm_printpm')) ? "$url&f=$folder_id&p=" . $message_row['msg_id'] . "&view=print" : '',
|
||||
'U_FORWARD_PM' => ($config['forward_pm'] && $auth->acl_get('u_sendpm') && $auth->acl_get('u_pm_forward')) ? "$url&mode=compose&action=forward&f=$folder_id&p=" . $message_row['msg_id'] : '')
|
||||
'U_FORWARD_PM' => ($config['forward_pm'] && $auth->acl_get('u_sendpm') && $auth->acl_get('u_pm_forward')) ? "$url&mode=compose&action=forward&f=$folder_id&p=" . $message_row['msg_id'] : '',
|
||||
);
|
||||
|
||||
/**
|
||||
* Modify pm and sender data before it is assigned to the template
|
||||
*
|
||||
* @event core.ucp_pm_view_messsage
|
||||
* @var mixed id Active module category (can be int or string)
|
||||
* @var string mode Active module
|
||||
* @var int folder_id ID of the folder the message is in
|
||||
* @var int msg_id ID of the private message
|
||||
* var array folder Array with data of user's message folders
|
||||
* @var array message_row Array with message data
|
||||
* @var array cp_row Array with senders custom profile field data
|
||||
* @var array msg_data Template array with message data
|
||||
* @since 3.1-A1
|
||||
*/
|
||||
$vars = array('id', 'mode', 'folder_id', 'msg_id', 'folder', 'message_row', 'cp_row', 'msg_data');
|
||||
extract($phpbb_dispatcher->trigger_event('core.ucp_pm_view_messsage', compact($vars)));
|
||||
|
||||
$template->assign_vars($msg_data);
|
||||
|
||||
// Display the custom profile fields
|
||||
if (!empty($cp_row['row']))
|
||||
{
|
||||
|
@@ -25,7 +25,7 @@ class ucp_zebra
|
||||
|
||||
function main($id, $mode)
|
||||
{
|
||||
global $config, $db, $user, $auth, $template, $phpbb_root_path, $phpEx, $request;
|
||||
global $config, $db, $user, $auth, $template, $phpbb_root_path, $phpEx, $request, $phpbb_dispatcher;
|
||||
|
||||
$submit = (isset($_POST['submit']) || isset($_GET['add']) || isset($_GET['remove'])) ? true : false;
|
||||
$s_hidden_fields = '';
|
||||
@@ -54,9 +54,22 @@ class ucp_zebra
|
||||
// Remove users
|
||||
if (!empty($data['usernames']))
|
||||
{
|
||||
$user_ids = $data['usernames'];
|
||||
|
||||
/**
|
||||
* Remove users from friends/foes
|
||||
*
|
||||
* @event core.ucp_remove_zebra
|
||||
* @var string mode Zebra type: friends|foes
|
||||
* @var array user_ids User ids we remove
|
||||
* @since 3.1-A1
|
||||
*/
|
||||
$vars = array('user_ids');
|
||||
extract($phpbb_dispatcher->trigger_event('core.ucp_remove_zebra', compact($vars)));
|
||||
|
||||
$sql = 'DELETE FROM ' . ZEBRA_TABLE . '
|
||||
WHERE user_id = ' . $user->data['user_id'] . '
|
||||
AND ' . $db->sql_in_set('zebra_id', $data['usernames']);
|
||||
AND ' . $db->sql_in_set('zebra_id', $user_ids);
|
||||
$db->sql_query($sql);
|
||||
|
||||
$updated = true;
|
||||
@@ -186,6 +199,19 @@ class ucp_zebra
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Add users to friends/foes
|
||||
*
|
||||
* @event core.ucp_add_zebra
|
||||
* @var string mode Zebra type:
|
||||
* friends|foes
|
||||
* @var array sql_ary Array of
|
||||
* entries we add
|
||||
* @since 3.1-A1
|
||||
*/
|
||||
$vars = array('mode', 'sql_ary');
|
||||
extract($phpbb_dispatcher->trigger_event('core.ucp_add_zebra', compact($vars)));
|
||||
|
||||
$db->sql_multi_insert(ZEBRA_TABLE, $sql_ary);
|
||||
|
||||
$updated = true;
|
||||
|
Reference in New Issue
Block a user