b2evolution PHP Cross Reference Blogging Systems

Source: /skins/messages.main.php - 70 lines - 2795 bytes - Text - Print

Description: This file is the template that includes required css files to display messages

   1  <?php
   2  /**

   3   * This file is the template that includes required css files to display messages

   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: messages.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 $htsrv_url, $Messages, $current_User;
  16  
  17  // fp> The correct place to get thrd_ID is here, because we want it in redirect_to in case we need to ask for login.

  18  param( 'thrd_ID', 'integer', '', true );
  19  
  20  if( !is_logged_in() )
  21  { // Redirect to the login page for anonymous users
  22      $Messages->add( T_( 'You must log in to read your messages.' ) );
  23      header_redirect( get_login_url('cannot see messages'), 302 );
  24      // will have exited

  25  }
  26  
  27  // check if user status allow to view messages

  28  if( !$current_User->check_status( 'can_view_messages' ) )
  29  { // user status does not allow to view messages
  30      if( $current_User->check_status( 'can_be_validated' ) )
  31      { // user is logged in but his/her account is not activate yet
  32          $Messages->add( T_( 'You must activate your account before you can read & send messages. <b>See below:</b>' ) );
  33          header_redirect( get_activate_info_url(), 302 );
  34          // will have exited

  35      }
  36  
  37      $Messages->add( 'You are not allowed to view Messages!' );
  38      header_redirect( $Blog->gen_blogurl(), 302 );
  39      // will have exited

  40  }
  41  
  42  // check if user permissions allow to view messages

  43  if( !$current_User->check_perm( 'perm_messaging', 'reply' ) )
  44  { // Redirect to the blog url for users without messaging permission
  45      $Messages->add( 'You are not allowed to view Messages!' );
  46      header_redirect( $Blog->gen_blogurl(), 302 );
  47      // will have exited

  48  }
  49  
  50  if( !empty( $thrd_ID ) )
  51  { // if this thread exists and current user is part of this thread update status because won't be any unread messages on this conversation
  52      // we need to mark this early to make sure the unread message count will be correct in the evobar

  53      mark_as_read_by_user( $thrd_ID, $current_User->ID );
  54  }
  55  
  56  add_js_headline( "// Paths used by JS functions:
  57          var bgxy_expand = '".get_icon( 'expand', 'xy' )."';
  58          var bgxy_collapse = '".get_icon( 'collapse', 'xy' )."';" );
  59  
  60  // Require results.css to display message query results in a table

  61  require_css( 'results.css' ); // Results/tables styles

  62  
  63  // Require functions.js to show/hide a panel with filters

  64  require_js( 'functions.js', 'blog' );
  65  // Include this file to expand/collapse the filters panel when JavaScript is disabled

  66  require_once $inc_path.'_filters.inc.php';
  67  
  68  require $ads_current_skin_path.'index.main.php';
  69  
  70  ?>

title

Description

title

Description

title

Description

title

title

Body