b2evolution PHP Cross Reference Blogging Systems

Source: /inc/users/views/_user_list_short.view.php - 148 lines - 4166 bytes - Summary - Text - Print

Description: This file implements the UI view for the user list for user viewing. This file is part of the evoCore framework - {@link http://evocore.net/} See also {@link http://sourceforge.net/projects/evocms/}.

   1  <?php
   2  /**
   3   * This file implements the UI view for the user list for user viewing.
   4   *
   5   * This file is part of the evoCore framework - {@link http://evocore.net/}
   6   * See also {@link http://sourceforge.net/projects/evocms/}.
   7   *
   8   * @copyright (c)2003-2014 by Francois Planque - {@link http://fplanque.com/}
   9   *
  10   * {@internal License choice
  11   * - If you have received this file as part of a package, please find the license.txt file in
  12   *   the same folder or the closest folder above for complete license terms.
  13   * - If you have received this file individually (e-g: from http://evocms.cvs.sourceforge.net/)
  14   *   then you must choose one of the following licenses before using the file:
  15   *   - GNU General Public License 2 (GPL) - http://www.opensource.org/licenses/gpl-license.php
  16   *   - Mozilla Public License 1.1 (MPL) - http://www.opensource.org/licenses/mozilla1.1.php
  17   * }}
  18   *
  19   * {@internal Open Source relicensing agreement:
  20   * }}
  21   *
  22   * @package admin
  23   *
  24   * @version $Id: _user_list_short.view.php 6136 2014-03-08 07:59:48Z manuel $
  25   */
  26  if( !defined('EVO_MAIN_INIT') ) die( 'Please, do not access this page directly.' );
  27  
  28  load_class( 'users/model/_userlist.class.php', 'UserList' );
  29  
  30  /**
  31   * @var User
  32   */
  33  global $current_User;
  34  /**
  35   * @var GeneralSettings
  36   */
  37  global $Settings;
  38  /**
  39   * @var UserSettings
  40   */
  41  global $UserSettings;
  42  
  43  if( !isset( $display_params ) )
  44  { // init display_params
  45      $display_params = array();
  46  }
  47  
  48  $UserList = new UserList( '', $UserSettings->get('results_per_page'), 'u_', array(
  49          'join_group'          => false,
  50          'join_country'        => false,
  51          'keywords_fields'     => 'user_login, user_firstname, user_lastname, user_nickname',
  52          'where_status_closed' => false,
  53      ) );
  54  
  55  $default_filters = array();
  56  
  57  if( is_logged_in() )
  58  {    // Set default filter by country
  59      $default_filters['country'] = $current_User->ctry_ID;
  60  }
  61  
  62  
  63  if( $Settings->get('allow_avatars') )
  64  {    // Sort by picture
  65      $default_filters['order'] = 'D';
  66  }
  67  else
  68  {    // Sort by login (if pictures are not allowed )
  69      $default_filters['order'] = 'A';
  70  }
  71  
  72  
  73  /*
  74   * Data columns:
  75   */
  76  
  77  if( $Settings->get('allow_avatars') )
  78  {
  79  	function user_avatar( $user_ID )
  80      {
  81          global $Blog;
  82  
  83          $UserCache = & get_UserCache();
  84          $User = & $UserCache->get_by_ID( $user_ID );
  85  
  86          return $User->get_identity_link( array(
  87              'link_text' => 'only_avatar',
  88              'thumb_size' => $Blog->get_setting('image_size_user_list'),
  89              ) );
  90      }
  91      $UserList->cols[] = array(
  92                              'th' => T_('Picture'),
  93                              'th_class' => 'shrinkwrap',
  94                              'td_class' => 'shrinkwrap center',
  95                              'order' => 'has_picture',
  96                              'default_dir' => 'D',
  97                              'td' => '%user_avatar( #user_ID# )%',
  98                          );
  99  }
 100  
 101  $UserList->cols[] = array(
 102                          'th' => T_('Login'),
 103                          'order' => 'user_login',
 104                          'td' => '%get_user_identity_link( #user_login#, #user_ID#, "profile", "text" )%',
 105                      );
 106  
 107  $UserList->cols[] = array(
 108                          'th' => T_('City'),
 109                          'th_class' => 'shrinkwrap',
 110                          'td_class' => 'shrinkwrap',
 111                          'order' => 'city_name',
 112                          'td' => '$city_name$<div class="note">$city_postcode$</div>',
 113                      );
 114  
 115  $UserList->set_default_filters( $default_filters );
 116  $UserList->load_from_Request();
 117  $UserList->query();
 118  
 119  
 120  $filter_presets = array(
 121          'all' => array( T_('All users'), get_dispctrl_url( 'users&amp;filter=new' ) ),
 122          'men' => array( T_('Men'), get_dispctrl_url( 'users', 'gender_men=1&amp;filter=new' ) ),
 123          'women' => array( T_('Women'), get_dispctrl_url( 'users', 'gender_women=1&amp;filter=new' ) )
 124      );
 125  
 126  if( is_admin_page() )
 127  { // Add show only activated users filter only on admin interface
 128      $filter_presets['activated'] = array( T_('Activated users'), get_dispctrl_url( 'users', 'status_activated=1&amp;filter=new' ) );
 129  }
 130  
 131  if( $UserList->is_filtered() )
 132  {    // Display link to reset filters only if some filter is applied
 133      $filter_presets['reset'] = array( T_('Reset Filters'), get_dispctrl_url( 'users&amp;filter=reset' ), 'class="floatright"' );
 134  }
 135  
 136  $UserList->filter_area = array(
 137      'callback' => 'callback_filter_userlist',
 138      'url_ignore' => 'users_paged,u_paged,keywords',
 139      'presets' => $filter_presets,
 140      );
 141  
 142  
 143  // Display result :
 144  $UserList->display( $display_params );
 145  
 146  load_funcs( 'users/model/_user_js.funcs.php' );
 147  
 148  ?>

title

Description

title

Description

title

Description

title

title

Body