Recent Topics

1 May 25, 2007 19:54    

My b2evolution Version: Not Entered

This is probably something obvious that I just can't happen to find, but is there any way to display the *oldest* posts first on the main page? I'm sure there is, but how...

2 May 26, 2007 07:53

If you use stub files you can set "$order = 'ASC';" in the stub. If you don't use stubs and you use only one skin you can probably place the same line into your skins/yourskin/_main.php file.

3 May 28, 2007 00:44

hmm... i'm not using stubs. would there be an ideal place to stick that in the main.php file? i hope that will work.

thanks for your help!

4 May 28, 2007 01:59

I'm guessing, but right before the "</head>" tag try adding this:

<?php $order = 'ASC'; ?>


If it works it'll do it to all the blogs in your installation. If you only want (for example) blog #3 to act that way try this:

<?php if( $blog == 3 ) {
$order = 'ASC';
} ?>

Can't hurt to try!

5 May 28, 2007 04:32

i gave it a try, but no luck :( any other inspiration?

;)

6 May 28, 2007 13:05

stick it at the top of your index.php

7 May 28, 2007 17:05

you seem to be on the right track here...
i opened index.php and found the $order='ASC'; line, as in the stub file, however when I activated that nothing changed. (i also tried putting it at the top, as you suggested, but no luck there either.) i activated/changed other commands in that same file (like the min/max display dates, etc) just to make sure i actually was having some effect on the display and found that those definitely worked. any ideas as to why this $order command isn't working?

thanks for all your help!

8 May 28, 2007 17:13

also: tried using a stub file... also no effect :(

9 May 28, 2007 23:05

Got link? Set it to ASC and show us where it's not working, please.

10 May 29, 2007 02:41

Yeah the index.php is just a stub file anyway, maybe also attach the source of the index.php you used with the applied $asc, so we can see if it's all good. :)

11 May 29, 2007 03:33

here's the code:


<?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-2006 by Francois PLANQUE - {@link http://fplanque.net/}
 *
 * {@internal Note: we need at least one file in the main package}}
 *
 * @package main
 */

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

require_once $inc_path.'_main.inc.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 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:
			$blog = $Blog->ID;
		}
	}

	if( empty($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];
		}
		else
		{
			$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:
			$blog = $Blog->ID;
			$Debuglog->add( 'Found matching blog: '.$blog, 'detectblog' );
		}
	}

	if( empty($blog) )
	{ // Still no blog requested, use default
		$blog = $Settings->get('default_blog_ID');
		$Debuglog->add( 'Using default blog '.$blog, 'detectblog' );
	}

	if( empty($blog) )
	{ // No specific blog to be displayed:
		// we are going to display the default page:
		require dirname(__FILE__).'/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 $inc_path.'_blog_main.inc.php';

?>

thanks!

12 May 29, 2007 06:42

can you provide a link to the blog as well, and stick this below your $order = 'asc':
$_GET['order'] = 'asc';

If it works still post back instead of saying thanks, as if it does work it's a bug...

14 May 29, 2007 16:36

It is working, http://www.theurbanendeavor.net/b2evolution/blogs/index.php?cat=15

Posts:
2006.10.06 - from russia with love
2006.11.23 - Happy Turkey Day from Turkey!

What is odd is that your default page is the all category (or the other way round) and only shows just a single post.

Edit:
the post it is showing is from your '...but seriously' category and is the oldest post. Have you been fiddling with any settings?

Also on a unrelated note, your skin looks a tad loftsided on a 1680x1050 monitor... Maybe it's better centering the content and for the right side, just have those bars extend accross

15 May 29, 2007 21:21

aha -- i found what i had changed earlier. sorry to keep bothering you, sorry! thanks so much!

16 May 29, 2007 21:29

can you post what you changed so it can help others with the same problem later on?

17 May 29, 2007 22:01

of course.

What I had changed was in the "blog settings" in the back office. I had it set to display # of days = 5 on the main page. I'm not sure why that went to show the 5 most recent days (in which there was only that one post) rather than the 5 oldest days, but in any case I changed it to # of posts instead, and now it works beautifully.


Form is loading...