pixeline
Thu 7 December 2006, 09:50 pm GMT +0200
using the nice My Pagina script, i wanted simple back/next buttons (no direct link to a page).
It works fine, except that it was printing the "previous page" image even on page 0, and the "next page" image even on the last page.
this simple modification took care of removing it:
i hope it helps. Maybe it would be nice to include it in the next version :)
cheers,
Alex
It works fine, except that it was printing the "previous page" image even on page 0, and the "next page" image even on the last page.
this simple modification took care of removing it:
Code:
if ($all_pages >= 1) {
$forward = $curr_pages + 1;
$backward = $curr_pages - 1;
// the text two labels are new sinds ver 1.02
// PIXELINE HACK TO HIDE UNNECESSARY NEXT/PREV LINKS
if ($backward > -1) {
$lbl_backward = $this->build_back_or_forward("backward", $use_images);
}
if ($curr_pages < $all_pages) {
$lbl_forward = $this->build_back_or_forward("forward", $use_images);
}
// END HACK
$navi_string = ($curr_pages > 0) ? "<a href=\"" . $_SERVER['PHP_SELF'] . "?" . $var . "=" . $backward . $this->rebuild_qs($var) . "\">" . $lbl_backward . "</a> " : $lbl_backward . " ";
$forward = $curr_pages + 1;
$backward = $curr_pages - 1;
// the text two labels are new sinds ver 1.02
// PIXELINE HACK TO HIDE UNNECESSARY NEXT/PREV LINKS
if ($backward > -1) {
$lbl_backward = $this->build_back_or_forward("backward", $use_images);
}
if ($curr_pages < $all_pages) {
$lbl_forward = $this->build_back_or_forward("forward", $use_images);
}
// END HACK
$navi_string = ($curr_pages > 0) ? "<a href=\"" . $_SERVER['PHP_SELF'] . "?" . $var . "=" . $backward . $this->rebuild_qs($var) . "\">" . $lbl_backward . "</a> " : $lbl_backward . " ";
i hope it helps. Maybe it would be nice to include it in the next version :)
cheers,
Alex