function nav($count,$tot,$limit) {
$html = '';
+
if ($count<$tot) {
list($x,$y) = strpos($limit,',')!==false
? preg_split('/\s*,\s*/',$limit)
$next = $x + $y;
$this->debug("x=$x limit=$y prev=$prev next=$next tot=$tot",1);
+
} else {
$x = 0;
$y = $tot;
if ($prev>=0) $html .= '<span class="prev"><a href="'.$this->url_list('limit',preg_replace('/^0,/','',"$prev,$y")).'"><<</a></span> ';
- $html .= '<span class="count">'.($tot ? ($x+1) : 0).' - '.($x+$y).' / '.$tot.' results</span>';
+ $html .= '<span class="count">'.($tot ? ($x+1) : 0).' - '.( $count<($x+$y) ? $count : ($x+$y) ).' / '.$tot.' results</span>';
if ($next<$tot) $html .= ' <span class="prev"><a href="'.$this->url_list('limit',"$next,$y").'">>></a></span>';