Source for file index.php
Documentation is available at index.php
* This is the main public interface file.
* IF YOU ARE READING THIS IN YOUR WEB BROWSER, IT MEANS THAT PHP IS NOT PROPERLY INSTALLED
* ON YOUR WEB SERVER. IF YOU DON'T KNOW WHAT THIS MEANS, CONTACT YOUR SERVER ADMINISTRATOR
* OR YOUR HOSTING COMPANY.
* This file is NOT mandatory. You can delete it if you want.
* You can also replace the contents of this file with contents similar to the contents
* of a_stub.php, a_notemplate.php, multiblogs.php, etc.
* Quam Plures - {@link http://quamplures.net/}
* Released under GNU GPL License - {@link http://quamplures.net/license.html}
* @copyright (c) 2009 - 2011 by the Quam Plures developers - {@link http://quamplures.net/}
* @copyright (c)2003-2009 by Francois PLANQUE - {@link http://fplanque.net/}
* {@internal Note: we need at least one file in the main package}}
* First thing: Do the minimal initializations required for QP:
require_once dirname(__FILE__ ). '/qp_config/_config.php';
* Check this: we are requiring _main.inc.php INSTEAD of _blog_main.inc.php
* because we are not trying to initialize any particular blog
require_once $inc_path. '_main.inc.php';
// Check if a specific blog has been requested in the URL:
param( 'blog', 'integer', '', true );
{ // No blog requested by URL param, let's try to match something in the URL
$Debuglog->add( 'No blog param received, checking extra path...', 'detectblog' );
if( preg_match( '#^(.+?)index.php/([^/]+)#', $ReqHost. $ReqPath, $matches ) )
{ // We have an URL blog name:
$Debuglog->add( 'Found a potential URL blog name: '. $matches[2], 'detectblog' );
if( (($Blog = & $BlogCache->get_by_urlname( $matches[2], false )) !== false) )
{ // We found a matching blog:
{ // No blog identified by URL name, let's try to match the absolute URL
if( preg_match( '#^(.+?)index.php#', $ReqHost. $ReqPath, $matches ) )
{ // Remove what's not part of the absolute URL
$ReqAbsUrl = $matches[1];
$ReqAbsUrl = $ReqHost. $ReqPath;
$Debuglog->add( 'Looking up absolute url : '. $ReqAbsUrl, 'detectblog' );
if( (($Blog = & $BlogCache->get_by_url( $ReqAbsUrl, false )) !== false) )
{ // We found a matching blog:
$Debuglog->add( 'Found matching blog: '. $blog, 'detectblog' );
{ // Still no blog requested, use default
$blog = $Settings->get('default_blog_ID');
if( (($Blog = & $BlogCache->get_by_ID( $blog, false, false )) !== false) )
{ // We found a matching blog:
$Debuglog->add( 'Using default blog '. $blog, 'detectblog' );
{ // No specific blog to be displayed, so make something nice then exit
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<title> <?php echo $app_name; ?> - Default Page</title>
<meta name="viewport" content="width = 750" />
<link href="qp_rsc/css/support_install.css" rel="stylesheet" type="text/css" />
<base href=" <?php echo $app_baseurl ?>" />
// --- --- --- --- --- --- --- --- --- --- ---
// --- TOOLBAR INCLUDED HERE ---
require $templates_path. '_toolbar.inc.php';
echo '<div id="template_wrapper" class="template_wrapper_loggedin">';
echo '<div id="template_wrapper" class="template_wrapper_anonymous">';
<div class="wrapper1"><div class="wrapper2"><div class="block1"><div class="block2"><div class="block3">
<h1> <?php printf( T_('Welcome to %s'), $app_name ); ?></h1>
// messages generated from actions
if( count( $BlogCache->cache ) == 0 )
{ // There is no blog on this system!
printf( T_('%s is installed and ready but you haven\'t created any blog on this system yet.'), $app_name );
echo '<p><a href="'. $admin_url. '?ctrl=collections&action=new">'. T_( 'Create a first blog' ). ' »</a></p>';
printf( T_('You have successfully installed %s.'), $app_name );
echo '<p>'. T_('You haven\'t set a default blog yet. Thus, you see this default page.'). '</p>';
<p><a href=" <?php echo $admin_url ?>?ctrl=settings&tab=general"> <?php echo T_( 'Set a default blog' ) ?> »</a></p>
<div class="body_fade_out"><div class="menu_bottom">
echo '<a href="contact.php" title="'. T_('Contact the admin'). '">'. T_('Contact the admin'). '</a>';
echo T_('powered by'). ' <a href="'. $app_homepage. '" title="'. $app_homepage. '">'. $app_name. '</a>';
</div></div></div></div></body></html>
// A blog has been requested... Let's set a few default params:
# You could *force* a specific template here with this setting:
# This setting retricts posts to those published, thus hiding drafts.
# You should not have to change this.
$show_statuses = array();
# Here you can set a limit before which posts will be ignored
# You can use a unix timestamp value or 'now' which will hide all posts in the past
# Here you can set a limit after which posts will be ignored
# You can use a unix timestamp value or 'now' which will hide all posts in the future
# Additionnaly, you can set other values (see URL params in the manual)...
# $order = 'ASC'; // This for example would display the blog in chronological order...
// That's it, now let Quam Plures do the rest! :)
require $inc_path. '_blog_main.inc.php';
|