" . ANONYMOUS . "
ORDER BY $order_by";
if( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, "Couldn't query users", "", __LINE__, __FILE__, $sql);
}
$members = $db->sql_fetchrowset($result);
$db->sql_freeresult($result);
//
// 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_sort_order = "";
//
// Generate page
//
$page_title = $lang['Memberlist'];
include($phpbb_root_path . 'includes/page_header.'.$phpEx);
$template->set_filenames(array(
"body" => "memberlist_body.tpl",
"jumpbox" => "jumpbox.tpl"));
$jumpbox = make_jumpbox();
$template->assign_vars(array(
"L_GO" => $lang['Go'],
"L_JUMP_TO" => $lang['Jump_to'],
"L_SELECT_FORUM" => $lang['Select_forum'],
"S_JUMPBOX_LIST" => $jumpbox,
"S_JUMPBOX_ACTION" => append_sid("viewforum.$phpEx"))
);
$template->assign_var_from_handle("JUMPBOX", "jumpbox");
$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_SORT" => $lang['Sort'],
"L_SUBMIT" => $lang['Sort'],
"L_AIM" => $lang['AIM'],
"L_YIM" => $lang['YIM'],
"L_MSNM" => $lang['MSNM'],
"L_ICQ" => $lang['ICQ'],
"S_MODE_SELECT" => $select_sort_mode,
"S_ORDER_SELECT" => $select_sort_order,
"S_MODE_ACTION" => append_sid("memberlist.$phpEx"))
);
for($i = 0; $i < count($members); $i++)
{
$username = $members[$i]['username'];
$user_id = $members[$i]['user_id'];
$from = ( !empty($members[$i]['user_from']) ) ? $members[$i]['user_from'] : " ";
$joined = create_date($lang['DATE_FORMAT'], $members[$i]['user_regdate'], $board_config['board_timezone']);
$posts = ( $members[$i]['user_posts'] ) ? $members[$i]['user_posts'] : 0;
if( $members[$i]['user_avatar_type'] && $user_id != ANONYMOUS && $members[$i]['user_allowavatar'] )
{
switch( $postrow[$i]['user_avatar_type'] )
{
case USER_AVATAR_UPLOAD:
$poster_avatar = "";
break;
case USER_AVATAR_REMOTE:
$poster_avatar = "";
break;
case USER_AVATAR_GALLERY:
$poster_avatar = "";
break;
}
}
else
{
$poster_avatar = "";
}
if( !empty($members[$i]['user_viewemail']) || $userdata['user_level'] == ADMIN )
{
$email_uri = ( $board_config['board_email_form'] ) ? append_sid("profile.$phpEx?mode=email&" . POST_USERS_URL ."=" . $members[$i]['user_id']) : "mailto:" . $members[$i]['user_email'];
$email_img = "";
}
else
{
$email_img = " ";
}
$pm_img = "";
if( $members[$i]['user_website'] != "" )
{
$www_img = "";
}
else
{
$www_img = " ";
}
if( $members[$i]['user_icq'] )
{
$icq_status_img = "";
$icq_add_img = "";
}
else
{
$icq_status_img = " ";
$icq_add_img = " ";
}
$aim_img = ( $members[$i]['user_aim'] ) ? "" : " ";
$msn_img = ( $members[$i]['user_msnm'] ) ? "" : " ";
$yim_img = ( $members[$i]['user_yim'] ) ? "" : " ";
$search_img = "";
$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(
"U_VIEWPROFILE" => append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=" . $user_id),
"ROW_NUMBER" => $i + ( $HTTP_GET_VARS['start'] + 1 ),
"ROW_COLOR" => "#" . $row_color,
"ROW_CLASS" => $row_class,
"USERNAME" => $username,
"FROM" => $from,
"JOINED" => $joined,
"POSTS" => $posts,
"AVATAR_IMG" => $poster_avatar,
"EMAIL_IMG" => $email_img,
"PM_IMG" => $pm_img,
"WWW_IMG" => $www_img,
"ICQ_STATUS_IMG" => $icq_status_img,
"ICQ_ADD_IMG" => $icq_add_img,
"AIM_IMG" => $aim_img,
"YIM_IMG" => $yim_img,
"MSN_IMG" => $msn_img,
"SEARCH_IMG" => $search)
);
}
if($mode != "topten" || $board_config['topics_per_page'] < 10)
{
$sql = "SELECT count(*) AS total
FROM " . USERS_TABLE . "
WHERE user_id <> " . ANONYMOUS;
if(!$count_result = $db->sql_query($sql))
{
message_die(GENERAL_ERROR, "Error getting total users.", "", __LINE__, __FILE__, $sql);
}
else
{
$total = $db->sql_fetchrow($count_result);
$total_members = $total['total'];
$pagination = generate_pagination("memberlist.$phpEx?mode=$mode&order=$sort_order", $total_members, $board_config['topics_per_page'], $start)." ";
}
}
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($phpbb_root_path . 'includes/page_tail.'.$phpEx);
?>