1 balupton Nov 06, 2006 10:55
3 balupton Nov 06, 2006 18:55
line 2963,of /blogs/inc/_misc/_misc.funcs.php ( figured you would know how to search multiple files for 'function display_list' EdB ;) )
/**
* Display an array as a list:
*/
function display_list( $items, $list_start = '<ul>', $list_end = '<ul>', $item_separator = '', $item_start = '<li>', $item_end = '</li>' )
{
if( !empty( $items ) )
{
echo $list_start;
$first = true;
foreach( $items as $item )
{
if( $first )
{
$first = false;
}
else
{
echo $item_separator;
}
echo $item_start;
if( is_array( $item ) )
{
echo '<a href="'.$item[0].'">'.$item[1].'</a></li>';
}
else
{
echo $item;
}
echo $item_end;
}
echo $list_end;
}
}
As you can see, if the user wants to output them with <li>s it is done via $item_end; so the above would cause a excess </li> when $list_end = '</li>', as well as a uneeded </li> when users don't even want to display it with li tags.
4 edb Nov 06, 2006 23:34
Cool. I was either being lazy or helpful to those unhip to groovy search tools. BTW Agent Ransack has become one of my favorite utilities.
5 balupton Nov 07, 2006 00:34
;) Yeh it was mine as well, until blueyed told me that dreamweaver has the feature inbuilt 8|
6 edb Nov 07, 2006 00:55
Yup, until my computer with my "free trial forever" copy blew up :(
7 yabba Nov 07, 2006 09:16
It has more errors than that. :-
function display_list( $items, $list_start = '<ul>', $list_end = '<ul>'
[url=http://forums.b2evolution.net/viewtopic.php?t=8959]This post[/url] has a corrected version in it and it's already been cured in 1.8.5 ;)
¥
8 edb Nov 07, 2006 09:31
I'll be darned. I knew there was a previous case of an extra li and /li, but I kinda thought this was another one. Oh well eh?
In what path/to/what/file will I find this undesirable /li tag, and do you know where it's opener is so that one bug squash won't generate another?