Recent Topics

1 Mar 24, 2008 14:39    

My b2evolution Version: v 2.4

Hi - I think this is a semi-skin question:

I'm trying to change the order of blog collection drop-down select list and/or the "buttons" to be ordered by ID to ordered by the blog's shortname.

I thought for sure it is in /skins_adm/_adminUI_general.class.php in the get_bloglist_buttons function. I changed

$blog_array = $BlogCache->load_user_blogs( $this->coll_list_permname, $this->coll_list_permlevel );


to

$blog_array = $BlogCache->load_user_blogs( $this->coll_list_permname, $this->coll_list_permlevel, NULL , 'shortname' ); 


...after looking at the BlogCache class. But there was no effect, it seems, even after I dumped the pre-rendered items cache.

Searched around both the forums and the code but couldn't find another approach. Any ideas?

2 Mar 24, 2008 14:55

Hi Nate,

What you do looks OK, and I haven 't got a clue why it doesn 't work. You can try set $debug to 1 in /conf/_advanced.php. That spits out all kind of data including the database queries. You may find information there.

Good luck

3 Mar 24, 2008 14:59

You're possibly getting screwed by this piece of code /inc/collections/model/_blogcache.class.php approx 269

		$for_User->get_Group();// ensure Group is set

		$Group = $for_User->Group;
		// First check if we have a global access perm:
 		if( $Group->check_perm( 'blogs', $permlevel ) )
		{ // If group grants a global permission:
			$this->load_all();
			return $this->get_ID_array();
		}

Try logging in as a non-admin user and seeing if the order changes

¥

4 Mar 24, 2008 15:19

Hmmph... good eye, ¥åßßå... that seems to be what's happening - the list is alphabetical if I change my group ID from the admin.

I'm not sure why that bit of code is there. Any suggestions for a workaround without bringing down the house?

5 Mar 24, 2008 15:24

You could try deleting that section and seeing if your server melts :roll:

¥

6 Mar 24, 2008 15:39

¥åßßå wrote:

You could try deleting that section and seeing if your server melts

Hmmm. yeah - not the best way to go about it, and I'm pretty sure that would break the admin group's ability to edit all blogs (with explicitly adding them to the blog) :)

I'll take a look at it a little more deeply - thanks for pointing that section out. If anyone has done this already or has suggestions, I'm all ears ;)

7 Mar 24, 2008 15:57

Just for giggles, change it to this and see what happens ;)

		$for_User->get_Group();// ensure Group is set

		$Group = $for_User->Group;
		// First check if we have a global access perm:
 		if( $Group->check_perm( 'blogs', $permlevel ) )
		{ // If group grants a global permission:
			$this->order_by = $order;
			$this->load_all();
			return $this->get_ID_array();
		}

¥

8 Mar 24, 2008 17:01

Thanks ¥åßßå. You were close - it was

// First check if we have a global access perm:
if( $Group->check_perm( 'blogs', $permlevel ) )
{ // If group grants a global permission:
    
  // NJW MOD - Add orderby so blog drop lists are sorted by shortname order
  $this->order_by = $this->dbprefix.$order_by; 
    
  $this->load_all();
  return $this->get_ID_array();
}


In /inc/collections/model/_blogcache.class.php around line 269-270 ish... (in the load_user_blogs function)

And then for it to actually do something, from the first post, change

$blog_array = $BlogCache->load_user_blogs( $this->coll_list_permname, $this->coll_list_permlevel );


to

$blog_array = $BlogCache->load_user_blogs( $this->coll_list_permname, $this->coll_list_permlevel, NULL , 'shortname' );


...in /skins_adm/_adminUI_general.class.php to change the sort order from the default ID to shortname.

Not sure if the former should be filed as a bug - or is there some intended behaviour I am missing?

9 Mar 24, 2008 18:08

*moved*, if only to remind me ;)

¥


Form is loading...