Recent Topics

1 Feb 05, 2007 22:49    

I have already searched for this and not found it. I have upgraded from 0.9 to 1.92 (yeah, I had a real old version lol), anyway I have my blog at /blog/ and not in my home directory. Is there a index page sorta like the old one that can use?

This is the old one I had (to give you an example):

<?php
/**
 * This is the main public interface file!
 *
 * 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_noskin.php, multiblogs.php, etc.
 *
 * b2evolution - {@link http://b2evolution.net/}
 * Released under GNU GPL License - {@link http://b2evolution.net/about/license.html}
 * @copyright (c)2003-2004 by Francois PLANQUE - {@link http://fplanque.net/}
 *
 * @package main
 * Note: we need at least one file in the main package
 */

/**
 * First thing: Do the minimal initializations required for b2evo:
 */
require_once dirname(__FILE__).'/blog/b2evocore/_main.php';

// Check if a specific blog has been requested in the URL:
param( 'blog', 'integer', '', true );

if( empty($blog) )
{	// No blog requested, by URL param, let's check extrapath
  # echo 'Checking extra path...<br />';
	// Check and Remove current page url:
	$index_url = substr( $baseurl, strlen( $baseurlroot ) ) . '/blog/index.php';
  # echo 'Seeking ['.$index_url.'] in ['.$ReqPath.']...<br />';
	if( ($pos = strpos( $ReqPath, $index_url )) !== false )
	{ // note: $pos will typically be 0
    # echo 'Matched index.php path...<br />';
		$path_string = substr( $ReqPath, $pos+strlen( $index_url ) );
		// echo "path=$path_string <br>";
		$path_elements = explode( '/', $path_string, 20 );						// slice it
		if( isset($path_elements[1]) && (($Blog = $BlogCache->get_by_stub( $path_elements[1], false )) !== false) )
		{	// We found a matching blog:
			$blog = $Blog->ID;
		}
	}
}

if( empty($blog) )
{	// Still no blog requested,
	$blog = $Settings->get('default_blog_ID');
}

if( empty($blog) )
{	// No specific blog to be displayed:
	// we are going to display the default page:
	require dirname(__FILE__).'/blog/default.php';
	exit();
}

// A blog has been requested... Let's set a few default params:

# You could *force* a specific skin here with this setting:
# $skin = 'basic';

# This setting retricts posts to those published, thus hiding drafts.
# You should not have to change this.
$show_statuses = array();

# You could *force* a specific link blog here with this setting: (otherwise, default will be used)
# $linkblog = 4;

# This is the list of categories to restrict the linkblog to (cats will be displayed recursively)
# Example: $linkblog_cat = '4,6,7';
$linkblog_cat = '';

# This is the array if categories to restrict the linkblog to (non recursive)
# Example: $linkblog_catsel = array( 4, 6, 7 );
$linkblog_catsel = 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
$timestamp_min = '';

# 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
$timestamp_max = 'now';

# 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 b2evolution do the rest! :)
require dirname(__FILE__)."/blog/$core_subdir/_blog_main.php";

?>

Thanks for any help,
Sterling

2 Feb 06, 2007 12:23

Can anyone help before this post gets lost ?

3 Feb 06, 2007 12:50

I'm not sure what you're trying to do, but it seems to me you could simply move your blog up one level - out of /blogs/ and have one of your blogs be the default blog on index.php.

You could try to modify the index.php in your newest version similar to the way your old one was modified, but I don't know if it will let you have the blog in a folder and get your index stuff one level up. Worth a shot I guess. Find in blog/index.php this:

require_once dirname(__FILE__).'/blog/conf/_config.php';


Now make it be like this and save it in your root directory - NOT in your blog/ folder:

require_once dirname(__FILE__).'/conf/_config.php';

BTW posts don't get lost. If no one has an answer then that's the way it is, and eventually it'll slide down the page, but this is the first I'm seeing this.


Form is loading...