mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-07 20:08:53 +00:00
[ticket/17493] Remove memberlist IM page
PHPBB-17493
This commit is contained in:
parent
30178ee443
commit
e32ebda982
2 changed files with 2 additions and 162 deletions
|
@ -373,120 +373,6 @@ switch ($mode)
|
|||
);
|
||||
break;
|
||||
|
||||
case 'contact':
|
||||
|
||||
$page_title = $user->lang['IM_USER'];
|
||||
$template_html = 'memberlist_im.html';
|
||||
|
||||
if (!$auth->acl_get('u_sendim'))
|
||||
{
|
||||
send_status_line(403, 'Forbidden');
|
||||
trigger_error('NOT_AUTHORISED');
|
||||
}
|
||||
|
||||
$presence_img = '';
|
||||
switch ($action)
|
||||
{
|
||||
case 'jabber':
|
||||
$lang = 'JABBER';
|
||||
$sql_field = 'user_jabber';
|
||||
$s_select = (@extension_loaded('xml') && $config['jab_enable']) ? 'S_SEND_JABBER' : 'S_NO_SEND_JABBER';
|
||||
$s_action = append_sid("{$phpbb_root_path}memberlist.$phpEx", "mode=contact&action=$action&u=$user_id");
|
||||
break;
|
||||
|
||||
default:
|
||||
trigger_error('NO_MODE', E_USER_ERROR);
|
||||
break;
|
||||
}
|
||||
|
||||
// Grab relevant data
|
||||
$sql = "SELECT user_id, username, user_email, user_lang, $sql_field
|
||||
FROM " . USERS_TABLE . "
|
||||
WHERE user_id = $user_id
|
||||
AND user_type IN (" . USER_NORMAL . ', ' . USER_FOUNDER . ')';
|
||||
$result = $db->sql_query($sql);
|
||||
$row = $db->sql_fetchrow($result);
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
if (!$row)
|
||||
{
|
||||
trigger_error('NO_USER');
|
||||
}
|
||||
else if (empty($row[$sql_field]))
|
||||
{
|
||||
trigger_error('IM_NO_DATA');
|
||||
}
|
||||
|
||||
// Post data grab actions
|
||||
switch ($action)
|
||||
{
|
||||
case 'jabber':
|
||||
add_form_key('memberlist_messaging');
|
||||
|
||||
if ($submit && @extension_loaded('xml') && $config['jab_enable'])
|
||||
{
|
||||
if (check_form_key('memberlist_messaging'))
|
||||
{
|
||||
|
||||
$subject = sprintf($user->lang['IM_JABBER_SUBJECT'], $user->data['username'], $config['server_name']);
|
||||
$message = $request->variable('message', '', true);
|
||||
|
||||
if (empty($message))
|
||||
{
|
||||
trigger_error('EMPTY_MESSAGE_IM');
|
||||
}
|
||||
|
||||
$jabber = $phpbb_container->get('messenger.method.jabber');
|
||||
$jabber->set_use_queue(false);
|
||||
|
||||
$jabber->template('profile_send_im', $row['user_lang']);
|
||||
$jabber->subject(html_entity_decode($subject, ENT_COMPAT));
|
||||
$jabber->set_addresses($row);
|
||||
|
||||
$jabber->assign_vars([
|
||||
'BOARD_CONTACT' => phpbb_get_board_contact($config, $phpEx),
|
||||
'FROM_USERNAME' => html_entity_decode($user->data['username'], ENT_COMPAT),
|
||||
'TO_USERNAME' => html_entity_decode($row['username'], ENT_COMPAT),
|
||||
'MESSAGE' => html_entity_decode($message, ENT_COMPAT),
|
||||
]);
|
||||
|
||||
$jabber->send();
|
||||
|
||||
$s_select = 'S_SENT_JABBER';
|
||||
}
|
||||
else
|
||||
{
|
||||
trigger_error('FORM_INVALID');
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
$template->assign_block_vars('navlinks', array(
|
||||
'BREADCRUMB_NAME' => $page_title,
|
||||
'U_BREADCRUMB' => append_sid("{$phpbb_root_path}memberlist.$phpEx", "mode=contact&action=$action&u=$user_id"),
|
||||
));
|
||||
|
||||
// Send vars to the template
|
||||
$template->assign_vars(array(
|
||||
'IM_CONTACT' => $row[$sql_field],
|
||||
'A_IM_CONTACT' => addslashes($row[$sql_field]),
|
||||
|
||||
'USERNAME' => $row['username'],
|
||||
'CONTACT_NAME' => $row[$sql_field],
|
||||
'SITENAME' => $config['sitename'],
|
||||
|
||||
'PRESENCE_IMG' => $presence_img,
|
||||
|
||||
'L_SEND_IM_EXPLAIN' => $user->lang['IM_' . $lang],
|
||||
'L_IM_SENT_JABBER' => sprintf($user->lang['IM_SENT_JABBER'], $row['username']),
|
||||
|
||||
$s_select => true,
|
||||
'S_IM_ACTION' => $s_action)
|
||||
);
|
||||
|
||||
break;
|
||||
|
||||
case 'viewprofile':
|
||||
// Display a profile
|
||||
if ($user_id == ANONYMOUS && !$username)
|
||||
|
@ -950,8 +836,8 @@ switch ($mode)
|
|||
{
|
||||
// Generate the navlinks based on the selected topic
|
||||
$navlinks_sql_array = [
|
||||
'SELECT' => 'f.parent_id, f.forum_parents, f.left_id, f.right_id, f.forum_type, f.forum_name,
|
||||
f.forum_id, f.forum_desc, f.forum_desc_uid, f.forum_desc_bitfield, f.forum_desc_options,
|
||||
'SELECT' => 'f.parent_id, f.forum_parents, f.left_id, f.right_id, f.forum_type, f.forum_name,
|
||||
f.forum_id, f.forum_desc, f.forum_desc_uid, f.forum_desc_bitfield, f.forum_desc_options,
|
||||
f.forum_options, t.topic_title',
|
||||
'FROM' => [
|
||||
FORUMS_TABLE => 'f',
|
||||
|
|
|
@ -1,46 +0,0 @@
|
|||
<!-- INCLUDE simple_header.html -->
|
||||
|
||||
<h2>{L_SEND_IM}</h2>
|
||||
|
||||
<form method="post" action="{S_IM_ACTION}">
|
||||
|
||||
<div class="panel bg2">
|
||||
<div class="inner">
|
||||
|
||||
<p>{L_SEND_IM_EXPLAIN}</p>
|
||||
|
||||
<!-- IF S_SENT_JABBER -->
|
||||
<p>{L_IM_SENT_JABBER}</p>
|
||||
<!-- ENDIF -->
|
||||
|
||||
<fieldset>
|
||||
<dl class="fields2">
|
||||
<dt><label>{L_IM_RECIPIENT}{L_COLON}</label></dt>
|
||||
<dd><strong>{USERNAME}</strong><!-- IF S_NO_SEND_JABBER --> [ {IM_CONTACT} ]<!-- ENDIF --><!-- IF PRESENCE_IMG --> {PRESENCE_IMG}<!-- ENDIF --></dd>
|
||||
</dl>
|
||||
|
||||
<!-- IF S_SEND_JABBER -->
|
||||
<dl class="fields2">
|
||||
<dt><label for="message">{L_IM_MESSAGE}{L_COLON}</label></dt>
|
||||
<dd><textarea class="inputbox autowidth" name="message" id="message" rows="5" cols="45"></textarea></dd>
|
||||
</dl>
|
||||
<dl class="fields2">
|
||||
<dt> </dt>
|
||||
<dd><input class="button1 button button-form" name="submit" type="submit" value="{L_IM_SEND}" /></dd>
|
||||
</dl>
|
||||
<!-- ELSE IF S_NO_SEND_JABBER -->
|
||||
<dl class="fields2">
|
||||
<dt> </dt>
|
||||
<dd>{L_IM_NO_JABBER}</dd>
|
||||
</dl>
|
||||
<!-- ENDIF -->
|
||||
{S_FORM_TOKEN}
|
||||
</fieldset>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<a href="#" onclick="window.close(); return false;">{L_CLOSE_WINDOW}</a>
|
||||
|
||||
<!-- INCLUDE simple_footer.html -->
|
Loading…
Add table
Reference in a new issue