I currently have the following in my database
tn_pic1
tn_pic2
They hold a filename for each one, for example tn_X_wm.jpg
X = the number and jpg could be gif, png, bmp
So for example in tn_pic1 I could have tn_1_wm.jpg but in tn_pic2 I could have tn_2_wm.png
In my .tpl file I currently have:
{if $item.pic_count > 0}
{rand(1,$item.pic_count) assign="yourVar"}
<img src="users/images/{$item.id}/{$item.tn_pic1}" width="100" height="100" class="smallpic" alt="" />
{/if}
I would like to use the rand number in $item.tn_pic1
I have tried {$item.tn_pic{$yourVar}} but get an error as I have 2 {}
So what I am wanting is {$item.tn_picX}
X being the rand number.
I am new'ish to smarty and not really sure how to sort it.
$item. pull from the database via a .php file