2 afwas Jun 03, 2008 00:33

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
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
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;
¥
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
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;
¥
You are awesome! That did it!
Thank you!
Can I thank you and link to your site from mine?
Sincerely,
James
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
¥
¥åßßå 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!!!!
Sorry, I haven't had coffee yet, I'll go grab one and sort my shit out :roll:
¥
Thank you! I really appreciate it and thanked you on my marketing journal blog:
http://ruthlessaccountability.com/it-s-now-alphabetized-and-thank-you
Thanks again!
Sincerely,
James
Hi,
Presuming you have version 2.x this will work: [url=http://forums.b2evolution.net/viewtopic.php?t=14368][2.4.0] [Widget] Sorted Bloglist widget[/url]. I haven't looked at it fot some time. I remember wanting to add some goodies, so if you have some requests, please let me know.
Good luck