Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

problems with paginate

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Add-ons
View previous topic :: View next topic  
Author Message
fontecu
Smarty Rookie


Joined: 10 Feb 2005
Posts: 5

PostPosted: Wed Feb 16, 2005 2:36 am    Post subject: problems with paginate Reply with quote

the error
Code:


Warning: Smarty error: paginate_prev: total was not set in D:\Usuarios\yaponte\Tesis\Smarty\Smarty.class.php on line 1088

Warning: Smarty error: paginate_middle: total was not set in D:\Usuarios\yaponte\Tesis\Smarty\Smarty.class.php on line 1088

Warning: Smarty error: paginate_next: total was not set in D:\Usuarios\yaponte\Tesis\Smarty\Smarty.class.php on line 1088
 


the code is

Code:

session_start();
      SmartyPaginate::connect();
      SmartyPaginate::setUrl($_SERVER['PHP_SELF'] . $variable);
      SmartyPaginate::setLimit(5);
            
      $index = SmartyPaginate::getCurrentIndex();
      $limit = SmartyPaginate::getLimit();
      
      
      if (($Nombre != '') or ($Apellidos != '') or ($CI != '')){
         
         $rsBuscarEst=$conn->SelectLimit($query,$limit,$index);
         while (!$rsBuscarEst->EOF){
            $Estudiantes[] = new EstudianteBusq($rsBuscarEst->fields['Nombre'],$rsBuscarEst->fields['Apellidos'],$rsBuscarEst->fields['País'],$rsBuscarEst->fields['Especialidad'],$rsBuscarEst->fields['CI']);         
            $rsBuscarEst->MoveNext();
         }
         if ($rsBuscarEst->RecordCount()<>0){
       
             $visible = true;
         }
      }
   }
   
   
   $BuscarSmarty = new Smarty();
   //$BuscarSmarty->assign('Estudiantes',$Estudiantes);
   $BuscarSmarty->assign('visible',$visible);
   
   
    SmartyPaginate::assign($BuscarSmarty);
   $BuscarSmarty->assign('Estudiantes',$Estudiantes);
   
   
   
   $BuscarSmarty->display('BuscarEst.tpl');


I need some body help me cause i dont know what really happen
Back to top
View user's profile Send private message
mohrt
Administrator


Joined: 16 Apr 2003
Posts: 7368
Location: Lincoln Nebraska, USA

PostPosted: Wed Feb 16, 2005 2:21 pm    Post subject: Reply with quote

You have to call

SmartyPaginate::setTotal($total);

where $total is the total number of items you are paginating through.
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Add-ons All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP