Line 442 | Line 442 |
---|
$messenger = new messenger(false);
$messenger->template('profile_send_im', $row['user_lang']);
|
$messenger = new messenger(false);
$messenger->template('profile_send_im', $row['user_lang']);
|
$messenger->subject(htmlspecialchars_decode($subject));
| $messenger->subject(html_entity_decode($subject, ENT_COMPAT));
|
$messenger->replyto($user->data['user_email']); $messenger->set_addresses($row);
$messenger->assign_vars(array( 'BOARD_CONTACT' => phpbb_get_board_contact($config, $phpEx),
|
$messenger->replyto($user->data['user_email']); $messenger->set_addresses($row);
$messenger->assign_vars(array( 'BOARD_CONTACT' => phpbb_get_board_contact($config, $phpEx),
|
'FROM_USERNAME' => htmlspecialchars_decode($user->data['username']), 'TO_USERNAME' => htmlspecialchars_decode($row['username']), 'MESSAGE' => htmlspecialchars_decode($message))
| '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))
|
);
$messenger->send(NOTIFY_IM);
| );
$messenger->send(NOTIFY_IM);
|
Line 804 | Line 804 |
---|
'S_USER_NOTES' => ($user_notes_enabled) ? true : false, 'S_WARN_USER' => ($warn_user_enabled) ? true : false, 'S_ZEBRA' => ($user->data['user_id'] != $user_id && $user->data['is_registered'] && $zebra_enabled) ? true : false,
|
'S_USER_NOTES' => ($user_notes_enabled) ? true : false, 'S_WARN_USER' => ($warn_user_enabled) ? true : false, 'S_ZEBRA' => ($user->data['user_id'] != $user_id && $user->data['is_registered'] && $zebra_enabled) ? true : false,
|
'U_ADD_FRIEND' => (!$friend && !$foe && $friends_enabled) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=zebra&add=' . urlencode(htmlspecialchars_decode($member['username']))) : '', 'U_ADD_FOE' => (!$friend && !$foe && $foes_enabled) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=zebra&mode=foes&add=' . urlencode(htmlspecialchars_decode($member['username']))) : '',
| 'U_ADD_FRIEND' => (!$friend && !$foe && $friends_enabled) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=zebra&add=' . urlencode(html_entity_decode($member['username'], ENT_COMPAT))) : '', 'U_ADD_FOE' => (!$friend && !$foe && $foes_enabled) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=zebra&mode=foes&add=' . urlencode(html_entity_decode($member['username'], ENT_COMPAT))) : '',
|
'U_REMOVE_FRIEND' => ($friend && $friends_enabled) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=zebra&remove=1&usernames[]=' . $user_id) : '', 'U_REMOVE_FOE' => ($foe && $foes_enabled) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=zebra&remove=1&mode=foes&usernames[]=' . $user_id) : '',
| 'U_REMOVE_FRIEND' => ($friend && $friends_enabled) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=zebra&remove=1&usernames[]=' . $user_id) : '', 'U_REMOVE_FOE' => ($foe && $foes_enabled) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=zebra&remove=1&mode=foes&usernames[]=' . $user_id) : '',
|
Line 941 | Line 941 |
---|
} else if ($topic_id) {
|
} else if ($topic_id) {
|
$sql = '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 . ' as f, ' . TOPICS_TABLE . ' as t WHERE t.forum_id = f.forum_id';
| // 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, f.forum_options, t.topic_title', 'FROM' => [ FORUMS_TABLE => 'f', TOPICS_TABLE => 't', ], 'WHERE' => 't.forum_id = f.forum_id AND t.topic_id = ' . (int) $topic_id, ];
$sql = $db->sql_build_query('SELECT', $navlinks_sql_array);
|
$result = $db->sql_query($sql); $topic_data = $db->sql_fetchrow($result); $db->sql_freeresult($result);
| $result = $db->sql_query($sql); $topic_data = $db->sql_fetchrow($result); $db->sql_freeresult($result);
|
Line 980 | Line 989 |
---|
WHERE ' . $db->sql_in_set('user_type', $user_types) . ' AND username_clean ' . $db->sql_like_expression(utf8_clean_string($username_chars) . $db->get_any_char()); $result = $db->sql_query_limit($sql, 10);
|
WHERE ' . $db->sql_in_set('user_type', $user_types) . ' AND username_clean ' . $db->sql_like_expression(utf8_clean_string($username_chars) . $db->get_any_char()); $result = $db->sql_query_limit($sql, 10);
|
$user_list = array();
| $user_list = [];
|
while ($row = $db->sql_fetchrow($result)) {
|
while ($row = $db->sql_fetchrow($result)) {
|
$user_list[] = array(
| $user_list[] = [
|
'user_id' => (int) $row['user_id'],
|
'user_id' => (int) $row['user_id'],
|
'result' => $row['username'],
| 'result' => html_entity_decode($row['username']),
|
'username_full' => get_username_string('full', $row['user_id'], $row['username'], $row['user_colour']), 'display' => get_username_string('no_profile', $row['user_id'], $row['username'], $row['user_colour']),
|
'username_full' => get_username_string('full', $row['user_id'], $row['username'], $row['user_colour']), 'display' => get_username_string('no_profile', $row['user_id'], $row['username'], $row['user_colour']),
|
);
| ];
|
} $db->sql_freeresult($result);
|
} $db->sql_freeresult($result);
|
|
|
$json_response = new \phpbb\json_response();
|
$json_response = new \phpbb\json_response();
|
$json_response->send(array(
| $json_response->send([
|
'keyword' => $username_chars, 'results' => $user_list,
|
'keyword' => $username_chars, 'results' => $user_list,
|
));
| ]);
|
break;
| break;
|
Line 1018 | Line 1030 |
---|
$sort_key_text = array('a' => $user->lang['SORT_USERNAME'], 'c' => $user->lang['SORT_JOINED'], 'd' => $user->lang['SORT_POST_COUNT']); $sort_key_sql = array('a' => 'u.username_clean', 'c' => 'u.user_regdate', 'd' => 'u.user_posts');
|
$sort_key_text = array('a' => $user->lang['SORT_USERNAME'], 'c' => $user->lang['SORT_JOINED'], 'd' => $user->lang['SORT_POST_COUNT']); $sort_key_sql = array('a' => 'u.username_clean', 'c' => 'u.user_regdate', 'd' => 'u.user_posts');
|
if ($config['jab_enable'])
| if ($config['jab_enable'] && $auth->acl_get('u_sendim'))
|
{ $sort_key_text['k'] = $user->lang['JABBER']; $sort_key_sql['k'] = 'u.user_jabber';
| { $sort_key_text['k'] = $user->lang['JABBER']; $sort_key_sql['k'] = 'u.user_jabber';
|
Line 1033 | Line 1045 |
---|
if ($auth->acl_get('u_viewonline')) { $sort_key_text['l'] = $user->lang['SORT_LAST_ACTIVE'];
|
if ($auth->acl_get('u_viewonline')) { $sort_key_text['l'] = $user->lang['SORT_LAST_ACTIVE'];
|
$sort_key_sql['l'] = 'u.user_lastvisit';
| $sort_key_sql['l'] = 'u.user_last_active';
|
}
$sort_key_text['m'] = $user->lang['SORT_RANK'];
| }
$sort_key_text['m'] = $user->lang['SORT_RANK'];
|
Line 1135 | Line 1147 |
---|
{ if ($active_select === 'lt' && (int) $active[0] == 0 && (int) $active[1] == 0 && (int) $active[2] == 0) {
|
{ if ($active_select === 'lt' && (int) $active[0] == 0 && (int) $active[1] == 0 && (int) $active[2] == 0) {
|
$sql_where .= ' AND u.user_lastvisit = 0';
| $sql_where .= ' AND u.user_last_active = 0';
|
} else if ($active_select === 'gt') {
|
} else if ($active_select === 'gt') {
|
$sql_where .= ' AND u.user_lastvisit ' . $find_key_match[$active_select] . ' ' . $active_time;
| $sql_where .= ' AND u.user_last_active ' . $find_key_match[$active_select] . ' ' . $active_time;
|
} else {
|
} else {
|
$sql_where .= ' AND (u.user_lastvisit > 0 AND u.user_lastvisit < ' . $active_time . ')';
| $sql_where .= ' AND (u.user_last_active > 0 AND u.user_last_active < ' . $active_time . ')';
|
} } }
| } } }
|
Line 1631 | Line 1643 |
---|
if (count($user_list)) { // Session time?! Session time...
|
if (count($user_list)) { // Session time?! Session time...
|
$sql = 'SELECT session_user_id, MAX(session_time) AS session_time
| $sql = 'SELECT session_user_id, MAX(session_time) AS session_time, MIN(session_viewonline) AS session_viewonline
|
FROM ' . SESSIONS_TABLE . ' WHERE session_time >= ' . (time() - $config['session_length']) . ' AND ' . $db->sql_in_set('session_user_id', $user_list) . ' GROUP BY session_user_id'; $result = $db->sql_query($sql);
|
FROM ' . SESSIONS_TABLE . ' WHERE session_time >= ' . (time() - $config['session_length']) . ' AND ' . $db->sql_in_set('session_user_id', $user_list) . ' GROUP BY session_user_id'; $result = $db->sql_query($sql);
|
$session_times = array();
| $session_ary = [];
|
while ($row = $db->sql_fetchrow($result)) {
|
while ($row = $db->sql_fetchrow($result)) {
|
$session_times[$row['session_user_id']] = $row['session_time'];
| $session_ary[$row['session_user_id']] = [ 'session_time' => $row['session_time'], 'session_viewonline' => $row['session_viewonline'], ];
|
} $db->sql_freeresult($result);
| } $db->sql_freeresult($result);
|
Line 1705 | Line 1720 |
---|
$id_cache = array(); while ($row = $db->sql_fetchrow($result)) {
|
$id_cache = array(); while ($row = $db->sql_fetchrow($result)) {
|
$row['session_time'] = (!empty($session_times[$row['user_id']])) ? $session_times[$row['user_id']] : 0; $row['last_visit'] = (!empty($row['session_time'])) ? $row['session_time'] : $row['user_lastvisit'];
| $row['session_time'] = $session_ary[$row['user_id']]['session_time'] ?? 0; $row['session_viewonline'] = $session_ary[$row['user_id']]['session_viewonline'] ?? 0; $row['last_visit'] = $row['user_last_active'] ?: $row['session_time'];
|
$id_cache[$row['user_id']] = $row; }
| $id_cache[$row['user_id']] = $row; }
|