b2evolution

Multilingual multiuser multiblog engine

b2evolution Technical Documentation (Version 1.8) [ class tree: main ] [ index: main ] [ all elements ]

Source for file index.php

Documentation is available at index.php

  1. <?php
  2. /**
  3.  * This is the main public interface file!
  4.  *
  5.  * This file is NOT mandatory. You can delete it if you want.
  6.  * You can also replace the contents of this file with contents similar to the contents
  7.  * of a_stub.php, a_noskin.php, multiblogs.php, etc.
  8.  *
  9.  * b2evolution - {@link http://b2evolution.net/}
  10.  * Released under GNU GPL License - {@link http://b2evolution.net/about/license.html}
  11.  * @copyright (c)2003-2006 by Francois PLANQUE - {@link http://fplanque.net/}
  12.  *
  13.  *  {@internal Note: we need at least one file in the main package}}
  14.  *
  15.  * @package main
  16.  */
  17.  
  18. /**
  19.  * First thing: Do the minimal initializations required for b2evo:
  20.  */
  21. require_once dirname(__FILE__).'/conf/_config.php';
  22.  
  23. require_once $inc_path.'_main.inc.php';
  24.  
  25. // Check if a specific blog has been requested in the URL:
  26. param'blog''integer'''true );
  27.  
  28. ifempty($blog) )
  29. // No blog requested by URL param, let's try to match something in the URL
  30.     $Debuglog->add'No blog param received, checking extra path...''detectblog' );
  31.  
  32.     ifpreg_match'#^(.+?)index.php/([^/]+)#'$ReqHost.$ReqPath$matches ) )
  33.     // We have an URL blog name:
  34.         $Debuglog->add'Found a potential URL blog name: '.$matches[2]'detectblog' );
  35.         if( (($Blog $BlogCache->get_by_urlname$matches[2]false )) !== false) )
  36.         // We found a matching blog:
  37.             $blog $Blog->ID;
  38.         }
  39.     }
  40.  
  41.     ifempty($blog) )
  42.     // No blog identified by URL name, let's try to match the absolute URL
  43.         ifpreg_match'#^(.+?)index.php#'$ReqHost.$ReqPath$matches ) )
  44.         // Remove what's not part of the absolute URL
  45.             $ReqAbsUrl $matches[1];
  46.         }
  47.         else
  48.         {
  49.             $ReqAbsUrl $ReqHost.$ReqPath;
  50.         }
  51.         $Debuglog->add'Looking up absolute url : '.$ReqAbsUrl'detectblog' );
  52.  
  53.         if( (($Blog $BlogCache->get_by_url$ReqAbsUrlfalse )) !== false) )
  54.         // We found a matching blog:
  55.             $blog $Blog->ID;
  56.             $Debuglog->add'Found matching blog: '.$blog'detectblog' );
  57.         }
  58.     }
  59.  
  60.     ifempty($blog) )
  61.     // Still no blog requested, use default
  62.         $blog $Settings->get('default_blog_ID');
  63.         $Debuglog->add'Using default blog '.$blog'detectblog' );
  64.     }
  65.  
  66.     ifempty($blog) )
  67.     // No specific blog to be displayed:
  68.         // we are going to display the default page:
  69.         require dirname(__FILE__).'/default.php';
  70.         exit();
  71.     }
  72. }
  73.  
  74. // A blog has been requested... Let's set a few default params:
  75.  
  76. # You could *force* a specific skin here with this setting:
  77. # $skin = 'basic';
  78.  
  79. # This setting retricts posts to those published, thus hiding drafts.
  80. # You should not have to change this.
  81. $show_statuses array();
  82.  
  83. # You could *force* a specific link blog here with this setting: (otherwise, default will be used)
  84. # $linkblog = 4;
  85.  
  86. # This is the list of categories to restrict the linkblog to (cats will be displayed recursively)
  87. # Example: $linkblog_cat = '4,6,7';
  88. $linkblog_cat '';
  89.  
  90. # This is the array if categories to restrict the linkblog to (non recursive)
  91. # Example: $linkblog_catsel = array( 4, 6, 7 );
  92. $linkblog_catsel array);
  93.  
  94. # Here you can set a limit before which posts will be ignored
  95. # You can use a unix timestamp value or 'now' which will hide all posts in the past
  96. $timestamp_min '';
  97.  
  98. # Here you can set a limit after which posts will be ignored
  99. # You can use a unix timestamp value or 'now' which will hide all posts in the future
  100. $timestamp_max 'now';
  101.  
  102. # Additionnaly, you can set other values (see URL params in the manual)...
  103. # $order = 'ASC'; // This for example would display the blog in chronological order...
  104.  
  105. // That's it, now let b2evolution do the rest! :)
  106. require $inc_path.'_blog_main.inc.php';
  107.  
  108. ?>

Documentation generated on Tue, 18 Dec 2007 23:06:33 +0100 by phpDocumentor 1.4.0