Iterations

From: Date: Mon, 11 Apr 2005 17:57:30 +0000
Subject: Iterations
Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-12454@lists.php.net to get a copy of this message
I using SmartyPaginate plugin to paginate result obtains from a query. The questions is I need to know the iteration number depending of page I stay. Take a look to this code: ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// <table width="100%" border="0" cellspacing="1" cellpadding="0"> <tr> <td class="tdright">{$paginate.first} - {$paginate.last} {$paginate.total}</td> </tr> </table> {section name="guestbook_data" loop=$arrUsName} <table width="100%" border="0" cellspacing="0" cellpadding="0" class="table"> <tr> <td colspan="8" class="th">Mostrando firma {$smarty.section.guestbook_data.iteration}</td> </tr> <tr> <td width="79%" class="padding-td">Firmado por: {$arrUsName[guestbook_data]}</td> <td width="3%" class="image"> {if $arrUsEmail[guestbook_data] neq ""} <img src="themes/images/contacticon.gif" alt="{$arrUsEmail[guestbook_data]}"> {/if} </td> <td width="3%" class="image"> {if $arrUsCountry[guestbook_data] neq ""} <img src="themes/images/users/world.gif" alt="{$arrUsCountry[guestbook_data]}"> {/if} </td> <td width="3%" class="image"> {if $arrUsWebSite[guestbook_data] neq ""} <a href="{$arrUsWebSite[guestbook_data]}" target="_blank"><img src="themes/images/users/website.gif" border="0" alt="{$arrUsWebSite[guestbook_data]}"></a> {/if} </td> <td width="3%" class="image"> {if $arrUsYim[guestbook_data] neq ""} <img src="themes/images/users/yim.gif" alt="{$arrUsYim[guestbook_data]}"> {/if} </td> <td width="3%" class="image"> {if $arrUsMsn[guestbook_data] neq ""} <img src="themes/images/users/msn.gif" alt="{$arrUsMsn[guestbook_data]}"> {/if} </td> <td width="3%" class="image"> {if $arrUsIcq[guestbook_data] neq ""} <img src="themes/images/users/icq.gif" alt="{$arrUsIcq[guestbook_data]}"> {/if} </td> <td width="3%" class="image"> {if $arrUsAim[guestbook_data] neq ""} <img src="themes/images/users/aim.gif" alt="{$arrUsAim[guestbook_data]}"> {/if} </td> </tr> <tr> <td colspan="8" valign="top" class="padding-td"><strong>Comentarios:</strong> {$arrUsComments[guestbook_data]|nl2br}</td> </tr> </table><br> {/section} <table width="100%" border="0" cellspacing="1" cellpadding="0"> <tr> <td class="tdright">{paginate_prev} {paginate_middle} {paginate_next}</td> </tr> </table> ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// When I stay in first page in wich $next var have 0 or 1 value all is ok, {$smarty.section.guestbook_data.iteration } show me 10 values but when I move to another page and $next var take another value like 2 for example {$smarty.section.guestbook_data.iteration } show me tha same values when I want to begin in 11 and show even 20? How I can solve this? Reynier Pérez Mira 3ero. Ing. Informática Entre más inteligente me siento, más me doy cuenta de lo ignorante que soy.

« previous php.smarty.general (#12454) next »