mirror of
https://github.com/phpbb/phpbb.git
synced 2025-02-19 07:41:08 +01:00
302 lines
13 KiB
PHP
302 lines
13 KiB
PHP
<?php
|
|
/***************************************************************************
|
|
* memberlist.php
|
|
* -------------------
|
|
* begin : Friday, May 11, 2001
|
|
* copyright : (C) 2001 The phpBB Group
|
|
* email : support@phpbb.com
|
|
*
|
|
* $Id$
|
|
*
|
|
***************************************************************************/
|
|
|
|
/***************************************************************************
|
|
*
|
|
* This program is free software; you can redistribute it and/or modify
|
|
* it under the terms of the GNU General Public License as published by
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
* (at your option) any later version.
|
|
*
|
|
***************************************************************************/
|
|
|
|
define('IN_PHPBB', true);
|
|
$phpbb_root_path = './';
|
|
include($phpbb_root_path . 'extension.inc');
|
|
include($phpbb_root_path . 'common.'.$phpEx);
|
|
|
|
//
|
|
// Start session management
|
|
//
|
|
$userdata = $session->start();
|
|
$acl = new acl($userdata);
|
|
|
|
$session->configure($userdata);
|
|
//
|
|
// End session management
|
|
//
|
|
|
|
$start = ( isset($HTTP_GET_VARS['start']) ) ? intval($HTTP_GET_VARS['start']) : 0;
|
|
$form = ( !empty($HTTP_GET_VARS['form']) ) ? $HTTP_GET_VARS['form'] : 0;
|
|
$field = ( isset($HTTP_GET_VARS['field']) ) ? $HTTP_GET_VARS['field'] : 'username';
|
|
|
|
$sort_by = ( !empty($HTTP_POST_VARS['sort_by']) ) ? intval($HTTP_POST_VARS['sort_by']) : ( ( !empty($HTTP_GET_VARS['sort_by']) ) ? $HTTP_GET_VARS['sort_by'] : '4' );
|
|
$sort_order = ( !empty($HTTP_POST_VARS['sort_order']) ) ? $HTTP_POST_VARS['sort_order'] : ( ( !empty($HTTP_GET_VARS['sort_order']) ) ? $HTTP_GET_VARS['sort_order'] : 'd' );
|
|
|
|
$username = ( !empty($HTTP_POST_VARS['username']) ) ? $HTTP_POST_VARS['username'] : ( ( !empty($HTTP_GET_VARS['username']) ) ? $HTTP_GET_VARS['username'] : '' );
|
|
$email = ( !empty($HTTP_POST_VARS['email']) ) ? $HTTP_POST_VARS['email'] : ( ( !empty($HTTP_GET_VARS['email']) ) ? $HTTP_GET_VARS['email'] : '' );
|
|
$icq = ( !empty($HTTP_POST_VARS['icq']) ) ? intval($HTTP_POST_VARS['icq']) : ( ( !empty($HTTP_GET_VARS['icq']) ) ? $HTTP_GET_VARS['icq'] : '' );
|
|
$aim = ( !empty($HTTP_POST_VARS['aim']) ) ? $HTTP_POST_VARS['aim'] : ( ( !empty($HTTP_GET_VARS['aim']) ) ? $HTTP_GET_VARS['aim'] : '' );
|
|
$yahoo = ( !empty($HTTP_POST_VARS['yahoo']) ) ? $HTTP_POST_VARS['yahoo'] : ( ( !empty($HTTP_GET_VARS['yahoo']) ) ? $HTTP_GET_VARS['yahoo'] : '' );
|
|
$msn = ( !empty($HTTP_POST_VARS['msn']) ) ? $HTTP_POST_VARS['msn'] : ( ( !empty($HTTP_GET_VARS['msn']) ) ? $HTTP_GET_VARS['msn'] : '' );
|
|
|
|
$joined_select = ( !empty($HTTP_POST_VARS['joined_select']) ) ? $HTTP_POST_VARS['joined_select'] : ( ( !empty($HTTP_GET_VARS['joined_select']) ) ? $HTTP_GET_VARS['joined_select'] : 'lt' );
|
|
$active_select = ( !empty($HTTP_POST_VARS['active_select']) ) ? $HTTP_POST_VARS['active_select'] : ( ( !empty($HTTP_GET_VARS['active_select']) ) ? $HTTP_GET_VARS['active_select'] : 'lt' );
|
|
$count_select = ( !empty($HTTP_POST_VARS['count_select']) ) ? $HTTP_POST_VARS['count_select'] : ( ( !empty($HTTP_GET_VARS['count_select']) ) ? $HTTP_GET_VARS['count_select'] : 'eq' );
|
|
$joined = ( !empty($HTTP_POST_VARS['joined']) ) ? explode('-', $HTTP_POST_VARS['joined']) : ( ( !empty($HTTP_GET_VARS['joined']) ) ? explode('-', $HTTP_GET_VARS['joined']) : array() );
|
|
$active = ( !empty($HTTP_POST_VARS['active']) ) ? explode('-', $HTTP_POST_VARS['active']) : ( ( !empty($HTTP_GET_VARS['active']) ) ? explode('-', $HTTP_GET_VARS['active']) : array() );
|
|
$count = ( !empty($HTTP_POST_VARS['count']) ) ? intval($HTTP_POST_VARS['count']) : ( ( !empty($HTTP_GET_VARS['count']) ) ? $HTTP_GET_VARS['count'] : '' );
|
|
|
|
|
|
|
|
|
|
|
|
if ( isset($HTTP_POST_VARS['order']) )
|
|
{
|
|
$sort_order = ($HTTP_POST_VARS['order'] == 'a') ? 'ASC' : 'DESC';
|
|
}
|
|
else if ( isset($HTTP_GET_VARS['order']) )
|
|
{
|
|
$sort_order = ($HTTP_GET_VARS['order'] == 'a') ? 'ASC' : 'DESC';
|
|
}
|
|
else
|
|
{
|
|
$sort_order = 'ASC';
|
|
}
|
|
|
|
//
|
|
// Memberlist sorting
|
|
//
|
|
$mode_types_text = array($lang['Sort_Joined'], $lang['Sort_Username'], $lang['Sort_Location'], $lang['Sort_Posts'], $lang['Sort_Email'], $lang['Sort_Website'], $lang['Sort_Top_Ten']);
|
|
$mode_types = array('joindate', 'username', 'location', 'posts', 'email', 'website', 'topten');
|
|
|
|
$select_sort_mode = '<select name="mode">';
|
|
for($i = 0; $i < count($mode_types_text); $i++)
|
|
{
|
|
$selected = ( $mode == $mode_types[$i] ) ? ' selected="selected"' : '';
|
|
$select_sort_mode .= '<option value="' . $mode_types[$i] . '"' . $selected . '>' . $mode_types_text[$i] . '</option>';
|
|
}
|
|
$select_sort_mode .= '</select>';
|
|
|
|
$select_sort_order = '<select name="order">';
|
|
$select_sort_order .= ( $sort_order == 'a' ) ? '<option value="a" selected="selected">' . $lang['Sort_Ascending'] . '</option><option value="d">' . $lang['Sort_Descending'] . '</option>' : '<option value="a">' . $lang['Sort_Ascending'] . '</option><option value="d" selected="selected">' . $lang['Sort_Descending'] . '</option>';
|
|
$select_sort_order .= '</select>';
|
|
|
|
if ( $mode != 'topten' || $board_config['topics_per_page'] < 10 )
|
|
{
|
|
$pagination = generate_pagination("memberlist.$phpEx$SID&mode=$mode&order=$sort_order", $board_config['num_users'], $board_config['topics_per_page'], $start). ' ';
|
|
$total_members = $board_config['num_users'];
|
|
}
|
|
else
|
|
{
|
|
$pagination = ' ';
|
|
$total_members = 10;
|
|
}
|
|
|
|
//
|
|
// Generate page
|
|
//
|
|
$template->assign_vars(array(
|
|
'PAGINATION' => $pagination,
|
|
'PAGE_NUMBER' => sprintf($lang['Page_of'], ( floor( $start / $board_config['topics_per_page'] ) + 1 ), ceil( $total_members / $board_config['topics_per_page'] )),
|
|
|
|
'L_SELECT_SORT_METHOD' => $lang['Select_sort_method'],
|
|
'L_EMAIL' => $lang['Email'],
|
|
'L_WEBSITE' => $lang['Website'],
|
|
'L_FROM' => $lang['Location'],
|
|
'L_ORDER' => $lang['Order'],
|
|
'L_SORT' => $lang['Sort'],
|
|
'L_SUBMIT' => $lang['Sort'],
|
|
'L_AIM' => $lang['AIM'],
|
|
'L_YIM' => $lang['YIM'],
|
|
'L_MSNM' => $lang['MSNM'],
|
|
'L_ICQ' => $lang['ICQ'],
|
|
'L_JOINED' => $lang['Joined'],
|
|
'L_POSTS' => $lang['Posts'],
|
|
'L_GOTO_PAGE' => $lang['Goto_page'],
|
|
|
|
'S_MODE_SELECT' => $select_sort_mode,
|
|
'S_ORDER_SELECT' => $select_sort_order,
|
|
'S_MODE_ACTION' => "memberlist.$phpEx$SID")
|
|
);
|
|
|
|
if ( isset($HTTP_GET_VARS['mode']) || isset($HTTP_POST_VARS['mode']) )
|
|
{
|
|
$mode = ( isset($HTTP_POST_VARS['mode']) ) ? $HTTP_POST_VARS['mode'] : $HTTP_GET_VARS['mode'];
|
|
|
|
switch( $mode )
|
|
{
|
|
case 'topten':
|
|
$order_by = "user_posts DESC LIMIT 10";
|
|
break;
|
|
case 'joined':
|
|
$order_by = "user_regdate ASC LIMIT $start, " . $board_config['topics_per_page'];
|
|
break;
|
|
case 'username':
|
|
$order_by = "username $sort_order LIMIT $start, " . $board_config['topics_per_page'];
|
|
break;
|
|
case 'location':
|
|
$order_by = "user_from $sort_order LIMIT $start, " . $board_config['topics_per_page'];
|
|
break;
|
|
case 'posts':
|
|
$order_by = "user_posts $sort_order LIMIT $start, " . $board_config['topics_per_page'];
|
|
break;
|
|
case 'email':
|
|
$order_by = "user_email $sort_order LIMIT $start, " . $board_config['topics_per_page'];
|
|
break;
|
|
case 'website':
|
|
$order_by = "user_website $sort_order LIMIT $start, " . $board_config['topics_per_page'];
|
|
break;
|
|
default:
|
|
$order_by = "user_regdate $sort_order LIMIT $start, " . $board_config['topics_per_page'];
|
|
break;
|
|
}
|
|
}
|
|
else
|
|
{
|
|
$order_by = "user_regdate $sort_order LIMIT $start, " . $board_config['topics_per_page'];
|
|
}
|
|
|
|
$sql = "SELECT username, user_id, user_viewemail, user_posts, user_regdate, user_from, user_website, user_email, user_icq, user_aim, user_yim, user_msnm, user_avatar, user_avatar_type, user_allowavatar
|
|
FROM " . USERS_TABLE . "
|
|
WHERE user_id <> " . ANONYMOUS . "
|
|
ORDER BY $order_by";
|
|
$result = $db->sql_query($sql);
|
|
|
|
if ( $row = $db->sql_fetchrow($result) )
|
|
{
|
|
$i = 0;
|
|
do
|
|
{
|
|
$username = $row['username'];
|
|
$user_id = $row['user_id'];
|
|
|
|
$from = ( !empty($row['user_from']) ) ? $row['user_from'] : ' ';
|
|
$joined = create_date($lang['DATE_FORMAT'], $row['user_regdate'], $board_config['board_timezone']);
|
|
$posts = ( $row['user_posts'] ) ? $row['user_posts'] : 0;
|
|
|
|
$poster_avatar = '';
|
|
if ( $row['user_avatar_type'] && $user_id != ANONYMOUS && $row['user_allowavatar'] )
|
|
{
|
|
switch( $row['user_avatar_type'] )
|
|
{
|
|
case USER_AVATAR_UPLOAD:
|
|
$poster_avatar = ( $board_config['allow_avatar_upload'] ) ? '<img src="' . $board_config['avatar_path'] . '/' . $row['user_avatar'] . '" alt="" border="0" />' : '';
|
|
break;
|
|
case USER_AVATAR_REMOTE:
|
|
$poster_avatar = ( $board_config['allow_avatar_remote'] ) ? '<img src="' . $row['user_avatar'] . '" alt="" border="0" />' : '';
|
|
break;
|
|
case USER_AVATAR_GALLERY:
|
|
$poster_avatar = ( $board_config['allow_avatar_local'] ) ? '<img src="' . $board_config['avatar_gallery_path'] . '/' . $row['user_avatar'] . '" alt="" border="0" />' : '';
|
|
break;
|
|
}
|
|
}
|
|
|
|
if ( $row['user_viewemail'] || $acl->get_acl_admin() )
|
|
{
|
|
$email_uri = ( $board_config['board_email_form'] ) ? "profile.$phpEx$SID&mode=email&u=" . $user_id : 'mailto:' . $row['user_email'];
|
|
|
|
$email_img = '<a href="' . $email_uri . '">' . create_img($theme['icon_email'], $lang['Send_email']) . '</a>';
|
|
$email = '<a href="' . $email_uri . '">' . $lang['Send_email'] . '</a>';
|
|
}
|
|
else
|
|
{
|
|
$email_img = ' ';
|
|
$email = ' ';
|
|
}
|
|
|
|
$temp_url = "profile.$phpEx$SID&mode=viewprofile&u=$user_id";
|
|
$profile_img = '<a href="' . $temp_url . '">' . create_img($theme['icon_profile'], $lang['Read_profile']) . '</a>';
|
|
$profile = '<a href="' . $temp_url . '">' . $lang['Read_profile'] . '</a>';
|
|
|
|
$temp_url = "privmsg.$phpEx$SID&mode=post&u=$user_id";
|
|
$pm_img = '<a href="' . $temp_url . '">' . create_img($theme['icon_pm'], $lang['Send_private_message']) . '</a>';
|
|
$pm = '<a href="' . $temp_url . '">' . $lang['Send_private_message'] . '</a>';
|
|
|
|
$www_img = ( $row['user_website'] ) ? '<a href="' . $row['user_website'] . '" target="_userwww">' . create_img($theme['icon_www'], $lang['Visit_website']) . '</a>' : '';
|
|
$www = ( $row['user_website'] ) ? '<a href="' . $row['user_website'] . '" target="_userwww">' . $lang['Visit_website'] . '</a>' : '';
|
|
|
|
if ( !empty($row['user_icq']) )
|
|
{
|
|
$icq_status_img = '<a href="http://wwp.icq.com/' . $row['user_icq'] . '#pager"><img src="http://web.icq.com/whitepages/online?icq=' . $row['user_icq'] . '&img=5" width="18" height="18" border="0" /></a>';
|
|
$icq_img = '<a href="http://wwp.icq.com/scripts/search.dll?to=' . $row['user_icq'] . '">' . create_img($theme['icon_icq'], $lang['ICQ']) . '</a>';
|
|
$icq = '<a href="http://wwp.icq.com/scripts/search.dll?to=' . $row['user_icq'] . '">' . $lang['ICQ'] . '</a>';
|
|
}
|
|
else
|
|
{
|
|
$icq_status_img = '';
|
|
$icq_img = '';
|
|
$icq = '';
|
|
}
|
|
|
|
$aim_img = ( $row['user_aim'] ) ? '<a href="aim:goim?screenname=' . $row['user_aim'] . '&message=Hello+Are+you+there?">' . create_img($theme['icon_aim'], $lang['AIM']) . '</a>' : '';
|
|
$aim = ( $row['user_aim'] ) ? '<a href="aim:goim?screenname=' . $row['user_aim'] . '&message=Hello+Are+you+there?">' . $lang['AIM'] . '</a>' : '';
|
|
|
|
$temp_url = "profile.$phpEx$SID&mode=viewprofile&u=$user_id";
|
|
$msn_img = ( $row['user_msnm'] ) ? '<a href="' . $temp_url . '">' . create_img($theme['icon_msnm'], $lang['MSNM']) . '</a>' : '';
|
|
$msn = ( $row['user_msnm'] ) ? '<a href="' . $temp_url . '">' . $lang['MSNM'] . '</a>' : '';
|
|
|
|
$yim_img = ( $row['user_yim'] ) ? '<a href="http://edit.yahoo.com/config/send_webmesg?.target=' . $row['user_yim'] . '&.src=pg">' . create_img($theme['icon_yim'], $lang['YIM']) . '</a>' : '';
|
|
$yim = ( $row['user_yim'] ) ? '<a href="http://edit.yahoo.com/config/send_webmesg?.target=' . $row['user_yim'] . '&.src=pg">' . $lang['YIM'] . '</a>' : '';
|
|
|
|
$temp_url = "search.$phpEx$SID&search_author=" . urlencode($username) . "&showresults=posts";
|
|
$search_img = '<a href="' . $temp_url . '">' . create_img($theme['icon_search'], $lang['Search_user_posts']) . '</a>';
|
|
$search = '<a href="' . $temp_url . '">' . $lang['Search_user_posts'] . '</a>';
|
|
|
|
$template->assign_block_vars('memberrow', array(
|
|
'ROW_NUMBER' => $i + ( $start + 1 ),
|
|
'USERNAME' => $username,
|
|
'FROM' => $from,
|
|
'JOINED' => $joined,
|
|
'POSTS' => $posts,
|
|
'AVATAR_IMG' => $poster_avatar,
|
|
'PROFILE_IMG' => $profile_img,
|
|
'PROFILE' => $profile,
|
|
'SEARCH_IMG' => $search_img,
|
|
'SEARCH' => $search,
|
|
'PM_IMG' => $pm_img,
|
|
'PM' => $pm,
|
|
'EMAIL_IMG' => $email_img,
|
|
'EMAIL' => $email,
|
|
'WWW_IMG' => $www_img,
|
|
'WWW' => $www,
|
|
'ICQ_STATUS_IMG' => $icq_status_img,
|
|
'ICQ_IMG' => $icq_img,
|
|
'ICQ' => $icq,
|
|
'AIM_IMG' => $aim_img,
|
|
'AIM' => $aim,
|
|
'MSN_IMG' => $msn_img,
|
|
'MSN' => $msn,
|
|
'YIM_IMG' => $yim_img,
|
|
'YIM' => $yim,
|
|
|
|
'S_ROW_COUNT' => $i,
|
|
|
|
'U_VIEWPROFILE' => "profile.$phpEx$SID&mode=viewprofile&u=$user_id")
|
|
);
|
|
|
|
$i++;
|
|
}
|
|
while ( $row = $db->sql_fetchrow($result) );
|
|
}
|
|
|
|
$page_title = $lang['Memberlist'];
|
|
include($phpbb_root_path . 'includes/page_header.'.$phpEx);
|
|
|
|
$template->set_filenames(array(
|
|
'body' => ( $mode == 'searchuser') ? 'search_username.html' : 'memberlist_body.html')
|
|
);
|
|
make_jumpbox('viewforum.'.$phpEx);
|
|
|
|
include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
|
|
|
|
?>
|