aeroheli Posted May 7, 2009 Share Posted May 7, 2009 Hi, I would like to add a condition in this code to have the forum insert "</tr><tr>" if the {counter} hits 3, can someone help me? Thank you so much! {foreach item="image" from=$records} <td> {if $use_fancy_urls} <a href="listings/view/{$image.make|strip:"-"}/{$image.model|strip:"-"}/ {$image.listingid}/"><img src="{$image.imagethumbpath}" title="{$smarty.const.IMAGE} {counter}" alt="{$smarty.const.IMAGE} {counter}" /></a><br><br><b>{$image.ad_title}</b><br></td> {else} <a href="listings.php?make={$image.make|strip:"-"}&model= {$image.model|strip:"-"}&id={$image.listingid}"><img src="{$image.imagethumbpath}" title="{$smarty.const.IMAGE} {counter}" alt="{$smarty.const.IMAGE} {counter}" /></a><br><br><b> {$image.ad_title}</b><br></td> {/if} {/foreach} Link to comment https://forums.phpfreaks.com/topic/157168-help-on-coding/ Share on other sites More sharing options...
Ken2k7 Posted May 7, 2009 Share Posted May 7, 2009 If you assign item="image", wouldn't it just be the string "image"? But anyways, how is $records indexed? Is it numeric or associative? Link to comment https://forums.phpfreaks.com/topic/157168-help-on-coding/#findComment-828174 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.