Recent Topics

1 Aug 19, 2006 09:17    

No opening / closing ul and no opening li's at all

<p class="baseline">Credits:  <a href="http://b2evolution.net/">b2evo</a></li> | <a href="http://evocore.net/">evoCore</a></li> | <a href="http://plusjamaisseul.net/">seule</a></li>


Is it fixed by altering the following...?

display_list( $sponsored_links, T_('Credits').': ', ' ', '|', ' ', ' ' );

2 Aug 19, 2006 09:55

That should be the line to fix the problem, but the way it's written it shouldn't be a problem! The "/li" you've found is the default value for the last parameter. In the code you copied it should have been replaced with a space, but obviously that isn't happening. Funny thing is the second to last parameter would have been the "li" part. It, for some reason, is being replaced by an empty space. Go figure.

As I looked at that I wondered why '#' wasn't used to indicate 'default value' since that's a common thing in b2evolution, but I figured it's new so I won't worry. Or check. Thanks for checking :-/

Dig this. Try replacing the last parameter with the official code for a blank space. Instead of , ' ' ) try , '&nbsp;' ) and see what you get.

I just tweaked 15 skins based on "it's okay" and you go and post this...

4 Aug 19, 2006 10:09

This is the function call (complete with invalid parameters!):-

function display_list( $items, $list_start = '<ul>', $list_end = '<ul>', $item_separator = '', $item_start = '<li>', $item_end = '</li>' )

Try changing your call to :-

display_list( $sponsored_links, T_('Credits' ).' : <ul>','</ul>', '','<li>', '</li>' )

¥

5 Aug 19, 2006 10:19

Thanks ¥åßßå
Now I just have to set a class for it as it's a horizontal list :)

At least it's now valid

7 Aug 19, 2006 11:54

Ummmm... still a problem as it now gives 2 closing li's for each list item

<ul><li><a href="http://b2evolution.net/">b2evo</a></li></li>

8 Aug 19, 2006 12:13

This validates and works

display_list( $sponsored_links, T_(' ' ).'<ul>','</ul>', '','<li>', ' ' )

However the the base code really does need fixing.

9 Aug 19, 2006 12:22

oops, there's an (another) error in inc/misc/_misc.funcs.php function display_list() (near the bottom of the file)

				echo '<a href="'.$item[0].'">'.$item[1].'</a></li>';

It shouldn't have the </li> in there

¥

10 Aug 19, 2006 12:27

yep, I would call it a bug :)

In fact, it illustrates a real problem with generated stuff even if the structure is right. Not being able to add TITLE tooltips on links like this is dumb. The Category list is the same.

11 Aug 20, 2006 04:30

So, should I patch the "function" files so the default works in main.php or wait for an official patch?

12 Aug 20, 2006 09:50

I'd change the function to :-

/**
 * 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>';
			}
			else
			{
				echo $item;
			}
			echo $item_end;
		}
		echo $list_end;
	}
}

¥

13 Aug 20, 2006 10:09

Thanks ¥åßßå ... it fixes the markup and works a treat.

14 Aug 25, 2006 11:01

John wrote:

Not being able to add TITLE tooltips on links like this is dumb.

I found a cheat ;)

$sponsored_links = array(
	array( 'http://b2evolution.net/" title="get a real blog', 'b2evo' ),
	array( 'http://evocore.net/" title="the power under the hood', 'evoCore' ),
  );

¥

16 Aug 25, 2006 17:08

¥åßßå wrote:

I found a cheat ;)

Nice!

17 Sep 15, 2006 19:00

Thanks for the fix ¥ - I ran into this this morning and your fix worked.

Do you know if this has been patched in the development version?


Form is loading...