Jump to content


paginate count


  • You cannot reply to this topic
No replies to this topic

#1 hafdis

    Young Padawan

  • Members
  • Pip
  • 8 posts
  • Gender:Male
  • Location:Iceland

Posted 06 February 2007 - 03:25 PM

hi
i am using this paginate code with another code, it should count 20 images on page, page 1 and 2 works, but if i cant get to next images, in this gallery is 45 images, only gets 40 images....?
http://www.koddinn.c...dir/album/born/
see links below Fyrri - Nęsta

whats wrong here
<span style="font-weight: bold;">	 </span>$c = $_GET['count'];if( $c == null ) $c = 20;
	  $o = $_GET['offset'];if( $o == null ) $o = 0;
	  $ = fim_query_images($_GET['album'],$o,$c);
	  $fim .= "<p>";
	  if( $o > 0 ) $o = $o - $c; if( $o < 0 ) $o = 0;  $fim .= "<a href=\"?offset=".$o."&count=".$c."\">&lt; Fyrri s&iacute;&eth;a</a>&nbsp;&nbsp;&nbsp;";
	  $fim .="<a href=\"?offset=".($o+$c)."&count=".$c."\">N&aelig;sta s&iacute;&eth;a &gt;</a>";
	  $fim .="</p>";
	  $fim .= "</div>";
	  return $fim;
  }
  function fim_get_image()
  {
	  return "<a href='$path_'>".__("", "fgallery")."</a>";
  
  function fim_query_images($catid,$offset=0, $rowcount=0)
  {
	  if( $rowcount > 0 ) 
		  return $wpdb->get_results("SELECT * FROM $table_image WHERE cat = '$catid' AND status <> 'exclude' ORDER BY '$order_by' $order_type LIMIT $offset,$rowcount");
	  else
		  return $wpdb->get_results("SELECT * FROM $table_image WHERE cat = '$catid' AND status <> 'exclude' ORDER BY '$order_by' $order_type");
  }

Edited by hafdis, 06 February 2007 - 03:29 PM.






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users