b2evolution

Multilingual multiuser multiblog engine

b2evolution Technical Documentation (0.9.x) [ 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-2005 by Francois PLANQUE - {@link http://fplanque.net/}
  12.  *
  13.  * @package main
  14.  *  Note: we need at least one file in the main package
  15.  */
  16.  
  17. /**
  18.  * First thing: Do the minimal initializations required for b2evo:
  19.  */
  20. require_once dirname(__FILE__).'/b2evocore/_main.php';
  21.  
  22. // Check if a specific blog has been requested in the URL:
  23. param'blog''integer'''true );
  24.  
  25. ifempty($blog) )
  26. {    // No blog requested, by URL param, let's check extrapath
  27.   # echo 'Checking extra path...<br />';
  28.     // Check and Remove current page url:
  29.     $index_url substr$baseurlstrlen$baseurlroot ) ) '/index.php';
  30.   # echo 'Seeking ['.$index_url.'] in ['.$ReqPath.']...<br />';
  31.     if( ($pos strpos$ReqPath$index_url )) !== false )
  32.     // note: $pos will typically be 0
  33.     # echo 'Matched index.php path...<br />';
  34.         $path_string substr$ReqPath$pos+strlen$index_url ) );
  35.         // echo "path=$path_string <br>";
  36.         $path_elements explode'/'$path_string20 );                        // slice it
  37.         ifisset($path_elements[1]&& (($Blog $BlogCache->get_by_stub$path_elements[1]false )) !== false) )
  38.         {    // We found a matching blog:
  39.             $blog $Blog->ID;
  40.         }
  41.     }
  42. }
  43.  
  44. ifempty($blog) )
  45. {    // Still no blog requested,
  46.     $blog $Settings->get('default_blog_ID');
  47. }
  48.  
  49. ifempty($blog) )
  50. {    // No specific blog to be displayed:
  51.     // we are going to display the default page:
  52.     require dirname(__FILE__).'/default.php';
  53.     exit();
  54. }
  55.  
  56. // A blog has been requested... Let's set a few default params:
  57.  
  58. # You could *force* a specific skin here with this setting:
  59. # $skin = 'basic';
  60.  
  61. # This setting retricts posts to those published, thus hiding drafts.
  62. # You should not have to change this.
  63. $show_statuses array();
  64.  
  65. # You could *force* a specific link blog here with this setting: (otherwise, default will be used)
  66. # $linkblog = 4;
  67.  
  68. # This is the list of categories to restrict the linkblog to (cats will be displayed recursively)
  69. # Example: $linkblog_cat = '4,6,7';
  70. $linkblog_cat '';
  71.  
  72. # This is the array if categories to restrict the linkblog to (non recursive)
  73. # Example: $linkblog_catsel = array( 4, 6, 7 );
  74. $linkblog_catsel array);
  75.  
  76. # Here you can set a limit before which posts will be ignored
  77. # You can use a unix timestamp value or 'now' which will hide all posts in the past
  78. $timestamp_min '';
  79.  
  80. # Here you can set a limit after which posts will be ignored
  81. # You can use a unix timestamp value or 'now' which will hide all posts in the future
  82. $timestamp_max 'now';
  83.  
  84. # Additionnaly, you can set other values (see URL params in the manual)...
  85. # $order = 'ASC'; // This for example would display the blog in chronological order...
  86.  
  87. // That's it, now let b2evolution do the rest! :)
  88. require dirname(__FILE__)."/$core_subdir/_blog_main.php";
  89.  
  90. ?>

Documentation generated on Tue, 20 May 2008 01:51:47 +0200 by phpDocumentor 1.4.2