kieranbarnes do you know where your towel is?

XHTML Transitional Compliant Paging with ADOdb

Posted on January 4, 2008

Following on from my previous post, I've cleaned up the getNavigation() function to generate XHTML Transitional compliant code. It's good for all kinds of things, if nothing else, you'll live longer.
Just replace the following function in your class.GenericEasyPagination.php

    function getNavigation()
    {
        $result = "";
        $previous = $this->currentPage - 1;
        $next     = $this->currentPage + 1;

        if ($this->getsVars ==""):
            if ($this->PagesFound>1):
                if ($this->currentPage!=1):
                    $result .= "resultset_first ";
                endif;
                if ($this->currentPage>1):             $result .= "< border="0" src="/_common_images/icons/resultset_previous.png">  ";     endif;
                if (($this->currentPage < $this->PagesFound) && ($this->PagesFound >= 1)):    $result .= " resultset_next";
				endif;
                if (($this->PagesFound>1)&&($this->currentPage!=$this->PagesFound)):
                    $result .=  " resultset_last";
                endif;
            endif;
        else:
            if ($this->currentPage!=1):
                $result = "resultset_first ";
            endif;
            if ($this->currentPage>1):  $result .=  "resultset_previous  ";     endif;
            if (($this->currentPage<$this->PagesFound) && ($this->PagesFound>=1)):    $result .= "resultset_next";				endif;
            if (($this->PagesFound>1)&&($this->currentPage!=$this->PagesFound)):
                $result .= "  >>";
            endif;
        endif;
        return $result;
    }
Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • Blogplay

Related posts:

  1. Retro Fitting Record Pagination with ADOdb
    For my first project of the New Year I had to retro-fit pagination controls to...
  2. Nicer Pagination with ADOdb
    Or should that be Nicr? To follow in an annoying theme. Olavo Alexandrino wrote a...
  3. Yahoo GeoLocation API
    The Yahoo Maps API is the best API I've found for using on in internal...
  4. Nice print_r() for the web
    Here's a nicer version of the print_r() function that displays much better on web...
  5. PHP Geo-IP Location in 4 lines
    Want to look up IP addresses to a geographical location? Firstly, download maxmind_geoip.php and GeoIP...

What this article useful to you?



Let me know, buy me a beer!
Alternatively, if you're feeling impecunious, you may like to subscribe to my RSS feed, or see other articles in the PHP category.

Filed under: PHP Leave a comment
Comments (0) Trackbacks (0)

No comments yet.


Leave a comment


No trackbacks yet.