Views and PHP Code

#4
[eluser]bagwaa[/eluser]
Your code looks way neater than mine because I am doing a few other things in the code, basically its a page of book covers, and when there are 4 books on one row I want it to-do </tr><tr> to start on the next row.

<table cellpadding=20 border=0>
<tr>
&lt;? $i = 1; ?&gt;
&lt;? foreach ($documents as $document): ?&gt;
<td>
&lt;?= img('www/img/'.$document->image) ?&gt;
<center><font size=1>
&lt;?=anchor('store/viewdocument/'.$document->id, '[view]'); ?&gt;
&lt;?=anchor('store/addtocart/'.$document->id, '[add to cart]'); ?&gt;
</font></center>
</td>
&lt;? if (!($i % 4)) { ?&gt;
</tr><tr>
&lt;? } ?&gt;
&lt;? $i++; ?&gt;
&lt;? endforeach; ?&gt;
</tr>
</table>


Messages In This Thread
Views and PHP Code - by El Forum - 02-01-2009, 12:25 PM
Views and PHP Code - by El Forum - 02-01-2009, 01:03 PM
Views and PHP Code - by El Forum - 02-01-2009, 01:54 PM
Views and PHP Code - by El Forum - 02-01-2009, 01:57 PM
Views and PHP Code - by El Forum - 02-01-2009, 02:11 PM
Views and PHP Code - by El Forum - 02-01-2009, 07:36 PM
Views and PHP Code - by El Forum - 02-01-2009, 07:48 PM
Views and PHP Code - by El Forum - 02-01-2009, 08:49 PM
Views and PHP Code - by El Forum - 02-01-2009, 09:00 PM
Views and PHP Code - by El Forum - 02-01-2009, 10:15 PM
Views and PHP Code - by El Forum - 02-01-2009, 10:32 PM
Views and PHP Code - by El Forum - 02-01-2009, 11:20 PM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.