Design changes in entrypaging-Plugin

Creating and modifying plugins.
Post Reply
g00dman
Regular
Posts: 11
Joined: Sat Oct 22, 2005 11:57 pm
Contact:

Design changes in entrypaging-Plugin

Post by g00dman »

Hi folks.

I really liked the entrypaging-plugin, but I disliked the fact that the two links were always shown directly centered at the page.
I modified the plugin just a bit to change this: Now the link to the previous page is shown on the left margin and the link to the next page is shown on the right margin.
If you want to have a look at the new look of the plugin, visit my (german) Blog: http://www.fabianonline.de

Attention: The changed plugin is working fine for me. I successfully tested it with Opera, Firefox and Internet Explorer. I'm quite sure there are some things to optimize... but it's working for me. But I can't guarantee that it will be working for you as well. Try it, if you want, but make a backup of the file before you change it :wink:

The file needed to change is "\plugins\serendipity_event_entrypaging\serendipity_event_entrypaging.php".

At line ~104 remove

Code: Select all

text-align: center;
At line ~183 replace

Code: Select all

$links[] = '< ' . $link;
by
$prevLink = '< ' . $link;
At line ~187 replace

Code: Select all

$links[] = $link . ' >';
by
$nextLink = $link . ' >';
At line ~192 replace

Code: Select all

echo '<div class="serendipity_entrypaging">' . $randomlink . implode(' | ', $links) . '</div>';
by
echo '<div style="float: left;">' . $prevLink . ' </div><div style="text-align: right;"> '. $nextLink . '</div>';
At line ~194 replace

Code: Select all

$eventData[0]['add_footer'] .= sprintf('</div><div class="serendipity_entrypaging">' . $randomlink . implode(' | ', $links) . '</div><div>');
by
$eventData[0]['add_footer'] .= sprintf('</div><div style="float: left;">' . $prevLink . ' </div><div style="text-align: right;"> '. $nextLink . '</div><div>');
Perhaps it's possible to add this design into the plugin via a dropdown-list or something... I'm sorry, but I don't have enough time to do this myself.
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Design changes in entrypaging-Plugin

Post by garvinhicking »

Hi!

Thanks a lot for your contribution! I decided to add this a bit differenty, so that you can do it all with CSS design.

In your style.css, just insert those items with the new plugin:

Code: Select all

.serendipity_entrypaging {
  text-align: left;
}

.serendipity_entrypaging_left {
  display: block;
  float: left;
}

.serendipity_entrypaging_right {
  display: block;
  text-align: right
}
(This is not tested, but it should basically work)

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/
Post Reply