From d3adc86325503a66c7fe0bf95ca1877855ebc7bb Mon Sep 17 00:00:00 2001 From: James Atkinson Date: Fri, 11 May 2001 23:16:31 +0000 Subject: [PATCH] Memberlist working. Pagination seems to have problems. Might be generate_pagination code... git-svn-id: file:///svn/phpbb/trunk@272 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/page_header.php | 1 + phpBB/language/lang_english.php | 2 + phpBB/memberlist.php | 157 ++++++++++++++++++++ phpBB/templates/Default/memberlist_body.tpl | 32 ++++ phpBB/templates/PSO/images/post.gif | Bin 1331 -> 1329 bytes phpBB/templates/PSO/images/reply-locked.gif | Bin 2061 -> 2054 bytes phpBB/templates/PSO/images/reply.gif | Bin 1304 -> 1303 bytes 7 files changed, 192 insertions(+) create mode 100644 phpBB/memberlist.php create mode 100644 phpBB/templates/Default/memberlist_body.tpl diff --git a/phpBB/includes/page_header.php b/phpBB/includes/page_header.php index 2325acd047..5d82661b09 100644 --- a/phpBB/includes/page_header.php +++ b/phpBB/includes/page_header.php @@ -160,6 +160,7 @@ $template->assign_vars(array( "U_FAQ" => append_sid("faq.".$phpEx), "U_VIEWONLINE" => append_sid("viewonline.$phpEx"), "U_LOGIN_LOGOUT" => append_sid($u_login_logout), + "U_MEMBERSLIST" => append_sid("memberlist.".$phpEx), "S_TIMEZONE" => $s_timezone, "S_LOGIN_ACTION" => append_sid("login.$phpEx"), diff --git a/phpBB/language/lang_english.php b/phpBB/language/lang_english.php index 78ab7eb5e3..61c4751bca 100755 --- a/phpBB/language/lang_english.php +++ b/phpBB/language/lang_english.php @@ -149,6 +149,8 @@ $l_date_format_explanation = "Only change this if you know what you are doing!"; $l_password_if_changed = "You only need to supply a password if you want to change it."; $l_password_confirm_if_changed = "You only need to confirm your password if you changed it above."; +$l_top10 = "Top 10 Posters"; +$l_alpha = "Sorta Alphabetical"; // Viewforum $l_viewforum = "View Forum"; diff --git a/phpBB/memberlist.php b/phpBB/memberlist.php new file mode 100644 index 0000000000..af81b25995 --- /dev/null +++ b/phpBB/memberlist.php @@ -0,0 +1,157 @@ +sql_query($sql)) +{ + if(DEBUG) + { + $error = $db->sql_error(); + error_die(SQL_QUERY, "Error getting memberlist.
Reason: ".$error['message']."
Query: $sql.", __LINE__, __FILE__); + } + else + { + error_die(SQL_QUERY); + } +} +if(($selected_members = $db->sql_numrows($result)) > 0) +{ + $template->set_filenames(array("body" => "memberlist_body.tpl")); + $template->assign_vars(array("U_VIEW_TOP10" => append_sid("memberlist.$phpEx?mode=top10"), + "U_SORTALPHA" => append_sid("memberlist.$phpEx?mode=alpha"), + "L_VIEW_TOP10" => $l_top10, + "L_SORTALPHA" => $l_alpha, + "L_EMAIL" => $l_email, + "L_WEBSITE" => $l_website, + "L_FROM" => $l_from)); + + $members = $db->sql_fetchrowset($result); + + for($x = $start; $x < $selected_members; $x++) + { + $username = stripslashes($members[$x]['username']); + $user_id = $members[$x]['user_id']; + $posts = $members[$x]['user_posts']; + $from = stripslashes($members[$x]['user_from']); + $joined = create_date($board_config['default_dateformat'], $members[$x]['user_regdate'], $board_config['default_timezone']); + if($members[$x]['user_viewemail'] != 0) + { + $email = str_replace("@", " at ", $members[$x]['user_email']); + $email = "$email"; + } + else + { + $email = " "; + } + + if($members[$x]['user_website']) + { + $url_img = $images['www']; + $url = ""; + } + else + { + $url = " "; + } + + if(!($x % 2)) + { + $row_color = "#".$theme['td_color1']; + } + else + { + $row_color = "#".$theme['td_color2']; + } + $template->assign_block_vars("memberrow", array( + "ROW_COLOR" => $row_color, + "U_VIEWPROFILE" => append_sid("profile.$phpEx?mode=viewprofile&".POST_USERS_URL."=".$user_id), + "USERNAME" => $username, + "FROM" => $from, + "JOINED" => $joined, + "POSTS" => $posts, + "EMAIL" => $email, + "WEBSITE" => $url)); + } + + if($mode != "top10") + { + $sql = "SELECT count(*) AS total FROM ".USERS_TABLE." WHERE user_id != ".ANONYMOUS." AND user_level != ".DELETED; + if(!$count_result = $db->sql_query($sql)) + { + if(DEBUG) + { + $error = $db->sql_error(); + error_die(SQL_QUERY, "Error getting total users
Reason: ".$error['message']."
Query: $sql", __LINE__, __FILE__); + } + else + { + error_die(SQL_QUERY); + } + } + else + { + $total = $db->sql_fetchrowset($count_result); + $total_members = $total[0]['total']; + $pagination = generate_pagination("memberlist.$phpEx?mode=$mode", $total_members, $board_config['posts_per_page'], $start, TRUE); + } + $template->assign_vars(array("PAGINATION" => $pagination)); + } + $template->pparse("body"); +} + +include('includes/page_tail.'.$phpEx); +?> \ No newline at end of file diff --git a/phpBB/templates/Default/memberlist_body.tpl b/phpBB/templates/Default/memberlist_body.tpl new file mode 100644 index 0000000000..1a3199d972 --- /dev/null +++ b/phpBB/templates/Default/memberlist_body.tpl @@ -0,0 +1,32 @@ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
{L_VIEW_TOP10} | {L_SORTALPHA}
{L_USERNAME}{L_FROM}{L_JOINED}{L_POSTS}{L_EMAIL}{L_WEBSITE}
{memberrow.USERNAME}{memberrow.FROM}{memberrow.JOINED}{memberrow.POSTS}{memberrow.EMAIL}{WEBSITE}
{PAGINATION}
+ \ No newline at end of file diff --git a/phpBB/templates/PSO/images/post.gif b/phpBB/templates/PSO/images/post.gif index f1b8e3ef3e4be3759a96eec2a16008dbdc708b7a..baf67af19d813a941c110e951001ca7b0c53f3bc 100644 GIT binary patch delta 15 XcmdnYwUKMX3YN($S#%~}V~GU-GA{-T delta 19 ZcmdnUwV7+f3KmA*$tzfNfaDdHSO7sP1|$Fg diff --git a/phpBB/templates/PSO/images/reply-locked.gif b/phpBB/templates/PSO/images/reply-locked.gif index 90173f19d383a7e269e4cf76f8af250d2a7d6957..f9a35d22f8e08180dc3f343e885882b0c99d9010 100644 GIT binary patch delta 36 ucmV+<0NekK5QY%2;{%iA10|CR1c{TB1TnM51egJnUj`PFb_T7JBnRpIEDd%5 delta 67 zcmZn@=oQ%Tn3<7x@?&OIAj!ef2_z@77&7v1KEyJEQG$2lk+u$YjibVW0g0|+F$#s1 U8EhsFhj=F!u&o8Elx2Sj0JI?#x&QzG diff --git a/phpBB/templates/PSO/images/reply.gif b/phpBB/templates/PSO/images/reply.gif index 9276298a6b528a30f9c8ebbdc26e94dc4913fa12..51fbb487e3f4f9054f53c7c359b0de2ee705e2c8 100644 GIT binary patch delta 12 TcmbQiHJxk2P3FzFnC%z=Ajkxt delta 14 VcmbQvHG^xzO=d>k%{Q6t7y%}?1gro6