';
for($i = 0; $i < count($mode_types_text); $i++)
{
$selected = ( $mode == $mode_types[$i] ) ? ' selected="selected"' : '';
$select_sort_mode .= '';
}
$select_sort_mode .= '';
$select_sort_order = '';
//
// Generate page
//
$page_title = $lang['Memberlist'];
include("includes/page_header.php");
$template->set_filenames(array(
'body' => 'memberlist_body.tpl')
);
if (is_active("Forums")) {
make_jumpbox('viewforum.'.$phpEx);
}
$template->assign_vars(array(
'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_PRIVATE_MESSAGE' => $lang['Private_Message'],
/*****************************************************/
/* Mod - Members List Find User v.1.0 START */
/*****************************************************/
'L_LOOK_UP' => $lang['Look_up_User'],
'L_FIND_USERNAME' => $lang['Find_username'],
'U_SEARCH_USER' => "modules.php?name=Forums&file=search&mode=searchuser&popup=1",
/*****************************************************/
/* Mod - Members List Find User v.1.0 END */
/*****************************************************/
'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'],
/*****************************************************/
/* Forum - User Online Status v.1.0.5 START */
/*****************************************************/
'L_ONLINE_STATUS' => $lang['Online_status'],
/*****************************************************/
/* Forum - User Online Status v.1.0.5 END */
/*****************************************************/
'L_PM' => $lang['Private_Message'],
'S_MODE_SELECT' => $select_sort_mode,
'S_ORDER_SELECT' => $select_sort_order,
'S_MODE_ACTION' => append_sid("memberlist.$phpEx"))
);
switch( $mode )
{
case 'joined':
$order_by = "user_id $sort_order 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;
case 'topten':
$order_by = "user_posts $sort_order LIMIT 10";
break;
case $cm_memberlist->modecheck($mode):
$order_by = $cm_memberlist->getfield($mode) . " $sort_order LIMIT $start, " . $board_config['topics_per_page'];
break;
default:
$order_by = "user_id $sort_order LIMIT $start, " . $board_config['topics_per_page'];
break;
}
/*****************************************************/
/* Mod - Members List Find User v.1.0 START */
/* Forum - Advanced Username Color v.1.0.1 START */
/* Forum - User Online Status v.1.0.5 START */
/*****************************************************/
$username = ( !empty($HTTP_POST_VARS['username']) ) ? $HTTP_POST_VARS['username'] : '';
if ( $username && isset($HTTP_POST_VARS['submituser']) )
{
$sql = "SELECT username, user_color_gc, 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, user_allow_viewonline, user_session_time
FROM " . USERS_TABLE . "
WHERE username = '$username' AND user_id <> " . ANONYMOUS . " LIMIT 1";
}
else
{
$sql = "SELECT username, user_color_gc, 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, user_allow_viewonline, user_session_time
FROM " . USERS_TABLE . "
WHERE user_id <> " . ANONYMOUS . "
ORDER BY $order_by";
// $cm_memberlist->generate_columns($template,$sql,8);
}
/*****************************************************/
/* Forum - User Online Status v.1.0.5 END */
/* Forum - Advanced Username Color v.1.0.1 END */
/* Mod - Members List Find User v.1.0 END */
/*****************************************************/
if( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not query users', '', __LINE__, __FILE__, $sql);
}
if ( $row = $db->sql_fetchrow($result) )
{
$i = 0;
do
{
$username = $row['username'];
$user_id = $row['user_id'];
if (( $row['user_website'] == "http:///") || ( $row['user_website'] == "http://")){
$row['user_website'] = "";
}
if (($row['user_website'] != "" ) && (substr($row['user_website'],0, 7) != "http://")) {
$row['user_website'] = "http://".$row['user_website'];
}
$row['user_from'] = str_replace(".gif", "", $row['user_from']);
$from = ( !empty($row['user_from']) ) ? $row['user_from'] : ' ';
$joined = $row['user_regdate'];
$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'] ) ? '' : '';
break;
case USER_AVATAR_REMOTE:
$poster_avatar = ( $board_config['allow_avatar_remote'] ) ? '' : '';
break;
case USER_AVATAR_GALLERY:
$poster_avatar = ( $board_config['allow_avatar_local'] ) ? '' : '';
break;
}
}
if ( !empty($row['user_viewemail']) || $userdata['user_level'] == ADMIN )
{
$email_uri = ( $board_config['board_email_form'] ) ? append_sid("profile.$phpEx?mode=email&" . POST_USERS_URL .'=' . $user_id) : 'mailto:' . $row['user_email'];
$email_img = '';
$email = '' . $lang['Send_email'] . '';
}
else
{
$email_img = ' ';
$email = ' ';
}
$temp_url = append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=$user_id");
$profile_img = '';
$profile = '' . $lang['Read_profile'] . '';
$temp_url = append_sid("privmsg.$phpEx?mode=post&" . POST_USERS_URL . "=$user_id");
if (is_active("Private_Messages"))
{
$pm_img = '';
$pm = '' . $lang['Send_private_message'] . '';
}
$www_img = ( $row['user_website'] ) ? '' : '';
$www = ( $row['user_website'] ) ? '' . $lang['Visit_website'] . '' : '';
if ( !empty($row['user_icq']) )
{
$icq_status_img = '';
$icq_img = '';
$icq = '' . $lang['ICQ'] . '';
}
else
{
$icq_status_img = '';
$icq_img = '';
$icq = '';
}
$aim_img = ( $row['user_aim'] ) ? '' : '';
$aim = ( $row['user_aim'] ) ? '' . $lang['AIM'] . '' : '';
$temp_url = append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=$user_id");
$msn_img = ( $row['user_msnm'] ) ? '' : '';
$msn = ( $row['user_msnm'] ) ? '' . $lang['MSNM'] . '' : '';
$yim_img = ( $row['user_yim'] ) ? '' : '';
$yim = ( $row['user_yim'] ) ? '' . $lang['YIM'] . '' : '';
$temp_url = append_sid("search.$phpEx?search_author=" . urlencode($username) . "&showresults=posts");
$search_img = '';
$search = '' . sprintf($lang['Search_user_posts'], $username) . '';
/*****************************************************/
/* Forum - User Online Status v.1.0.5 START */
/*****************************************************/
if ( $row['user_session_time'] >= (time()-60) )
{
if ( $row['user_allow_viewonline'] )
{
$online_status = '' . $lang['Online'] . '';
}
else if ( ( $userdata['user_level'] == ADMIN ) || ( $userdata['user_id'] == $user_id ) )
{
$online_status = '' . $lang['Hidden'] . '';
}
else
{
$online_status = '' . $lang['Offline'] . '';
}
}
else
{
$online_status = '' . $lang['Offline'] . '';
}
/*****************************************************/
/* Forum - User Online Status v.1.0.5 END */
/*****************************************************/
$row_color = ( !($i % 2) ) ? $theme['td_color1'] : $theme['td_color2'];
$row_class = ( !($i % 2) ) ? $theme['td_class1'] : $theme['td_class2'];
$template->assign_block_vars('memberrow', array(
'ROW_NUMBER' => $i + ( $start + 1 ),
'ROW_COLOR' => '#' . $row_color,
'ROW_CLASS' => $row_class,
/*****************************************************/
/* Forum - Advanced Username Color v.1.0.1 START */
/*****************************************************/
'USERNAME' => CheckUsernameColor($row['user_color_gc'], $row['username']),
/*****************************************************/
/* Forum - Advanced Username Color v.1.0.1 END */
/*****************************************************/
'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,
/*****************************************************/
/* Forum - User Online Status v.1.0.5 START */
/*****************************************************/
'ONLINE_STATUS' => $online_status,
/*****************************************************/
/* Forum - User Online Status v.1.0.5 END */
/*****************************************************/
'U_VIEWPROFILE' => append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=$user_id"))
);
// $cm_memberlist->listing($template,$row
// );
$i++;
}
while ( $row = $db->sql_fetchrow($result) );
$db->sql_freeresult($result);
}
/*****************************************************/
/* Mod - Members List Find User v.1.0 START */
/*****************************************************/
else
{
$template->assign_block_vars('no_username', array(
'NO_USER_ID_SPECIFIED' => $lang['No_user_id_specified'] )
);
}
/*****************************************************/
/* Mod - Members List Find User v.1.0 START */
/*****************************************************/
if ( $mode != 'topten' || $board_config['topics_per_page'] < 10 )
{
$sql = "SELECT count(*) AS total
FROM " . USERS_TABLE . "
WHERE user_id <> " . ANONYMOUS;
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Error getting total users', '', __LINE__, __FILE__, $sql);
}
if ( $total = $db->sql_fetchrow($result) )
{
$total_members = $total['total'];
$pagination = generate_pagination("memberlist.$phpEx?mode=$mode&order=$sort_order", $total_members, $board_config['topics_per_page'], $start). ' ';
}
$db->sql_freeresult($result);
}
else
{
$pagination = ' ';
$total_members = 10;
}
$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_GOTO_PAGE' => $lang['Goto_page'])
);
$template->pparse('body');
include("includes/page_tail.php");
?>