View Single Post
  #1 (permalink)  
Old 03-03-2008, 11:43 PM
Koshin's Avatar
Koshin Koshin is offline
Casual Pligger
 
Join Date: Jan 2008
Posts: 34
Thanks: 1
Thanked 0 Times in 0 Posts
Pligg pagination HELP plz

Hi guys,

I wanted to use the pagination used on coolwater template on non-pligg website but the other theme is completely PHP based, not tpl, so how do i get the pagination used on coolwater to work on php fusion themes?

currently im using...

PHP Code:
// Universal page pagination function by CrappoMan
function makepagenav($start,$count,$total,$range=0,$link=""){
   global 
$locale;
   if (
$link == ""$link FUSION_SELF."?";
   
$res="";
   
$pg_cnt=ceil($total $count);
   if (
$pg_cnt 1) {
      
$idx_back $start $count;
      
$idx_next $start $count;
      
$cur_page=ceil(($start 1) / $count);
      
$res.="<div class='pagination'>";
      if (
$idx_back >= 0) {
         
$res.="<a class='pagination' href='$link"."rowstart=$idx_back'>Previous</a>\n";
         if (
$cur_page > ($range 1)) $res.="<a class='pagination' href='$link"."rowstart=0'>1</a>...\n";
      }
      
$idx_fst=max($cur_page $range1);
      
$idx_lst=min($cur_page $range$pg_cnt);
      if (
$range==0) {
         
$idx_fst 1;
         
$idx_lst=$pg_cnt;
      }
      for(
$i=$idx_fst;$i<=$idx_lst;$i++) {
         
$offset_page=($i 1) * $count;
         if (
$i==$cur_page) {
            
$res.="<span class='current'><b>$i</b></span>\n";
         } else {
            
$res.="<a class='pagination' href='$link"."rowstart=$offset_page'>$i</a>\n";
         }
      }
      if (
$idx_next $total) {
         if (
$cur_page < ($pg_cnt $range)) $res.="... <a class='pagination' href='$link"."rowstart=".($pg_cnt-1)*$count."'>".$pg_cnt."</a>\n";
         
$res.="<a class='pagination' href='$link"."rowstart=$idx_next'>Next</a>\n";
      }
      
$res.="</div>";

   }
   return 
$res;

how do i replace that with coolwater style pagination?
__________________
Da-African-Site -- gotto check it out.

Last edited by Koshin; 03-04-2008 at 12:13 AM..
Reply With Quote