Recent Topics

1 Nov 26, 2008 09:58    

My b2evolution Version: 2.x

Hello.

Is there a way to alphabetize the blog listing in Summary.php?

Thanks in advance.

2 Nov 26, 2008 14:58

Completely untested, try changing this section of the file and seeing if it works :

<?php // --------------------------- BLOG LIST -----------------------------

	load_class('items/model/_itemlist.class.php');

	$BlogCache = & get_Cache( 'BlogCache' );

	$unsorted_array = $BlogCache->load_public( 'ID' );

	$blog_array = array();
	foreach( $unsorted_array as $unsorted )
	{
		$blog_array[ $BlogCache->get_by_ID( $unsorted )->get( 'name' ) ] = $unsorted;
	}

	natcasesort( $blog_array );

	foreach( $blog_array as $blog )
	{	// Loop through all public blogs:

¥

3 Nov 26, 2008 22:19

Thanks for your reply, ¥åßßå.

The sort order remained the same. Here is what I used so you'll know:

	load_class('items/model/_itemlist.class.php');

	$BlogCache = & get_Cache( 'BlogCache' );

//	$blog_array = $BlogCache->load_public( 'ID' );

 $unsorted_array = $BlogCache->load_public( 'ID' );

    $blog_array = array();
    foreach( $unsorted_array as $unsorted )
    {
        $blog_array[ $BlogCache->get_by_ID( $unsorted )->get( 'name' ) ] = $unsorted;
    }

    natcasesort( $blog_array );

	foreach( $blog_array as $blog )
	{	// Loop through all public blogs:

Thanks.

4 Nov 27, 2008 14:55

it'd help if I used the right sort :P

change natcasesort() to ksort() and hopefully it'll work ;)

¥

5 Nov 27, 2008 20:22

Hey ¥åßßå - that worked! COOL BEANS!

Thanks! :D


Form is loading...