Recent Topics

1 Apr 02, 2005 09:31    

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:

	 * 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}
	 * Released under GNU GPL License - {@link}
	 * @copyright (c)2003-2004 by Francois PLANQUE - {@link}
	 * @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

# 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
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

	$array_blog_name[blog_list_iteminfo($blog_name_param, '')]=$i;

	$array_blog_url[$i]=blog_list_iteminfo('blogurl', '');
	$array_blog_title[$i]=blog_list_iteminfo($blog_title_param, '');


// now we sort the blog info alphabetically by sorting 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>';
	{ // 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;


2 Apr 21, 2005 03:45

Is there a way to order the blog list "manually"... I mean... in the exact order I want instead of alphabetically nor cronologically... :-)


3 Apr 21, 2005 04:26

The blog list is called in _main.php toward the top. If you replace the call to bloglist.php (there's a comment that says BLOGLIST INCLUDED HERE) with your own bloglist html, then you can order it how you want to.

Here's my bloglist... yours would look similar.

  <ul id="bloglist"><li><a href="" class="BlogButtonCurr" title="nonplatonic">nonplatonic</a></li>
<li><a href="" class="BlogButton" title="Anwar">Anwar</a></li>
<li><a href="" class="BlogButton" title="Ben">Ben</a></li>
<li><a href="" class="BlogButton" title="Collin">Collin</a></li>
<li><a href="" class="BlogButton" title="A Hole in the World">Devin</a></li>
<li><a href="" class="BlogButton" title="Graham">Graham</a></li>
<li><a href="" class="BlogButton" title="Marco">Marco</a></li>
<li><a href="" class="BlogButton" title="Scott">Scott</a></li>

4 Apr 21, 2005 05:57

I did it and worked fine! thanks,

Form is loading...