PHP Developers Network

A community of PHP developers offering assistance, advice, discussion, and friendship.
 
Loading
It is currently Mon Dec 17, 2018 10:57 am

All times are UTC - 5 hours




Post new topic Reply to topic  [ 1 post ] 
Author Message
PostPosted: Wed Mar 30, 2011 11:15 am 
Offline
Forum Newbie

Joined: Wed Mar 30, 2011 11:05 am
Posts: 3
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');


$baseurl=JUri::root()."images/ads";
$basepath=JPATH_ROOT.DS."images".DS."ads";

?>

<?php if(count($lists)>0) {?>
<table border="0" cellpadding="2">
<?php foreach($lists as $l){
$linkx=JRoute::_("index.php?option=com_joomlistings&c=ad&task=view&adid=".$l->id,false);
$img_src = "";
if(file_exists($basepath.DS.$l->userid.DS.$l->image."_sthm.jpg")){
$img_src = $baseurl."/".$l->userid."/".$l->image."_sthm.jpg";
}
elseif(file_exists($basepath.DS.$l->userid.DS.$l->image."_thm.jpg")){
$img_src = $baseurl."/".$l->userid."/".$l->image."_thm.jpg";
}else{
$xurl=JUri::base()."components/com_joomlistings/images";
$img_src = $xurl."/noimage_sthm.jpg";
}
?>
<tr>
<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; ?>
</div>
<?php }?>
</td>
</tr>
<?php
}
?>
</table>
<?php
}
else
{
echo JText::_('NO_ADS');
}
?>



[ /syntax]


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group