Pager for Planet Feeds

Bug #672425 reported by Michael Lustfield on 2010-11-08
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
UD Planet
Wishlist
Pierre Buyle

Bug Description

Please can you put a pager in the buttom of post list to display more post and a number of post we want per page?
Thanks

Related branches

Changed in ubuntu-drupal-planet:
importance: Undecided → Wishlist

After looking into it - this does seem to be possible. I'm hoping to keep this a dead simple addition.. We'll see.

Changed in ubuntu-drupal-planet:
assignee: nobody → Michael Lustfield (mtecknology)
status: New → In Progress

This has been added in r65. Please review it for any bugs and let me know what you think.

Changed in ubuntu-drupal-planet:
status: In Progress → Fix Committed
Wilfried Tozan (noxprime) wrote :

Hi! Please give the download link to test the pager in Ubuntu Drupal Planet

summary: - Pager for Planet Feers
+ Pager for Planet Feeds
Wilfried Tozan (noxprime) wrote :

hi! The r65 Lately i saw in the Bazaar. I Tested The pager Some bugs and i saw That I fixed someones.

1. After activating the "Pager Setting", the pager appears at the bottom of the page but also all feeds items.

2. Links of pager's elements does not work well, specially for website which clean urls is disable. $base_path variable is the cause.

Correction proposal

function theme_page_udplanet_pager($pages, $selected) {
  global $base_path;
  global $conf;

  $site_url = $base_path;

  if ($conf['clean_url'] == 0) { $site_url.='?q='; };

  if ($selected == 0) {
    $selected = 1;
  }

  $pages = udtheme_real_max_pages($pages);

  $page_down = ($selected - 1 <= 1) ? 1 : $selected - 1;
  $page_up = ($selected + 1 >= $pages) ? $pages : $selected + 1;

  $output = '<div id="udplanet-pager"><ul>';
  $output .= ' <li class="pager-first"><a href="' . $site_url . 'planet"><span>&lt;&lt;</span></a></li>';
  $output .= ' <li class="pager-previous"><a href="' . $site_url. 'planet/' . $page_down . '"><span>&lt;</span></a></li>';
  for ($i = 1; $i <= $pages; $i++) {
    $output .= '<li class="pager-item pager-item-' . $i . '"><a href="' . $site_url . 'planet/' . $i . '"><span>' . $i . '</span></a></li>';
  }
  $output .= ' <li class="pager-next"><a href="' . $site_url . 'planet/' . $page_up . '"><span>&gt;</span></a></li>';
  $output .= ' <li class="pager-last"><a href="' . $site_url . 'planet/' . $pages . '"><span>&gt;&gt;</span></a></li>';
  $output .= '</ul></div>';

  return $output;
}

Is there any chance you could make a patch for the changes to make it easier
for me to make sure I get your solution committed correctly?

Wilfried Tozan (noxprime) wrote :

I don't how to make a patch but I can give you the file that I modified

Pierre Buyle (mongolito404) wrote :

Ok, I've been looking at this issue since I'm finally trying to get the latest UD Planet to my site.

There is a lot of pager helper in Drupal that should make thing easier but none of them is used in the module for now. I'll have a look at it ot use the pager helpers function this should fix everything.

Changed in ubuntu-drupal-planet:
assignee: Michael Lustfield (mtecknology) → Pierre Buyle (mongolito404)
status: Fix Committed → In Progress
Pierre Buyle (mongolito404) wrote :
Changed in ubuntu-drupal-planet:
status: In Progress → Fix Committed
Wilfried Tozan (noxprime) wrote :

Great !! Awesome !!

Wilfried Tozan (noxprime) wrote :

I did some modification on 3 files to improve pager display. I attached the files in a archive

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Related questions