PHP Developers Network

Need a simple PHP code to allow for rows and colums
Page 1 of 1

Author:  drumguru69 [ Wed Mar 30, 2011 11:15 am ]
Post subject:  Need a simple PHP code to allow for rows and colums

I have a Joomla based module, which shows a list of featured ads in a single column. I would like to show two rows of ads, each row consisting of four ads... I have tried to copy and paste some example php, which did not work. I was hoping someone could fill in the appropriate pieces to make the module function the way I need it to... If this is not enough information... or if more files will need to be modified to make the whole system work, then please let me know.. (I am a newbie)

[syntax="php" ]<?php
* @author Sanjeev Shrestha
* Default Template for Featured
defined('_JEXEC') or die('Restricted access');



<?php if(count($lists)>0) {?>
<table border="0" cellpadding="2">
<?php foreach($lists as $l){
$img_src = "";
$img_src = $baseurl."/".$l->userid."/".$l->image."_sthm.jpg";
$img_src = $baseurl."/".$l->userid."/".$l->image."_thm.jpg";
$img_src = $xurl."/noimage_sthm.jpg";
<td><a href="<?php echo $linkx; ?>"><img src="<?php echo $img_src;?>" /></a></td>
<td valign="top"><a href="<?php echo $linkx; ?>"><strong><?php echo $l->title; ?> </strong></a>
<?php if($l->price>0){?>
<div class="price">
<?php echo $l->currencysymbol; ?> <?php echo number_format($l->price,2); ?> <?php echo $l->currency; ?>
<?php }?>
echo JText::_('NO_ADS');

[ /syntax]

Page 1 of 1 All times are UTC - 5 hours
Powered by phpBB® Forum Software © phpBB Group