I wanted the blogs in the bloglist to be sorted alphabetically... Right now they sort by the order in which they were created... which I don't really care for. ./b2/blogs/skins/myskin/_bloglist.php becomes:
<?php
/**
* This is the template that displays the links to the available blogs
* And now it sorts the blogs alphabetically --ben
*
* This file is not meant to be called directly.
* It is meant to be called by an include in the _main.php template.
*
* b2evolution - {@link http://b2evolution.net/}
* Released under GNU GPL License - {@link http://b2evolution.net/about/license.html}
* @copyright (c)2003-2004 by Francois PLANQUE - {@link http://fplanque.net/}
*
* @package evoskins
*/
if( !defined('DB_USER') ) die( 'Please, do not access this page directly.' );
if( ! $display_blog_list )
{ // We do *not* want the blog list to be displayed
return;
}
# this is what will start and end your blog links
if(!isset($blog_list_start)) $blog_list_start = '<ul id="bloglist">';
if(!isset($blog_list_end)) $blog_list_end = '</ul>';
# this is what will separate your blog links
if(!isset($blog_item_start)) $blog_item_start = '<li>';
if(!isset($blog_item_end)) $blog_item_end = "</li>\n";
# This is the class of for the selected blog link:
if(!isset($blog_selected_link_class)) $blog_selected_link_class = 'BlogButtonCurr';
# This is the class of for the other blog links:
if(!isset($blog_other_link_class)) $blog_other_link_class = 'BlogButton';
# This is additionnal markup before and after the selected blog name
if(!isset($blog_selected_name_before)) $blog_selected_name_before = '';
if(!isset($blog_selected_name_after)) $blog_selected_name_after = '';
# This is additionnal markup before and after the other blog names
if(!isset($blog_other_name_before)) $blog_other_name_before = '';
if(!isset($blog_other_name_after)) $blog_other_name_after = '';
# This is the blogparam that will be displayed as the name:
if(!isset($blog_name_param)) $blog_name_param = 'shortname';
# This is the blogparam that will be displayed as the link title:
if(!isset($blog_title_param)) $blog_title_param = 'name';
// first we go through and get info about all the blogs, printing nothing
$i=0;
for( $curr_blog_ID = blog_list_start();
$curr_blog_ID != false;
$curr_blog_ID = blog_list_next() )
{
if( !blog_list_iteminfo( 'in_bloglist', false ) )
{ // don't show
continue;
}
$array_blog_name[blog_list_iteminfo($blog_name_param, '')]=$i;
$array_blog_ID[$i]=$curr_blog_ID;
$array_blog_url[$i]=blog_list_iteminfo('blogurl', '');
$array_blog_title[$i]=blog_list_iteminfo($blog_title_param, '');
$i++;
}
// now we sort the blog info alphabetically by sorting array_blog_name
ksort($array_blog_name);
// now we print the sorted blog info
echo $blog_list_start;
foreach($array_blog_name as $key=>$val)
{
// print "$key : $val<br>";
echo $blog_item_start;
if( $array_blog_ID[$val] == $blog )
{ // This is the blog being displayed on this page:
echo '<a href="';
echo $array_blog_url[$val];
echo '" class="', $blog_selected_link_class, '" title="';
echo $array_blog_title[$val];
echo '">';
echo $blog_selected_name_before;
echo $key;
echo $blog_selected_name_after;
echo '</a>';
}
else
{ // This is another blog:
echo '<a href="';
echo $array_blog_url[$val];
echo '" class="', $blog_other_link_class, '" title="';
echo $array_blog_title[$val];
echo '">';
echo $blog_other_name_before;
echo $key;
echo $blog_other_name_after;
echo '</a>';
} // End of testing which blog is being displayed
echo $blog_item_end;
}
echo $blog_list_end;
?>
Is there a way to order the blog list "manually"... I mean... in the exact order I want instead of alphabetically nor cronologically... :-)
thanks,