users.php
上传用户:wfd_feng
上传日期:2013-02-18
资源大小:688k
文件大小:6k
- <?
- /*
- * W-AGORA 4.1
- * -----------
- * $Id: users.php,v 1.11 2002/11/15 16:32:00 syloo Exp $
- * Usage: Users list
- * Author: Syloo (syloo@w-agora.net)
- */
- $bn_action="users";
- $bn_action_mode="L";
- include ("init.inc");
- if ($pattern == LABEL_ALL_USERS) {
- unset($pattern);
- }
- switch ($sort) {
- case "join":
- $sort_db = "unixdate desc";
- break;
- case "logins":
- $sort_db = "totallogins desc";
- break;
- case "notes":
- $sort_db = "totalposts desc";
- break;
- case "name":
- $sort_db = "username";
- break;
- case "email":
- $sort_db = "useraddress";
- break;
- case "id":
- default:
- $sort_db = "userid";
- break;
- }
- $f = (empty($f))? 0 : $f;
- $l = $f + $nb_users_list;
- $p = $f - $nb_users_list;
- # Execute before_access program
- # -----------------------------
- if (!empty($bn_before_access)) {
- if (file_exists ("$bn_dir/$bn_before_access") ) {
- include "$bn_dir/$bn_before_access";
- } else {
- include "$bn_dir_default/$bn_before_access";
- }
- } elseif (file_exists ("$bn_dir_default/before_access.$ext") ) {
- include ("$bn_dir_default/before_access.$ext");
- }
- $users = $db->getUsers($site,"","",$pattern,"",$sort_db);
- $total_users = count($users);
- $f = (empty($f))? 0 : $f;
- $l = ($total_users > $f + $nb_users_list)? $f + $nb_users_list : $f;
- $p = ($f - $nb_users_list < 0)? 0 : $f - $nb_users_list;
- $f_end = ($total_users - $nb_users_list > 0)? $total_users - $nb_users_list : 0;
- $first_u = $f + 1;
- $last_u = ($first_u + $nb_users_list - 1 > $total_users)? $total_users : $first_u + $nb_users_list - 1;
- $int_dsp = LABEL_DISPLAY . ": $first_u - $last_u / $total_users";
- $begin_link = anchor ("$WA_SELF?pattern=$pattern&sort=$sort&full=$full&f=0", '', LABEL_BEGIN_USERS);
- $previous_link = anchor ("$WA_SELF?pattern=$pattern&sort=$sort&full=$full&f=$p", '', LABEL_PREV_USERS);
- $next_link = anchor ("$WA_SELF?pattern=$pattern&sort=$sort&full=$full&f=$l", '', LABEL_NEXT_USERS);
- $end_link = anchor ("$WA_SELF?pattern=$pattern&sort=$sort&full=$full&f=$f_end", '', LABEL_END_USERS);
- $categories = $db->getCategories($site);
- $site_title = $categories[0];
- $alpha = array('A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z',LABEL_ALL_USERS);
- display_header (TITLE_USERS_LIST, $header_footer);
- echo "<center>" . TITLE_USERS_LIST;
- reset($alpha);
- while (list ($k, $let) = each($alpha)) {
- if ($let == $pattern) {
- echo "[$let] ";
- } elseif (empty($pattern) && ($let == LABEL_ALL_USERS)) {
- echo "[$let] ";
- } else {
- displayUrl("$WA_SELF?pattern=$let", '', '['.$let.']');
- }
- }
- if (!is_array($users)) {
- echo "<p align=center>" . MSG_NO_USER . "</p>";
- } else {
- echo '<p align=left>';
- if ($full == 1) {
- displayUrl("$WA_SELF?pattern=$pattern&sort=$sort&full=0&f=$f", '', LABEL_SIMPLE_DISPLAY);
- } else {
- displayUrl("$WA_SELF?pattern=$pattern&sort=$sort&full=1&f=$f", '', LABEL_FULL_DISPLAY);
- }
- echo '</p>';
- ?>
- <table width="95%" border="0" cellspacing="1" cellpadding="3" align=center class=list>
- <tr class=column>
- <td><?echo COLUMN_ID?></td>
- <td>
- <?php displayUrl("$WA_SELF?pattern=$pattern&sort=name&full=$full&f=$f", '', COLUMN_NAME);?>
- </td>
- <td>
- <?php displayUrl("$WA_SELF?pattern=$pattern&sort=join&full=$full&f=$f", '', COLUMN_JOIN_DATE);?>
- </td>
- <td>
- <?php displayUrl("$WA_SELF?pattern=$pattern&sort=email&full=$full&f=$f", '', COLUMN_ADDRESS);?>
- </td>
- <td align=right>
- <?php displayUrl("$WA_SELF?pattern=$pattern&sort=logins&full=$full&f=$f", '', COLUMN_LOGINS);?>
- </td>
- <td align=right>
- <?php displayUrl("$WA_SELF?pattern=$pattern&sort=notes&full=$full&f=$f", '', COLUMN_POSTS);?>
- </td>
- <?
- if ($full) { ?>
- <td align=right><?echo COLUMN_HOME_PAGE?></td>
- <td align=right><?echo COLUMN_ICQ?></td>
- <td align=right><?echo COLUMN_AIM?></td>
- <td align=right><?echo COLUMN_MSN?></td>
- <td align=right><?echo COLUMN_YAHOO?></td>
- <?
- }//if
- echo "</tr>";
- $i = 0;
- while (($i < $f) && (next($users))) {
- $i++;
- }
- while (($i < $f + $nb_users_list) && (list($k,$user) = each($users))) {
- extract($user);
- $user_profile_url = "profile.$ext?site=$site&showuser=$userid";
- $address_link = (empty($useraddress))? "-": "<a href="mailto:$useraddress" class=label>$useraddress</a>";
- $home_link = (empty($homepage))? "-": anchor($homepage, '', "<img src='$icon_dir/home.gif' border=0>", COLUMN_HOME_PAGE . ": $homepage");
- $icq_link = (empty($icq))? "-": anchor($user_profile_url, '', "<img src='$icon_dir/icq.gif' border=0>", COLUMN_ICQ . ": $icq");
- $aim_link = (empty($aim))? "-": anchor($user_profile_url, '', "<img src='$icon_dir/aim.gif' border=0>", COLUMN_AIM . ": $aim");
- $msn_link = (empty($msn))? "-": anchor($user_profile_url, '', "<img src='$icon_dir/msnm.gif' border=0>", COLUMN_MSN . ": $msn");
- $yahoo_link = (empty($yahoo))? "-": anchor($user_profile_url, '', "<img src='$icon_dir/yim.gif' border=0>", COLUMN_YAHOO . ": $yahoo");
- ?>
- <tr class=row>
- <td><?displayUrl($user_profile_url, '', $userid, ALT_PROFILE);?></td>
- <td class=s_label><?echo $username?></td>
- <td class=s_label><?echo formated_date($unixdate)?></td>
- <td nowrap class=s_label><?echo $address_link?></td>
- <td align=right class=s_label><?echo $totallogins?></td>
- <td align=right class=s_label><?echo $totalposts?></td>
- <?
- if ($full) { ?>
- <td align=right class=s_label> <?echo $home_link?></td>
- <td align=right class=s_label> <?echo $icq_link?></td>
- <td align=right class=s_label> <?echo $aim_link?></td>
- <td align=right class=s_label> <?echo $msn_link?></td>
- <td align=right class=s_label> <?echo $yahoo_link?></td>
- <?
- }//if
- echo "</tr>";
- $i++;
- }//while
- }//if
- $colspan = ($full)? 11 : 6;
- ?>
- <tr><td align=center colspan='<?echo $colspan?>' class=column>
- <?php
- echo " $begin_link $previous_link $int_dsp $next_link $end_link";
- echo '</td></tr></table>';
- display_footer($header_footer);
- ?>