1 jamesorr Jun 02, 2008 23:39
3 jamesorr 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 jamesorr 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 yabba 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 jamesorr 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 yabba 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 jamesorr 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 yabba 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 edb 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 yabba Jun 06, 2008 09:05
Sorry, I haven't had coffee yet, I'll go grab one and sort my shit out :roll:
¥
12 jamesorr Jun 06, 2008 09:05
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