b2evolution PHP Cross Reference Blogging Systems

Source: /inc/_main.inc.php - 125 lines - 5037 bytes - Text - Print

Description: This file initializes everything BUT the blog! It is useful when you want to do very customized templates! It is also called by more complete initializers.

   1  <?php
   2  /**
   3   * This file initializes everything BUT the blog!
   4   *
   5   * It is useful when you want to do very customized templates!
   6   * It is also called by more complete initializers.
   7   *
   8   * This file is part of the evoCore framework - {@link http://evocore.net/}
   9   * See also {@link http://sourceforge.net/projects/evocms/}.
  10   *
  11   * @copyright (c)2003-2014 by Francois Planque - {@link http://fplanque.com/}
  12   * Parts of this file are copyright (c)2004-2006 by Daniel HAHLER - {@link http://thequod.de/contact}.
  13   * Parts of this file are copyright (c)2005-2006 by PROGIDISTRI - {@link http://progidistri.com/}.
  14   *
  15   * {@internal License choice
  16   * - If you have received this file as part of a package, please find the license.txt file in
  17   *   the same folder or the closest folder above for complete license terms.
  18   * - If you have received this file individually (e-g: from http://evocms.cvs.sourceforge.net/)
  19   *   then you must choose one of the following licenses before using the file:
  20   *   - GNU General Public License 2 (GPL) - http://www.opensource.org/licenses/gpl-license.php
  21   *   - Mozilla Public License 1.1 (MPL) - http://www.opensource.org/licenses/mozilla1.1.php
  22   * }}
  23   *
  24   * {@internal Open Source relicensing agreement:
  25   * Daniel HAHLER grants Francois PLANQUE the right to license
  26   * Daniel HAHLER's contributions to this file and the b2evolution project
  27   * under any OSI approved OSS license (http://www.opensource.org/licenses/).
  28   *
  29   * Matt FOLLETT grants Francois PLANQUE the right to license
  30   * Matt FOLLETT's contributions to this file and the b2evolution project
  31   * under any OSI approved OSS license (http://www.opensource.org/licenses/).
  32   * }}
  33   *
  34   * @package evocore
  35   *
  36   * @version $Id: _main.inc.php 6136 2014-03-08 07:59:48Z manuel $
  37   */
  38  if( !defined('EVO_CONFIG_LOADED') ) die( 'Please, do not access this page directly.' );
  39  
  40  
  41  // In case of incomplete config folder:
  42  if( !isset($use_db) ) $use_db = true;
  43  if( !isset($use_session) ) $use_session = true;
  44  if( !isset($use_hacks) ) $use_hacks = false;
  45  
  46  
  47  if( defined( 'EVO_MAIN_INIT' ) )
  48  {    /*
  49       * Prevent double loading since require_once won't work in all situations
  50       * on windows when some subfolders have caps :(
  51       * (Check it out on static page generation)
  52       */
  53      return;
  54  }
  55  define( 'EVO_MAIN_INIT', true );
  56  
  57  
  58  // == 1. Initialize the most basic stuff: ==
  59  require dirname(__FILE__).'/_init_base.inc.php';
  60  
  61  
  62  if( $use_db )
  63  {
  64      // == 2. Initialize DB connection: ==
  65      require dirname(__FILE__).'/_init_db.inc.php';
  66  
  67  
  68      // == 3. Initialize Modules: ==
  69      // Let the modules load/register what they need:
  70      $Timer->resume('init modules');
  71      modules_call_method( 'init' );
  72      $Timer->pause( 'init modules' );
  73  
  74  
  75      // == 4. Initialize Plugins: ==
  76      // At this point, the first hook is "SessionLoaded"
  77      // The dnsbl_antispam plugin is an example that uses this to check the user's IP against a list of DNS blacklists.
  78      load_class( 'plugins/model/_plugins.class.php', 'Plugins' );
  79      /**
  80       * @global Plugins The Plugin management object
  81       */
  82      $Plugins = new Plugins();
  83  
  84      // This is the earliest event you can use
  85      $Plugins->trigger_event( 'AfterPluginsInit' );
  86  
  87      // == 5. Initialize WWW HIT: ==
  88      if( ! $is_cli )
  89      {
  90          require dirname(__FILE__).'/_init_hit.inc.php';
  91      }
  92  
  93      $Plugins->trigger_event( 'AfterMainInit' );
  94  }
  95  
  96  // == 6. Initialize Additional Variables: ==
  97  
  98  // fp> TODO: the following was in _vars.inc -- temporaily here, b2evolution stuff needs to move out of evoCORE.
  99  // dummy var for backward compatibility with versions < 2.4.1 -- prevents "Undefined variable"
 100  $credit_links = array();
 101  $francois_links = array( 'fr' => array( 'http://fplanque.net/', array( array( 78, 'Fran&ccedil;ois'),  array( 100, 'Francois') ) ),
 102                                                      '' => array( 'http://fplanque.com/', array( array( 78, 'Fran&ccedil;ois'),  array( 100, 'Francois') ) )
 103                                                  );
 104  $fplanque_links = array( 'fr' => array( 'http://fplanque.net/', array( array( 78, 'Fran&ccedil;ois Planque'),  array( 100, 'Francois Planque') ) ),
 105                                                      '' => array( 'http://fplanque.com/', array( array( 78, 'Fran&ccedil;ois Planque'),  array( 100, 'Francois Planque') ) )
 106                                                  );
 107  $skin_links = array( '' => array( 'http://skinfaktory.com/', array( array( 15, 'b2evo skin'), array( 20, 'b2evo skins'), array( 35, 'b2evolution skin'), array( 40, 'b2evolution skins'), array( 55, 'Blog skin'), array( 60, 'Blog skins'), array( 75, 'Blog theme'),array( 80, 'Blog themes'), array( 95, 'Blog template'), array( 100, 'Blog templates') ) ),
 108                                                  );
 109  $skinfaktory_links = array( '' => array( array( 73, 'http://evofactory.com/', array( array( 61, 'Evo Factory'), array( 68, 'EvoFactory'), array( 73, 'Evofactory') ) ),
 110                                                                       array( 100, 'http://skinfaktory.com/', array( array( 92, 'Skin Faktory'), array( 97, 'SkinFaktory'), array( 99, 'Skin Factory'), array( 100, 'SkinFactory') ) ),
 111                                                                                  )
 112                                                  );
 113  
 114  
 115  if( ! $is_cli )
 116  { // Move user to suspect group by IP address
 117      antispam_suspect_user();
 118  }
 119  
 120  
 121  $Timer->pause( '_MAIN.inc' );
 122  // LOG with APM:
 123  $Timer->log_duration( '_MAIN.inc' );
 124  
 125  ?>

title

Description

title

Description

title

Description

title

title

Body