Comment 4 for bug 672425

Revision history for this message
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;
}