b2evolution PHP Cross Reference Blogging Systems

Source: /skins/user.main.php - 73 lines - 2539 bytes - Text - Print

Description: This file is the template that includes required css files to display a user profile

   1  <?php
   2  /**

   3   * This file is the template that includes required css files to display a user profile

   4   *

   5   * b2evolution - {@link http://b2evolution.net/}

   6   * Released under GNU GPL License - {@link http://b2evolution.net/about/license.html}

   7   * @copyright (c)2003-2014 by Francois Planque - {@link http://fplanque.com/}

   8   *

   9   * @package evoskins

  10   *

  11   * @version $Id: user.main.php 6136 2014-03-08 07:59:48Z manuel $

  12   */
  13  if( !defined('EVO_MAIN_INIT') ) die( 'Please, do not access this page directly.' );
  14  
  15  global $Messages;
  16  
  17  // get user_ID because we want it in redirect_to in case we need to ask for login.

  18  param( 'user_ID', 'integer', '', true );
  19  // set where to redirect in case of error

  20  $error_redirect_to = ( empty( $Blog) ? $baseurl : $Blog->gen_blogurl() );
  21  
  22  if( !is_logged_in() && !$Settings->get( 'allow_anonymous_user_profiles' ) )
  23  { // Redirect to the login page if not logged in and allow anonymous user setting is OFF
  24      $Messages->add( T_('You must log in to view this user profile.') );
  25      header_redirect( get_login_url('cannot see user'), 302 );
  26      // will have exited

  27  }
  28  
  29  if( is_logged_in() && ( !check_user_status( 'can_view_user', $user_ID ) ) )
  30  { // user is logged in, but his/her status doesn't permit to view user profile
  31      if( check_user_status('can_be_validated') )
  32      { // user is logged in but his/her account is not active yet
  33          // Redirect to the account activation page

  34          $Messages->add( T_('You must activate your account before you can view this user profile. <b>See below:</b>') );
  35          header_redirect( get_activate_info_url(), 302 );
  36          // will have exited

  37      }
  38  
  39      $Messages->add( T_('Your account status currently does not permit to view this user profile.') );
  40      header_redirect( $error_redirect_to, 302 );
  41      // will have exited

  42  }
  43  
  44  if( !empty($user_ID) )
  45  {
  46      $UserCache = & get_UserCache();
  47      $User = & $UserCache->get_by_ID( $user_ID, false );
  48  
  49      if( empty( $User ) )
  50      {
  51          $Messages->add( T_('The requested user does not exist!') );
  52          header_redirect( $error_redirect_to );
  53          // will have exited

  54      }
  55  
  56      if( $User->check_status('is_closed') )
  57      {
  58          $Messages->add( T_('The requested user account is closed!') );
  59          header_redirect( $error_redirect_to );
  60          // will have exited

  61      }
  62  }
  63  
  64  load_class( 'users/model/_userlist.class.php', 'UserList' );
  65  
  66  // Initialize users list from session cache in order to display prev/next links

  67  $UserList = new UserList();
  68  $UserList->memorize = false;
  69  $UserList->load_from_Request();
  70  
  71  require $ads_current_skin_path.'index.main.php';
  72  
  73  ?>

title

Description

title

Description

title

Description

title

title

Body