Bug in serendipity_event_entrypaging?

Creating and modifying plugins.
Post Reply
yellowled
Regular
Posts: 7111
Joined: Fri Jan 13, 2006 11:46 am
Location: Eutin, Germany
Contact:

Bug in serendipity_event_entrypaging?

Post by yellowled »

I just stumbled across what I assume to be a bug in the entrypaging plugin:

Code: Select all

if ($link = $this->makeLink($prevID, 'prev')) {
$links[] = '<span class="serendipity_entrypaging_left">< ' . $link . '</span>';
}

if ($link = $this->makeLink($nextID, 'next')) {
$links[] = '<span class="serendipity_entrypaging_left">' . $link . ' ></span>';
}
First of all, both links are assigned to the same class which makes it pretty much impossible to style them individually (which I'm trying to do in a new template). Second, these should be ids instead of classes in my humble opinion. Third (while I'm bitching :wink:), it would be great if the hard coded arrows would be put into additional spans or something so they could be hidden using CSS. Same for the dividing |. This code really makes it hard to style the entrypaging.

Suggested code:

Code: Select all

<div id="serendipity_entrypaging">
<span id="serendipity_entrypaging_previous"><span id="serendipity_entrypaging_prevarrow">< </span>$link</span>
<span id="serendipity_entrypaging_divider"> | </span>
<span id="serendipity_entrypaging_next">$link<span id="serendipity_entrypaging_nextarrow"> ></span></span>
</div>
I'm aware that this is a minor plugin. I'm also aware that this code isn't exactly lean, but I'd still like to see those code changes since the code above at least a) is much more semantic and b) makes it much easier to style the entrypaging.

YL
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Bug in serendipity_event_entrypaging?

Post by garvinhicking »

Hi!

1. Fixed the bad class.

2. I disagree, classes would be better, because it MIGHt happen that this output happens twice or more times on a page. It doesn't hurt with a class, so I leave it that way.

3. Adjusted, used 'epicon' class for that, I just a short version to not bloat the code so terribly much.

Best regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
yellowled
Regular
Posts: 7111
Joined: Fri Jan 13, 2006 11:46 am
Location: Eutin, Germany
Contact:

Re: Bug in serendipity_event_entrypaging?

Post by yellowled »

garvinhicking wrote:2. I disagree, classes would be better, because it MIGHt happen that this output happens twice or more times on a page. It doesn't hurt with a class, so I leave it that way.
I can live with classes, but out of sheer curiosity: In what scenario is that supposed to happen? When users install the entrypaging plugin twice?

Thanks for fixing it, you'll very soon see some benefit as far as I can see :)

YL
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Bug in serendipity_event_entrypaging?

Post by garvinhicking »

Hi!
yellowled wrote:
garvinhicking wrote:2. I disagree, classes would be better, because it MIGHt happen that this output happens twice or more times on a page. It doesn't hurt with a class, so I leave it that way.
I can live with classes, but out of sheer curiosity: In what scenario is that supposed to happen? When users install the entrypaging plugin twice?
No, but if you use stacked templates or layouts where two extended entry views are placed, like a 2-column layout. It can happen with any case where multiple serendipity_Fetchentry() calls are issued.

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
judebert
Regular
Posts: 2478
Joined: Sat Oct 15, 2005 6:57 am
Location: Orlando, FL
Contact:

Post by judebert »

I think it happens with newsboxes, too. Each newsbox includes prev/next links for its own categories.
Judebert
---
Website | Wishlist | PayPal
Post Reply