Re: [SMARTY] Retardation : looping thru photo gallery

From: Date: Thu, 24 Oct 2002 19:58:08 +0000
Subject: Re: [SMARTY] Retardation : looping thru photo gallery
References: 1  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-6234@lists.php.net to get a copy of this message
Yeah I tried that. On a loop over six pics, {$smarty.section.pics.total-1} //no spaces Fatal error: Smarty plugin error: [in Photo_Gallery line 5]: unknown tag - '$smarty.section.pics.total-1' Whereas {$smarty.section.pics.total -1} //has spaces gives 6, which is still one too high. ----- Original Message ----- From: "Josh Johnson" <mailing_lists@allusiveimage.com> To: "'Tim Burden'" <tim@psnetworks.net>; <smarty-general@lists.php.net> Sent: Thursday, October 24, 2002 3:46 PM Subject: RE: [SMARTY] Retardation : looping thru photo gallery > {if $smarty.section.pics.first} > {$smarty.section.pics.total-1} //<=This gives a number too high by one > {else} > {$smarty.section.pics.index_prev} > {/if} > > -----Original Message----- > From: Tim Burden [mailto:tim@psnetworks.net] > Sent: Thursday, October 24, 2002 12:37 PM > To: smarty-general@lists.php.net > Subject: [SMARTY] Retardation : looping thru photo gallery > > Ok, I'm a tard. > > I want my photo gallery to loop thru a circularly, so the "Previous" > button on the first pic will go to the last pic, and the "Next" button > on the last pic will go to the first pic. > > I use $smarty.section.pics.index_prev and > $smarty.section.pics.index_next on most buttons, works good. I use > {if $smarty.section.pics.last} > 0 > {else} > {$smarty.section.pics.index_next} > {/if} > which works fine for the last pic's "Next" button. > > But, when I want to do the first pic's "Previous" button, > > {if $smarty.section.pics.first} > {$smarty.section.pics.total} //<=This gives a number too high by one > {else} > {$smarty.section.pics.index_prev} > {/if} > > Any suggestions? > > > -- > Smarty General Mailing List (http://smarty.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

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