1 honeysmom Nov 24, 2006 18:25
3 honeysmom Nov 25, 2006 15:19
Thank you this does work but I assume since I am using a custom skin it is not displaying my tabs correctly. Or maybe a different version.
It is cutting of the right side of the tab. I appreciate your time and effort to provide me with this code. If I can figure out how to fix the tab I will definitely be using it.
Colleen
4 xangelusx Nov 26, 2006 01:12
Hi Colleen - If you upload your original skin's _bloglist.php file I can try to see if there is a conflict some where.
5 honeysmom Nov 26, 2006 02:50
That is so nice of you. Here it is
<?php
/**
* This is the template that displays the links to the available blogs
*
* 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-2005 by Francois PLANQUE - {@link http://fplanque.net/}
*
* @package evoskins
*/
if( !defined('EVO_MAIN_INIT') ) 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>';
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>';
# This is the class of for the selected blog link:
if(!isset($blog_selected_link_class)) $blog_selected_link_class = '';
# This is the class of for the other blog links:
if(!isset($blog_other_link_class)) $blog_other_link_class = '';
# This is additionnal markup before and after the selected blog name
if(!isset($blog_selected_name_before)) $blog_selected_name_before = '<strong>';
if(!isset($blog_selected_name_after)) $blog_selected_name_after = '</strong>';
# 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';
echo $blog_list_start;
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;
}
echo $blog_item_start;
if( $curr_blog_ID == $blog )
{ // This is the blog being displayed on this page:
echo '<a href="';
blog_list_iteminfo('blogurl', 'raw');
echo '" class="', $blog_selected_link_class, '" title="';
blog_list_iteminfo($blog_title_param, 'htmlattr');
echo '"><span>';
echo $blog_selected_name_before;
blog_list_iteminfo($blog_name_param, 'htmlbody');
echo $blog_selected_name_after;
echo '</span></a>';
}
else
{ // This is another blog:
echo '<a href="';
blog_list_iteminfo('blogurl', 'raw');
echo '" class="', $blog_other_link_class, '" title="';
blog_list_iteminfo($blog_title_param, 'htmlattr');
echo '"><span>';
echo $blog_other_name_before;
blog_list_iteminfo($blog_name_param, 'htmlbody');
echo $blog_other_name_after;
echo '</span></a>';
} // End of testing which blog is being displayed
echo $blog_item_end;
}
echo $blog_list_end;
?>
Sorry I don't know how to do that scroll thing
6 edb Nov 26, 2006 07:57
Honeysmom wrote:
... Sorry I don't know how to do that scroll thing
It's the "PHP" button if you want stuff in color like xangelusx did, or the "Code" button for the dull way I did it.
xangelusx thanks for the hacks. It's cool to have groovy options that can be implemented in the skin.
7 xangelusx Nov 28, 2006 04:33
There wasn't more than a line or two of differences between your file and mine, but lets try one of these. The first is for alpha sorting and you should be able to just drop it in place of the old _bloglist.inc.php. The second is for custom sorting and will require some work on your part to put the blogs in the correct order, which starts on line 104.
Alpha Sort
<?php
/**
* This is the template that displays the links to the available blogs
*
* 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-2005 by Francois PLANQUE - {@link http://fplanque.net/}
*
* @package evoskins
*/
if( !defined('EVO_MAIN_INIT') ) 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>';
if(!isset($blog_list_end)) $blog_list_end = '</ul>';
# This is what will separate items in the list
if(!isset($blog_list_separator)) $blog_list_separator = '';
# 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>';
# This is the class of for the selected blog link:
if(!isset($blog_selected_link_class)) $blog_selected_link_class = '';
# This is the class of for the other blog links:
if(!isset($blog_other_link_class)) $blog_other_link_class = '';
# This is additionnal markup before and after the selected blog name
if(!isset($blog_selected_name_before)) $blog_selected_name_before = '<strong>';
if(!isset($blog_selected_name_after)) $blog_selected_name_after = '</strong>';
# 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';
/**
* Custom Sorting Hack :: START
* Create an array to collect all of the blogs in. We can then easily
* sort/order and join them below.
*/
$blog_links = array();
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;
}
$blog_link = $blog_item_start;
if( $curr_blog_ID == $blog )
{ // This is the blog being displayed on this page:
$blog_link .= '<a href="';
$blog_link .= blog_list_iteminfo('blogurl', false);
$blog_link .= '" class="'.$blog_selected_link_class.'" title="';
$blog_link .= format_to_output( blog_list_iteminfo($blog_title_param, false), 'htmlattr' );
$blog_link .= '"><span>';
$blog_link .= $blog_selected_name_before;
$blog_link .= format_to_output( blog_list_iteminfo($blog_name_param, false ), 'htmlbody' );
$blog_link .= $blog_selected_name_after;
$blog_link .= '</span></a>';
}
else
{ // This is another blog:
$blog_link .= '<a href="';
$blog_link .= blog_list_iteminfo('blogurl', false);
$blog_link .= '" class="'.$blog_other_link_class.'" title="';
$blog_link .= format_to_output( blog_list_iteminfo($blog_title_param, false), 'htmlattr' );
$blog_link .= '"><span>';
$blog_link .= $blog_other_name_before;
$blog_link .= format_to_output( blog_list_iteminfo($blog_name_param, false), 'htmlbody' );
$blog_link .= $blog_other_name_after;
$blog_link .= '</span></a>';
} // End of testing which blog is being displayed
$blog_link .= $blog_item_end;
/**
* Custom Sorting Hack
* Use $blog_name_param as a named key for sorting later on.
*/
$blog_links[blog_list_iteminfo($blog_name_param, false )] = $blog_link;
}
/**
* Custom Sorting Hack
* Order the blogs alphabetically based on the array keys (using $blog_name_param)
*/
ksort($blog_links);
/**
* Custom Sorting Hack :: END
*/
// Output:
echo $blog_list_start;
echo implode( $blog_list_separator, $blog_links );
echo $blog_list_end;
/*
nolog */
?>
Custom Sort
<?php
/**
* This is the template that displays the links to the available blogs
*
* 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-2005 by Francois PLANQUE - {@link http://fplanque.net/}
*
* @package evoskins
*/
if( !defined('EVO_MAIN_INIT') ) 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>';
if(!isset($blog_list_end)) $blog_list_end = '</ul>';
# This is what will separate items in the list
if(!isset($blog_list_separator)) $blog_list_separator = '';
# 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>';
# This is the class of for the selected blog link:
if(!isset($blog_selected_link_class)) $blog_selected_link_class = '';
# This is the class of for the other blog links:
if(!isset($blog_other_link_class)) $blog_other_link_class = '';
# This is additionnal markup before and after the selected blog name
if(!isset($blog_selected_name_before)) $blog_selected_name_before = '<strong>';
if(!isset($blog_selected_name_after)) $blog_selected_name_after = '</strong>';
# 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';
/**
* Custom Sorting Hack :: START
* Create an array to collect all of the blogs in. We can then easily
* sort/order and join them below.
*/
$blog_links = array();
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;
}
$blog_link = $blog_item_start;
if( $curr_blog_ID == $blog )
{ // This is the blog being displayed on this page:
$blog_link .= '<a href="';
$blog_link .= blog_list_iteminfo('blogurl', false);
$blog_link .= '" class="'.$blog_selected_link_class.'" title="';
$blog_link .= format_to_output( blog_list_iteminfo($blog_title_param, false), 'htmlattr' );
$blog_link .= '"><span>';
$blog_link .= $blog_selected_name_before;
$blog_link .= format_to_output( blog_list_iteminfo($blog_name_param, false ), 'htmlbody' );
$blog_link .= $blog_selected_name_after;
$blog_link .= '</span></a>';
}
else
{ // This is another blog:
$blog_link .= '<a href="';
$blog_link .= blog_list_iteminfo('blogurl', false);
$blog_link .= '" class="'.$blog_other_link_class.'" title="';
$blog_link .= format_to_output( blog_list_iteminfo($blog_title_param, false), 'htmlattr' );
$blog_link .= '"><span>';
$blog_link .= $blog_other_name_before;
$blog_link .= format_to_output( blog_list_iteminfo($blog_name_param, false), 'htmlbody' );
$blog_link .= $blog_other_name_after;
$blog_link .= '</span></a>';
} // End of testing which blog is being displayed
$blog_link .= $blog_item_end;
/**
* Custom Sorting Hack
* Use blog_ID as a numeric key for custom sorting later on.
* We could also use $blog_name_param in place of 'blog_ID' but the ID is a
* safer value as the name of a blog is more likely to change over time.
*/
$blog_links[blog_list_iteminfo('blog_ID', false )] = $blog_link;
}
/**
* Custom Sorting Hack
* Create new array to work with
*/
$sorted_blog_links = array();
/**
* Custom Sorting Hack
* Use the format below to sort your blogs in a custom order using the Blog_ID
*/
if (isset($blog_links['1'])) { $sorted_blog_links[] = $blog_links['1']; unset($blog_links['1']); }
if (isset($blog_links['4'])) { $sorted_blog_links[] = $blog_links['4']; unset($blog_links['4']); }
if (isset($blog_links['2'])) { $sorted_blog_links[] = $blog_links['2']; unset($blog_links['2']); }
if (isset($blog_links['3'])) { $sorted_blog_links[] = $blog_links['3']; unset($blog_links['3']); }
if (isset($blog_links['6'])) { $sorted_blog_links[] = $blog_links['6']; unset($blog_links['6']); }
if (isset($blog_links['5'])) { $sorted_blog_links[] = $blog_links['5']; unset($blog_links['5']); }
/**
* Custom Sorting Hack
* If there are any blogs remaining in $blog_links then add them to the end off the sorted blog list
* This prevents new blogs from going missing if they haven't been added to the above list yet.
*/
if (sizeof($blog_links)) {
$sorted_blog_links = $sorted_blog_links + $blog_links;
}
/**
* Custom Sorting Hack
* Assign sorted blog list to $blog_links and clean up old list
*/
$blog_list = $sorted_blog_links;
unset($sorted_blog_links);
/**
* Custom Sorting Hack :: END
*/
// Output:
echo $blog_list_start;
echo implode( $blog_list_separator, $blog_links );
echo $blog_list_end;
/*
nolog */
?>
If neither of these work then I'll need the version of b2evolution that you are running (listed at the bottom of each Admin page) and the name of the skin(s) that you're using.
If you are usin multiple skins then you should place the code above into /skins/_bloglist.inc.php. If you are using a single skin then it may be easier to replace the _bloglist.inc.php file in the skin's directory.
8 honeysmom Nov 29, 2006 15:55
Thank You so much that worked perfectly!!!!!!!
9 xangelusx Nov 29, 2006 16:33
Glad I could help another b2'ee!
10 boblebad Feb 13, 2007 17:20
Hi
I'm new to the b2evo world, i've tryed for some weeks now to get WP to work, but there are just to many problems, so i started looking for another and better Blog, and this looks very much like something i could use, it's a powerful script, lots of features, and very nice too :)
But i was looking to change the order of the Blog's and found this thread...
I'm not sure exactly how to use the code, i'm on a clean install with the costum skin, but when i use the code directly, i get an error as you can see on my site www.kosmologiblog.dk :(
{
return $this->$parname;
}
I'm not sure if the code i usable for every skin or for a specific one ?
Best regards
Carsten, Denmark
11 xangelusx Feb 13, 2007 18:14
Hi Carsten,
First, welcome to b2evo-land. It's a beautiful place with plenty of helpful citizens.
On to the topic at hand - AFAIK this hack should work in the latest version of B2evolution. Have you followed the directions in my [url=#47414]post[/url] above?
If that still doesn't work, try posting your current _bloglist.php and we'll go from there
12 boblebad Feb 13, 2007 18:30
Hi xangelusx
Thanks, and thanks for replying :)
Yep, i tryed copy/pasting both codes, from both the post, but with the same result :(
The Alpha version works fine, no problem there, it's only the Custom sort that gives the errors, i'm using the lastest ver. of b2evo, 1.9.2
I would gladly post my file, but it's exactly like the ones you've posted, and i also tryed copy/pasting from line 82 and down, and it gives the same error..
Best regards
Carsten, Denmark
13 boblebad Feb 13, 2007 20:34
Hi xangelusx
I have now tryed to delete and reinstall b2evo, so it's completly clean
I then tryed from the first code-set, pasting from line 82, and then from the second code-set, pasting from line 45, i get the same errors :(
Here is my orig _blocklist.php code
<?php
/**
* This is the template that displays the links to the available blogs
*
* 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-2006 by Francois PLANQUE - {@link http://fplanque.net/}
*
* @package evoskins
*/
if( !defined('EVO_MAIN_INIT') ) 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>';
if(!isset($blog_list_end)) $blog_list_end = '</ul>';
# This is what will separate items in the list
if(!isset($blog_list_separator)) $blog_list_separator = '';
# 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>';
# This is the class of for the selected blog link:
if(!isset($blog_selected_link_class)) $blog_selected_link_class = '';
# This is the class of for the other blog links:
if(!isset($blog_other_link_class)) $blog_other_link_class = '';
# 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';
$blog_links = array(); // we collect all links first, to easily implode them
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;
}
$blog_link = $blog_item_start;
if( $curr_blog_ID == $blog )
{ // This is the blog being displayed on this page:
$blog_link .= '<a href="';
$blog_link .= blog_list_iteminfo('blogurl', false);
$blog_link .= '" class="'.$blog_selected_link_class.'" title="';
$blog_link .= format_to_output( blog_list_iteminfo($blog_title_param, false), 'htmlattr' );
$blog_link .= '">';
$blog_link .= $blog_selected_name_before;
$blog_link .= format_to_output( blog_list_iteminfo($blog_name_param, false ), 'htmlbody' );
$blog_link .= $blog_selected_name_after;
$blog_link .= '</a>';
}
else
{ // This is another blog:
$blog_link .= '<a href="';
$blog_link .= blog_list_iteminfo('blogurl', false);
$blog_link .= '" class="'.$blog_other_link_class.'" title="';
$blog_link .= format_to_output( blog_list_iteminfo($blog_title_param, false), 'htmlattr' );
$blog_link .= '">';
$blog_link .= $blog_other_name_before;
$blog_link .= format_to_output( blog_list_iteminfo($blog_name_param, false), 'htmlbody' );
$blog_link .= $blog_other_name_after;
$blog_link .= '</a>';
} // End of testing which blog is being displayed
$blog_link .= $blog_item_end;
$blog_links[] = $blog_link;
}
// Output:
echo $blog_list_start;
echo implode( $blog_list_separator, $blog_links );
echo $blog_list_end;
/*
nolog */
?>
I hope you can spot the trigger for the errors, cause i can't :)
Best regards
Carsten, Denmark
14 xangelusx Feb 15, 2007 04:59
Hey Carsten,
I merged my changes into your code and ended up with this:
<?php
/**
* This is the template that displays the links to the available blogs
*
* 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-2006 by Francois PLANQUE - {@link http://fplanque.net/}
*
* @package evoskins
*/
if( !defined('EVO_MAIN_INIT') ) 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>';
if(!isset($blog_list_end)) $blog_list_end = '</ul>';
# This is what will separate items in the list
if(!isset($blog_list_separator)) $blog_list_separator = '';
# 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>';
# This is the class of for the selected blog link:
if(!isset($blog_selected_link_class)) $blog_selected_link_class = '';
# This is the class of for the other blog links:
if(!isset($blog_other_link_class)) $blog_other_link_class = '';
# 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';
/**
* Custom Sorting Hack :: START
* Create an array to collect all of the blogs in. We can then easily
* sort/order and join them below.
*/
$blog_links = array();
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;
}
$blog_link = $blog_item_start;
if( $curr_blog_ID == $blog )
{ // This is the blog being displayed on this page:
$blog_link .= '<a href="';
$blog_link .= blog_list_iteminfo('blogurl', false);
$blog_link .= '" class="'.$blog_selected_link_class.'" title="';
$blog_link .= format_to_output( blog_list_iteminfo($blog_title_param, false), 'htmlattr' );
$blog_link .= '">';
$blog_link .= $blog_selected_name_before;
$blog_link .= format_to_output( blog_list_iteminfo($blog_name_param, false ), 'htmlbody' );
$blog_link .= $blog_selected_name_after;
$blog_link .= '</a>';
}
else
{ // This is another blog:
$blog_link .= '<a href="';
$blog_link .= blog_list_iteminfo('blogurl', false);
$blog_link .= '" class="'.$blog_other_link_class.'" title="';
$blog_link .= format_to_output( blog_list_iteminfo($blog_title_param, false), 'htmlattr' );
$blog_link .= '">';
$blog_link .= $blog_other_name_before;
$blog_link .= format_to_output( blog_list_iteminfo($blog_name_param, false), 'htmlbody' );
$blog_link .= $blog_other_name_after;
$blog_link .= '</a>';
} // End of testing which blog is being displayed
$blog_link .= $blog_item_end;
/**
* Custom Sorting Hack
* Use $blog_name_param as a named key for sorting later on.
*/
$blog_links[blog_list_iteminfo($blog_name_param, false )] = $blog_link;
}
/**
* Custom Sorting Hack
* Order the blogs alphabetically based on the array keys (using $blog_name_param)
*/
ksort($blog_links);
/**
* Custom Sorting Hack :: END
*/
// Output:
echo $blog_list_start;
echo implode( $blog_list_separator, $blog_links );
echo $blog_list_end;
/*
nolog */
?>
Save that over your existing _bloglist.php file (backup your original, just in case) and see what happens. There wasn't any difference between my code an yours besides the hacks I added and a few different values for some of the blog variables...
15 xangelusx Feb 15, 2007 05:01
PS: If you're still getting an error after this please View Source on the page in your browser and post the whole of the code that appears. Maybe there's a PHP error that isn't showing up, but that we can see in the code itself.
16 edb Feb 15, 2007 07:52
G'day.
I took the two files listed in one of your posts above and saved them as _bloglist_alpha_sort.php and _bloglist_custom_sort.php then called for both of them in my _main.php file wrapped in an "if is_logged_in()" thing. I get the following error displayed on my blog for each blog in the custom_sort version:
Notice: Undefined property: blog_ID in /my/blog/path/inc/MODEL/dataobjects/_dataobject.class.php on line 461
Clearly the issue isn't the named file, but after tinkering a bit I couldn't figure out how to make the custom sort version of bloglist know something that would make line 461 of the mentioned file happy. I tried booze. I tried money. I thought about trying flowers but that *never* works, so I gave up.
17 boblebad Feb 15, 2007 15:59
xangelusx wrote:
Hey Carsten,
I merged my changes into your code and ended up with this:
<?php /** * This is the template that displays the links to the available blogs * * 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-2006 by Francois PLANQUE - {@link http://fplanque.net/} * * @package evoskins */ if( !defined('EVO_MAIN_INIT') ) 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>'; if(!isset($blog_list_end)) $blog_list_end = '</ul>'; # This is what will separate items in the list if(!isset($blog_list_separator)) $blog_list_separator = ''; # 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>'; # This is the class of for the selected blog link: if(!isset($blog_selected_link_class)) $blog_selected_link_class = ''; # This is the class of for the other blog links: if(!isset($blog_other_link_class)) $blog_other_link_class = ''; # 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'; /** * Custom Sorting Hack :: START * Create an array to collect all of the blogs in. We can then easily * sort/order and join them below. */ $blog_links = array(); 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; } $blog_link = $blog_item_start; if( $curr_blog_ID == $blog ) { // This is the blog being displayed on this page: $blog_link .= '<a href="'; $blog_link .= blog_list_iteminfo('blogurl', false); $blog_link .= '" class="'.$blog_selected_link_class.'" title="'; $blog_link .= format_to_output( blog_list_iteminfo($blog_title_param, false), 'htmlattr' ); $blog_link .= '">'; $blog_link .= $blog_selected_name_before; $blog_link .= format_to_output( blog_list_iteminfo($blog_name_param, false ), 'htmlbody' ); $blog_link .= $blog_selected_name_after; $blog_link .= '</a>'; } else { // This is another blog: $blog_link .= '<a href="'; $blog_link .= blog_list_iteminfo('blogurl', false); $blog_link .= '" class="'.$blog_other_link_class.'" title="'; $blog_link .= format_to_output( blog_list_iteminfo($blog_title_param, false), 'htmlattr' ); $blog_link .= '">'; $blog_link .= $blog_other_name_before; $blog_link .= format_to_output( blog_list_iteminfo($blog_name_param, false), 'htmlbody' ); $blog_link .= $blog_other_name_after; $blog_link .= '</a>'; } // End of testing which blog is being displayed $blog_link .= $blog_item_end; /** * Custom Sorting Hack * Use $blog_name_param as a named key for sorting later on. */ $blog_links[blog_list_iteminfo($blog_name_param, false )] = $blog_link; } /** * Custom Sorting Hack * Order the blogs alphabetically based on the array keys (using $blog_name_param) */ ksort($blog_links); /** * Custom Sorting Hack :: END */ // Output: echo $blog_list_start; echo implode( $blog_list_separator, $blog_links ); echo $blog_list_end; /* nolog */ ?>
Save that over your existing _bloglist.php file (backup your original, just in case) and see what happens. There wasn't any difference between my code an yours besides the hacks I added and a few different values for some of the blog variables...
Hi xangelusx
Thanks for looking into this :)
But isen't that the code from the alpha-sort you posted...??
The alpha-sort works fine, it's the custom-sort that doesn't
Best regards
Carsten, Denmark
18 boblebad Feb 15, 2007 16:24
Hi again xangelusx
Here's my view source, from Opera 9.1
Hope i makes more sense to you than to me :)
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="da-DK" lang="da-DK">
<head>
<title>Www.KosmologiBlog.Dk</title>
<base href="http://kosmologiblog.dk/skins/custom/" /> <meta name="description" content="" />
<meta name="keywords" content="" />
<meta name="generator" content="b2evolution 1.9.2" /> <!-- Please leave this for stats -->
<link rel="alternate" type="text/xml" title="RSS 2.0" href="http://kosmologiblog.dk/index.php?blog=5&tempskin=_rss2" />
<link rel="alternate" type="application/atom+xml" title="Atom" href="http://kosmologiblog.dk/index.php?blog=5&tempskin=_atom" />
<link rel="stylesheet" href="custom.css" type="text/css" />
</head>
<body>
<div id="wrapper">
<br />
<b>Notice</b>: Undefined property: blog_ID in <b>/mounted-storage/home35b/sub002/sc10525/www/kosmologiblog.dk/inc/MODEL/dataobjects/_dataobject.class.php</b> on line <b>461</b><br />
<br />
<b>Notice</b>: Undefined property: blog_ID in <b>/mounted-storage/home35b/sub002/sc10525/www/kosmologiblog.dk/inc/MODEL/dataobjects/_dataobject.class.php</b> on line <b>461</b><br />
<br />
<b>Notice</b>: Undefined property: blog_ID in <b>/mounted-storage/home35b/sub002/sc10525/www/kosmologiblog.dk/inc/MODEL/dataobjects/_dataobject.class.php</b> on line <b>461</b><br />
<br />
<b>Notice</b>: Undefined property: blog_ID in <b>/mounted-storage/home35b/sub002/sc10525/www/kosmologiblog.dk/inc/MODEL/dataobjects/_dataobject.class.php</b> on line <b>461</b><br />
<br />
<b>Notice</b>: Undefined property: blog_ID in <b>/mounted-storage/home35b/sub002/sc10525/www/kosmologiblog.dk/inc/MODEL/dataobjects/_dataobject.class.php</b> on line <b>461</b><br />
<br />
<b>Notice</b>: Undefined property: blog_ID in <b>/mounted-storage/home35b/sub002/sc10525/www/kosmologiblog.dk/inc/MODEL/dataobjects/_dataobject.class.php</b> on line <b>461</b><br />
<br />
<b>Notice</b>: Undefined property: blog_ID in <b>/mounted-storage/home35b/sub002/sc10525/www/kosmologiblog.dk/inc/MODEL/dataobjects/_dataobject.class.php</b> on line <b>461</b><br />
<ul id="bloglist"><li><a href="http://kosmologiblog.dk/index.php?blog=7" class="BlogButton" title="Carsten's Blog"><span>Carsten</span></a></li>
</ul>
<div class="pageHeader">
<h1 id="pageTitle"><a href="http://kosmologiblog.dk/index.php?blog=5">Www.KosmologiBlog.Dk</a></h1>
<div class="pageSubtitle"></div>
</div>
<div class="bPosts">
<!-- =================================== START OF MAIN AREA =================================== -->
<div class="action_messages"></div>
<h2>14/02/07</h2>
<div class="bPost bPostpublished" lang="da-DK">
<div class="bSmallHead">
<a href="http://kosmologiblog.dk/index.php?blog=5&title=www_kosmologiblog_dk&more=1&c=1&tb=1&pb=1" title="Permanent link to full entry"><img src="http://kosmologiblog.dk/rsc/icons/minipost.gif" border="0" align="top" width="12" height="9" class="middle" alt="Permalink"/></a> 11:54:53, by <strong>admin</strong> <a href="http://kosmologiblog.dk/index.php?blog=5&disp=msgform&recipient_id=1&post_id=24&redirect_to=%2Findex.php%3Fblog%3D5%26page%3D1" title="Send email to post author"><img src="http://kosmologiblog.dk/rsc/icons/envelope.gif" border="0" align="top" width="13" height="10" class="middle" title="Send email to post author" alt="Email"/></a> , 171 words, No views <img src="http://kosmologiblog.dk/rsc/flags/h10px/dk.gif" alt="Danish (DK)" class="flag" /> <br /> Categories: <strong><a href="http://kosmologiblog.dk/index.php?blog=5&cat=14" title="Browse category">Admin [A]</a></strong> </div>
<h3 class="bTitle">Www.KosmologiBlog.Dk</h3>
<div class="bText">
<p><b>Hejsa og velkommen</b></p>
<p>Dette er så stedet hvor du <b>gratis</b> kan oprette <b>din egen kosmologiske udviklings-blog</b> og fortælle hvordan dit møde med Martinus og kosmologien var, fortælle om hvor du udviklingsmæssigt set kommer fra, hvor du er lige nu og hvad det indebærer for dig, og hvor du er på vej hen.</p>
<p>Det er selvfølgelig helt op til dig selv hvor meget, eller hvor lidt du vil skrive - men vi er selvfølgelig alle interesseret i at høre så meget som muligt om andres erfaringer, så vi kan lære af dem og ikke begå de samme fejl.</p>
<p>Så opfordringen er klart herfra at fortælle så meget som muligt :)</p>
<p>Vi ligger selv ud med vores egne Blog's, henholdsvis Ann & Carsten, hvor vi vil fortælle om vores liv, vores udvikling, de ting vi har oplevet og hvad det har lært os - og selvfølgelig hvor vi er nu, og hvor vi er på vej hen.</p>
<p>Så endnu en gang hjertelig velkommen :)</p> </div>
<div class="bSmallPrint">
<a href="http://kosmologiblog.dk/index.php?blog=5&title=www_kosmologiblog_dk&more=1&c=1&tb=1&pb=1" title="Permanent link to full entry" class="permalink_right"><img src="http://kosmologiblog.dk/rsc/icons/minipost.gif" border="0" align="top" width="12" height="9" class="middle" alt="Permalink"/>Permalink</a>
<a href="http://kosmologiblog.dk/index.php?blog=5&title=www_kosmologiblog_dk&more=1&c=1&tb=1&pb=1#comments" title="Display comments / Leave a comment">Leave a comment</a> • <a href="http://kosmologiblog.dk/index.php?blog=5&title=www_kosmologiblog_dk&more=1&c=1&tb=1&pb=1#trackbacks" title="Display trackbacks / Get trackback address for this post">Trackback (0)</a> • <a href="http://kosmologiblog.dk/admin.php?ctrl=edit&action=edit&post=24" title="Edit this post..."><img src="http://kosmologiblog.dk/rsc/icons/edit.gif" border="0" align="top" width="16" height="15" class="middle" alt="Edit"/> Edit...</a>
<!--
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
<rdf:Description
rdf:about="http://kosmologiblog.dk/index.php?blog=5&title=www_kosmologiblog_dk&more=1&c=1&tb=1&pb=1"
dc:identifier="http://kosmologiblog.dk/index.php?blog=5&title=www_kosmologiblog_dk&more=1&c=1&tb=1&pb=1"
dc:title="Www.KosmologiBlog.Dk"
trackback:ping="http://kosmologiblog.dk/htsrv/trackback.php?tb_id=24" />
</rdf:RDF>-->
</div>
</div>
<p class="center"><strong>
</strong></p>
</div>
<!-- =================================== START OF SIDEBAR =================================== -->
<div class="bSideBar">
<div class="bSideItem">
<h3>Www.KosmologiBlog.Dk</h3>
<p></p>
<p class="center"><strong></strong></p>
<ul>
<!-- <li><a href="http://kosmologiblog.dk/index.php?blog=5"><strong>Recently</strong></a> <span class="dimmed">(cached)</span></li> -->
<li><a href="http://kosmologiblog.dk/index.php?blog=5"><strong>Recently</strong></a> <!-- <span class="dimmed">(no cache)</span> --></li>
<li><a href="http://kosmologiblog.dk/index.php?blog=5&disp=comments"><strong>Last comments</strong></a></li>
</ul>
<table class="bCalendarTable" cellspacing="0" summary="Monthly calendar with links to each day's posts">
<caption class="bCalendarCaption"><a href="http://kosmologiblog.dk/index.php?blog=5&m=200702" title="go to month's archive">February 2007</a></caption>
<thead><tr class="bCalendarRow">
<th class="bCalendarHeaderCell" abbr="Monday" scope="col" title="Monday">Mon</th>
<th class="bCalendarHeaderCell" abbr="Tuesday" scope="col" title="Tuesday">Tue</th>
<th class="bCalendarHeaderCell" abbr="Wednesday" scope="col" title="Wednesday">Wed</th>
<th class="bCalendarHeaderCell" abbr="Thursday" scope="col" title="Thursday">Thu</th>
<th class="bCalendarHeaderCell" abbr="Friday" scope="col" title="Friday">Fri</th>
<th class="bCalendarHeaderCell" abbr="Saturday" scope="col" title="Saturday">Sat</th>
<th class="bCalendarHeaderCell" abbr="Sunday" scope="col" title="Sunday">Sun</th>
</tr></thead>
<tfoot>
<tr>
<td colspan="3" id="prev"> <a href="http://kosmologiblog.dk/index.php?blog=5&m=200602" title="Previous year (2006-02)"><<</a> <a href="http://kosmologiblog.dk/index.php?blog=5&m=200701" title="Previous month (2007-01)"><</a></td>
<td class="pad"> </td>
<td colspan="3" id="next"><a href="http://kosmologiblog.dk/index.php?blog=5&m=200703" title="Next month (2007-03)">></a> <a href="http://kosmologiblog.dk/index.php?blog=5&m=200802" title="Next year (2008-02)">>></a></td>
</tr>
</tfoot>
<tr class="bCalendarRow">
<td class="bCalendarEmptyCell"> </td>
<td class="bCalendarEmptyCell"> </td>
<td class="bCalendarEmptyCell"> </td>
<td class="bCalendarCell">1</td>
<td class="bCalendarCell">2</td>
<td class="bCalendarCell">3</td>
<td class="bCalendarCell">4</td>
</tr>
<tr class="bCalendarRow">
<td class="bCalendarCell">5</td>
<td class="bCalendarCell">6</td>
<td class="bCalendarCell">7</td>
<td class="bCalendarCell">8</td>
<td class="bCalendarCell">9</td>
<td class="bCalendarCell">10</td>
<td class="bCalendarCell">11</td>
</tr>
<tr class="bCalendarRow">
<td class="bCalendarCell">12</td>
<td class="bCalendarCell">13</td>
<td class="bCalendarLinkPost"><a href="http://kosmologiblog.dk/index.php?blog=5&m=20070214" title="1 post">14</a></td>
<td id="bCalendarToday">15</td>
<td class="bCalendarCell">16</td>
<td class="bCalendarCell">17</td>
<td class="bCalendarCell">18</td>
</tr>
<tr class="bCalendarRow">
<td class="bCalendarCell">19</td>
<td class="bCalendarCell">20</td>
<td class="bCalendarCell">21</td>
<td class="bCalendarCell">22</td>
<td class="bCalendarCell">23</td>
<td class="bCalendarCell">24</td>
<td class="bCalendarCell">25</td>
</tr>
<tr class="bCalendarRow">
<td class="bCalendarCell">26</td>
<td class="bCalendarCell">27</td>
<td class="bCalendarCell">28</td>
<td class="bCalendarEmptyCell"> </td>
<td class="bCalendarEmptyCell"> </td>
<td class="bCalendarEmptyCell"> </td>
<td class="bCalendarEmptyCell"> </td>
</tr>
</table> </div>
<div class="bSideItem">
<h3 class="sideItemTitle">Search</h3>
<form action="http://kosmologiblog.dk/index.php" method="get" class="search"><div><input type="hidden" name="blog" value="5" /></div> <p><input type="text" name="s" size="30" value="" class="SearchField" /><br />
<input type="radio" name="sentence" value="AND" id="sentAND" checked="checked" /><label for="sentAND">All Words</label><br />
<input type="radio" name="sentence" value="OR" id="sentOR" /><label for="sentOR">Some Word</label><br />
<input type="radio" name="sentence" value="sentence" id="sentence" /><label for="sentence">Entire phrase</label></p>
<input type="submit" name="submit" class="submit" value="Search" />
</form>
</div>
<div class="bSideItem"><h3>Categories</h3><ul><li><a href="http://kosmologiblog.dk/index.php?blog=5">All</a></li>
<li><a href="http://kosmologiblog.dk/index.php?blog=5&cat=14">Admin [A]</a> <span class="notes">(1)</span></li>
</ul>
</div>
<div class="bSideItem"><h3>Archives</h3><ul><li><a href="http://kosmologiblog.dk/index.php?blog=5&m=200702">February 2007</a> <span class="dimmed">(1)</span></li>
<li><a href="http://kosmologiblog.dk/index.php?blog=5&disp=arcdir">More...</a></li>
</ul>
</div>
<div class="bSideItem">
<h3>Misc</h3>
<ul>
<li><a href="http://kosmologiblog.dk/admin.php?blog=5" title="Go to the back-office">Admin</a></li><li><a href="http://kosmologiblog.dk/index.php?blog=5&disp=profile&redirect_to=%2Findex.php%3Fblog%3D5%26page%3D1" title="Edit your profile">Profile (admin)</a></li><li><a href="http://kosmologiblog.dk/index.php?blog=5&disp=subs&redirect_to=%2Findex.php%3Fblog%3D5%26page%3D1" title="Subscribe to email notifications">Subscribe (admin)</a></li><li><a href="http://kosmologiblog.dk/htsrv/login.php?action=logout&redirect_to=%2Findex.php%3Fblog%3D5%26page%3D1" title="Logout from your account">Logout (admin)</a></li> </ul>
</div>
<div class="bSideItem">
<h3><img src="http://kosmologiblog.dk/rsc/icons/feed-icon-16x16.gif" width="16" height="16" class="top" alt="" /> XML Feeds</h3>
<ul>
<li>
RSS 0.92:
<a href="http://kosmologiblog.dk/index.php?blog=5&tempskin=_rss">Posts</a>,
<a href="http://kosmologiblog.dk/index.php?blog=5&tempskin=_rss&disp=comments">Comments</a>
</li>
<li>
RSS 1.0:
<a href="http://kosmologiblog.dk/index.php?blog=5&tempskin=_rdf">Posts</a>,
<a href="http://kosmologiblog.dk/index.php?blog=5&tempskin=_rdf&disp=comments">Comments</a>
</li>
<li>
RSS 2.0:
<a href="http://kosmologiblog.dk/index.php?blog=5&tempskin=_rss2">Posts</a>,
<a href="http://kosmologiblog.dk/index.php?blog=5&tempskin=_rss2&disp=comments">Comments</a>
</li>
<li>
Atom:
<a href="http://kosmologiblog.dk/index.php?blog=5&tempskin=_atom">Posts</a>,
<a href="http://kosmologiblog.dk/index.php?blog=5&tempskin=_atom&disp=comments">Comments</a>
</li>
</ul>
<a href="http://webreference.fr/2006/08/30/rss_atom_xml" title="External - English">What is RSS?</a>
</div>
<div class="bSideItem">
<h3 class="sideItemTitle">Who's Online?</h3>
<ul class="onlineUsers"><li>Guest Users: 2</li></ul> </div>
<p class="center">powered by<br />
<a href="http://b2evolution.net/" title="b2evolution home"><img src="http://kosmologiblog.dk/rsc/img/b2evolution_logo_80.gif" alt="b2evolution" width="80" height="17" border="0" class="middle" /></a></p>
</div>
<div id="pageFooter">
<p class="baseline">
<a href="http://kosmologiblog.dk/index.php?blog=5&disp=msgform&recipient_id=1&redirect_to=%2Findex.php%3Fblog%3D5%26page%3D1">Contact the admin</a>.
Original template design by <a href="http://fplanque.net/">François PLANQUE</a> / <a href="http://skinfaktory.com/">The Skin Faktory</a>.
Credits: <a href="http://b2evolution.net/">blog tool</a> | <a href="http://evocore.net/">framework</a> | <a href="http://b2evolution.net/about/recommended-hosting-lamp-best-choices.php">hosting</a> </p>
</div>
</div>
</body>
</html>
Best regards
Carsten, Denmark
19 boblebad Feb 15, 2007 18:47
Hi again xangelusx
I found the problem, the "blog_ID" does not exist, the correct name is just "ID", that does the trick :)
$blog_links[blog_list_iteminfo('blog_ID', false )] = $blog_link;
Should be
$blog_links[blog_list_iteminfo('ID', false )] = $blog_link;
Without the "blog_" - it's in line 85
Now it works perfect, i wasen't that stupid at all, i guess - LOL
Have a great day
Best regards
Carsten, Denmark
20 edb Feb 15, 2007 20:15
Thanks Boblebad! I poked around with it in various places EXCEPT the one that would actually fix the problem. (BTW I think this is version-specific. I *think* it worked the other way in 1.8.* installations, but obviously wouldn't work in 1.9.* installations.)
21 xangelusx Feb 15, 2007 20:28
Thanks for the correction Carsten. I think EdB is correct, but I think it might even be a difference between 1.9.1 and 1.9.2. :) I'm still running 1.9.1, so I didn't catch it. Glad you got it working though! (And sorry for the mix up with the alpha vs custom sort, I wasn't sure which one you meant)
22 boblebad Feb 15, 2007 21:20
Hi again
Yep, that has crossed my mind too, that it had something to do with 1.9.2, cause others who uses older versions don't have the problem...
But then i have to ask, is it a good thing to change something like that when sending out a new version, it could give alot of problems when you're going to fiddle with the skins
It must also be confusing for developer/supporter, like now, trying to figure what's going wrong, and then it's because of a change of "blog_ID" to "ID", i don't remember what it's called, is it a tag, label or class, or 4. thing, sorry, i'm not that good at php :(
Now, i'm on to putting SMF to the site :)
Ehh, not exactly to that site, but another one like it www.kosmologinet.dk where i need a discussion forum, for questions aso.
Lets see what fun pops up there :)
Thanks for putting time into this :)
Btw, maybe it would be a good idea to put the changes in the post that contains the codes..
Best regards
Carsten, Denmark
23 edb Feb 16, 2007 20:28
Seems I spoke too soon. Currently I get NOTHING from the custom sorted version of this. That'd be after changing blog_ID to ID. The alphabetical sort works though so that's cool.
24 boblebad Feb 16, 2007 21:22
Hi EdB
Here's my code from _bloglist.php that works on b2evo 1.9.2
<?php
/**
* This is the template that displays the links to the available blogs
*
* 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-2006 by Francois PLANQUE - {@link http://fplanque.net/}
*
* @package evoskins
*/
if( !defined('EVO_MAIN_INIT') ) 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>';
if(!isset($blog_list_end)) $blog_list_end = '</ul>';
# This is what will separate items in the list
if(!isset($blog_list_separator)) $blog_list_separator = '';
# 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>';
# This is the class of for the selected blog link:
if(!isset($blog_selected_link_class)) $blog_selected_link_class = '';
# This is the class of for the other blog links:
if(!isset($blog_other_link_class)) $blog_other_link_class = '';
# 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';
$blog_links = array(); // we collect all links first, to easily implode them
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;
}
$blog_link = $blog_item_start;
if( $curr_blog_ID == $blog )
{ // This is the blog being displayed on this page:
$blog_link .= '<a href="';
$blog_link .= blog_list_iteminfo('blogurl', false);
$blog_link .= '" class="'.$blog_selected_link_class.'" title="';
$blog_link .= format_to_output( blog_list_iteminfo($blog_title_param, false), 'htmlattr' );
$blog_link .= '">';
$blog_link .= $blog_selected_name_before;
$blog_link .= format_to_output( blog_list_iteminfo($blog_name_param, false ), 'htmlbody' );
$blog_link .= $blog_selected_name_after;
$blog_link .= '</a>';
}
else
{ // This is another blog:
$blog_link .= '<a href="';
$blog_link .= blog_list_iteminfo('blogurl', false);
$blog_link .= '" class="'.$blog_other_link_class.'" title="';
$blog_link .= format_to_output( blog_list_iteminfo($blog_title_param, false), 'htmlattr' );
$blog_link .= '">';
$blog_link .= $blog_other_name_before;
$blog_link .= format_to_output( blog_list_iteminfo($blog_name_param, false), 'htmlbody' );
$blog_link .= $blog_other_name_after;
$blog_link .= '</a>';
} // End of testing which blog is being displayed
$blog_link .= $blog_item_end;
//use blog_ID as a numeric key for custom sorting later on.
// We could also use $blog_name_param in place of 'blog_ID' but the ID is a
// safer value as the name of a blog is more likely to change over time.
$blog_links[blog_list_iteminfo('ID', false )] = $blog_link;
}
//Custom blog sorting
// Create new array to work with
$sorted_blog_links = array();
// Add a few blogs in custom order based on the key used above (use isset to prevent errors in case a
// blog is not available. We also want to unset/remove the sorted blog from the original array.
if (isset($blog_links['1'])) { $sorted_blog_links[] = $blog_links['1']; unset($blog_links['1']); }
if (isset($blog_links['5'])) { $sorted_blog_links[] = $blog_links['5']; unset($blog_links['5']); }
if (isset($blog_links['6'])) { $sorted_blog_links[] = $blog_links['6']; unset($blog_links['6']); }
if (isset($blog_links['7'])) { $sorted_blog_links[] = $blog_links['7']; unset($blog_links['7']); }
if (isset($blog_links['4'])) { $sorted_blog_links[] = $blog_links['4']; unset($blog_links['4']); }
if (isset($blog_links['2'])) { $sorted_blog_links[] = $blog_links['2']; unset($blog_links['2']); }
if (isset($blog_links['3'])) { $sorted_blog_links[] = $blog_links['3']; unset($blog_links['3']); }
// If there are any blogs remaining in $blog_links then add them to the end off the sorted blog list
// This prevents new blogs from going missing if they haven't been added to the above list yet.
if (sizeof($blog_links)) {
$sorted_blog_links = $sorted_blog_links + $blog_links;
//clean up old blog_links
unset($blog_links);
}
// Output:
echo $blog_list_start;
echo implode( $blog_list_separator, $sorted_blog_links );
echo $blog_list_end;
/*
nolog */
?>
Best regards
Carsten, Denmark
25 edb Feb 16, 2007 21:39
Hooray! I didn't look at what was different between what I had and what you posted, but yours worked so mine's gone. This is a really good hack. Anyone mind if I summarize it as a new post over in the plugins and hacks forum? We'd have to warn users about the 1.9.1 versus 1.9.2 thing, but that shouldn't be too big a deal.
26 xangelusx Feb 16, 2007 23:37
Please do! Thanks!
Hi Colleen, The only way that I know of to renumber your blogs is to do so directly in the database, though just changing the blog ID would break your categories, posts, etc. I'm not sure how far you're willing to go for this, but unless you are very comfortable working in a database and working with foreign keys then I would suggest *not* doing so.
If you just want to list them alphabetically then you could change /skins/_bloglist.php to this:
You could take this a step further and order them in specific order by doing something like this:
In both cases, my changes start on line 82 of the original file as of b2evolution version 1.8.5.
Good luck!