Recent Topics

1 Jun 02, 2008 23:39    

My b2evolution Version: Not Entered

I imagine I'm not the first person to ask this, but I can't find it in the forum.

Is there a way to sort the public blog list widget alphabetically?

I am trying to sort the city blogs on my site:

http://WholesalerNetwork.com

Alphabetically.

Thanks!

James

3 Jun 03, 2008 18:58

I am not sure that will be a good solution. I have over 50 sites set up using that and I am about to add 250 more.

Do you happen to know the file to edit for the original widget to make that sort alphabetically?

Thanks.

James

4 Jun 06, 2008 05:42

Is there a way I can make a change to the existing code to make this work with the current "Public Blog List"?

Anyone know how to do that?

Thanks in advance!

Sincerely,

James

5 Jun 06, 2008 08:38

inc/widgets/model/_widgets.class.php ( approx 643 ) add the new bits :

		if( $filter == 'owner' )
		{	// Load blogs of same owner
			$blog_array = $BlogCache->load_owner_blogs( $Blog->owner_user_ID, 'ID' );
		}
		else
		{	// Load all public blogs
			$blog_array = $BlogCache->load_public( 'ID' );
		}

$foo = array();
foreach( $blog_array as $a_blog )
{
$foo[ strtolower( $a_blog->get( 'shortname' ) ) ] = $a_blog;
}
sort(  $foo );
$blog_array = $foo;

¥

6 Jun 06, 2008 08:48

Thanks for the code. I really, really appreciate the help.

When I enter:


$foo = array();
foreach( $blog_array as $a_blog )
{
$foo[ strtolower( $a_blog->get( 'shortname' ) ) ] = $a_blog;
}
sort(  $foo );
$blog_array = $foo;

After the section you show, the blog list does not display at all (actually I think it stops even the rest of the page from there from loading.

I don't see anything obvious to fix.

Any ideas? Thanks in advance. I really appreciate it.

Sincerely,

James

7 Jun 06, 2008 08:54

Blonde moment, change the extra snippet to this :

$foo = array();
foreach( $blog_array as $a_blog )
{
$bar = $BlogCache->get_by_ID( $a_blog );
$foo[ strtolower( $bar->get( 'shortname' ) ) ] = $a_blog;
}
ksort(  $foo );
$blog_array = $foo;

¥

8 Jun 06, 2008 08:56

You are awesome! That did it!

Thank you!

Can I thank you and link to your site from mine?

Sincerely,

James

9 Jun 06, 2008 08:58

No problems;)

Sure feel free to link to my site ( it's in my sig ), I can always do with more traffic to dumbfound :D

¥

10 Jun 06, 2008 08:59

¥åßßå you are ruining all my (planned but never implemented) fun! I wanted to start hacking widgets today given the standard definition of today and here you go hacking them up and making them do stuff that they should do by design.

GRRRR!!!!

11 Jun 06, 2008 09:05

Sorry, I haven't had coffee yet, I'll go grab one and sort my shit out :roll:

¥


Form is loading...