Sublime directory Surf the web anonymous Pagerank Monitor


My pagina script: mod to hide unnecessary previous / next links

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:

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>&nbsp;" : $lbl_backward . "&nbsp;";

i hope it helps. Maybe it would be nice to include it in the next version :)

cheers,

Alex

olaf
Thu 7 December 2006, 10:47 pm GMT +0200
I will think about, while I don't like to add modifications in the scripts, is it possible with mod to show the "unwanted" text as well?

pixeline
Fri 8 December 2006, 12:07 am GMT +0200
hi olaf,
why would you want to show arrows when they are not clickable? It's just confusing for the website visitor...

If you want to display them nonetheless, just use the class as it is delivered.

cheers,

Alex

olaf
Fri 8 December 2006, 01:09 am GMT +0200
hi olaf,
why would you want to show arrows when they are not clickable? It's just confusing for the website visitor...

If you want to display them nonetheless, just use the class as it is delivered.

cheers,

Alex
just to show that there is some navigation the array is not clickable, I can't see the problem.

never got complains before, but I will think about that for the next upgrade

I think its more important to show the visitor on which page the visitor is currently and that's not a problem.
You can give the not linked elements some light grey color, then is everything fine ;)

olaf
Fri 8 December 2006, 01:12 am GMT +0200
Quote
If you want to display them nonetheless, just use the class as it is delivered.

Look my classes are used by a lot of people because I try to keep them flexible, at the moment you have to versions the flexibility is gone.

the right way is to modify tyhe class that people with older scripts can use the new version and the "hidden" arrows are an option ;)

pixeline
Sat 9 December 2006, 12:19 am GMT +0200
nothing prevents you from improving my mod, make it optional, and include it in the next version as long as you understand its purpose, that was in fact the reason why i took the initiative to share my hack.

thank you,

alex

Archive for SMF v1.00 by N.P. Valid XHTML 1.0 Transitional