Retardation : looping thru photo gallery
| From: | Tim Burden | Date: | Thu, 24 Oct 2002 16:37:10 +0000 |
| Subject: | Retardation : looping thru photo gallery | ||
| Groups: | php.smarty.general | ||
| Request: | Send a blank email to php-smarty-general+get-6231@lists.php.net to get a copy of this message | ||
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?