b2evolution PHP Cross Reference Blogging Systems

Source: /skins/edit.main.php - 68 lines - 2556 bytes - Text - Print

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

   1  <?php
   2  /**

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

   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: edit.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 $current_User;
  16  
  17  // Post ID, go from $_GET when we edit post from Front-office

  18  $post_ID = param( 'p', 'integer', 0, true );
  19  
  20  if( !is_logged_in() )
  21  { // Redirect to the login page if not logged in and allow anonymous user setting is OFF
  22      $redirect_to = url_add_param( $Blog->gen_blogurl(), 'disp=edit' );
  23      $Messages->add( T_( 'You must log in to create & edit posts.' ) );
  24      header_redirect( get_login_url( 'cannot edit posts', $redirect_to ), 302 );
  25      // will have exited

  26  }
  27  
  28  if( !$current_User->check_status( 'can_edit_post' ) )
  29  {
  30      if( $current_User->check_status( 'can_be_validated' ) )
  31      { // user is logged in but his/her account was not activated yet
  32          // Redirect to the account activation page

  33          $Messages->add( T_( 'You must activate your account before you can create & edit posts. <b>See below:</b>' ) );
  34          header_redirect( get_activate_info_url(), 302 );
  35          // will have exited

  36      }
  37  
  38      // Redirect to the blog url for users without messaging permission

  39      $Messages->add( T_('You are not allowed to create & edit posts!') );
  40      header_redirect( $Blog->gen_blogurl(), 302 );
  41  }
  42  
  43  // user logged in and the account was activated

  44  check_item_perm_edit( $post_ID );
  45  
  46  if( ! blog_has_cats( $Blog->ID ) )
  47  { // No categories are in this blog
  48      $error_message = T_('Since this blog has no categories, you cannot post into it.');
  49      if( $current_User->check_perm( 'blog_cats', 'edit', false, $Blog->ID ) )
  50      { // If current user has a permission to create a category
  51          global $admin_url;
  52          $error_message .= ' '.sprintf( T_('You must <a %s>create categories</a> first.'), 'href="'.$admin_url.'?ctrl=chapters&amp;blog='.$Blog->ID.'"');
  53      }
  54      $Messages->add( $error_message, 'error' );
  55      header_redirect( $Blog->gen_blogurl(), 302 );
  56  }
  57  
  58  // Require datapicker.css

  59  require_css( 'ui.datepicker.css' );
  60  // Require results.css to display attachments as a result table

  61  require_css( 'results.css' );
  62  
  63  init_tokeninput_js( 'blog' );
  64  require_js( 'extracats.js', 'blog' );
  65  
  66  require $ads_current_skin_path.'index.main.php';
  67  
  68  ?>

title

Description

title

Description

title

Description

title

title

Body