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 .= "
";
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 .= "
";
endif;
if (($this->PagesFound>1)&&($this->currentPage!=$this->PagesFound)):
$result .= "
";
endif;
endif;
else:
if ($this->currentPage!=1):
$result = "
";
endif;
if ($this->currentPage>1): $result .= "
"; endif;
if (($this->currentPage<$this->PagesFound) && ($this->PagesFound>=1)): $result .= "
"; endif;
if (($this->PagesFound>1)&&($this->currentPage!=$this->PagesFound)):
$result .= " >>";
endif;
endif;
return $result;
}
Related posts:
- Retro Fitting Record Pagination with ADOdb
For my first project of the New Year I had to retro-fit pagination controls to... - Nicer Pagination with ADOdb
Or should that be Nicr? To follow in an annoying theme. Olavo Alexandrino wrote a... - Yahoo GeoLocation API
The Yahoo Maps API is the best API I've found for using on in internal... - Nice print_r() for the web
Here's a nicer version of the print_r() function that displays much better on web... - PHP Geo-IP Location in 4 lines
Want to look up IP addresses to a geographical location? Firstly, download maxmind_geoip.php and GeoIP...