если с описанием,то вместо этого кода функцииСпасибо огромное,и ещё один вопросик,там только заголовок выводится,можно ли добавить описание?
function displayMoreAds($contents, $itemid, $nbimages) {
if (count($contents) > 0) {
?>
<div><?php
foreach($contents as $content) {
$linkTarget = JRoute::_("index.php?option=com_adsmanager&view=details&id=".$content->id."&catid=".$content->catid."&Itemid=".$itemid);
?>
<div>
<div><a href="<?php echo $linkTarget; ?>"><?php
$ok = 0; $i = 1;
while(!$ok) {
if ($i < $nbimages + 1) {
$ext_name = chr(ord('a')+$i-1);
$pic = JPATH_BASE."/images/com_adsmanager/ads/".$content->id.$ext_name."_t.jpg";
if(file_exists($pic)) {
echo '<img src="'.$this->baseurl.'images/com_adsmanager/ads/'.$content->id.$ext_name.'_t.jpg" alt="" />';
$ok = 1;
}
} else if ($nbimages != 0) {
echo '<img src="'.$this->baseurl.'components/com_adsmanager/images/'.JText::_('ADSMANAGER_NOPIC').'" alt="" />';
$ok = 1;
} else { $ok = 1; }
$i++;
}
?></a></div>
<div><a href="<?php echo $linkTarget; ?>"><?php echo $content->ad_headline; ?></a></div>
</div>
<?php
}
?></div>
<?php
}
}
if (count($contents) > 0) {
?>
<div><?php
foreach($contents as $content) {
$linkTarget = JRoute::_("index.php?option=com_adsmanager&view=details&id=".$content->id."&catid=".$content->catid."&Itemid=".$itemid);
?>
<div>
<div><a href="<?php echo $linkTarget; ?>"><?php
$ok = 0; $i = 1;
while(!$ok) {
if ($i < $nbimages + 1) {
$ext_name = chr(ord('a')+$i-1);
$pic = JPATH_BASE."/images/com_adsmanager/ads/".$content->id.$ext_name."_t.jpg";
if(file_exists($pic)) {
echo '<img src="'.$this->baseurl.'images/com_adsmanager/ads/'.$content->id.$ext_name.'_t.jpg" alt="" />';
$ok = 1;
}
} else if ($nbimages != 0) {
echo '<img src="'.$this->baseurl.'components/com_adsmanager/images/'.JText::_('ADSMANAGER_NOPIC').'" alt="" />';
$ok = 1;
} else { $ok = 1; }
$i++;
}
?></a></div>
<div><a href="<?php echo $linkTarget; ?>"><?php echo $content->ad_headline; ?></a></div>
</div>
<?php
}
?></div>
<?php
}
}
function displayMoreAds($contents, $itemid, $nbimages) {
if (count($contents) > 0) {
?>
<div>
<?php
foreach($contents as $content) {
$linkTarget = TRoute::_( "index.php?option=com_adsmanager&view=details&id=".$content->id."&catid=".$content->catid);
?>
<div>
<div><a href="<?php echo $linkTarget; ?>"><h4><?php echo $content->ad_headline; ?></h4></a>
<?php
$content->ad_text = str_replace ('<br />'," ",$content->ad_text);
$af_text = JString::substr($content->ad_text, 0, 60).".....";
echo $af_text;
?></div>
</div>
<?php
}
?></div>
<?php
}
}
if (count($contents) > 0) {
?>
<div>
<?php
foreach($contents as $content) {
$linkTarget = TRoute::_( "index.php?option=com_adsmanager&view=details&id=".$content->id."&catid=".$content->catid);
?>
<div>
<div><a href="<?php echo $linkTarget; ?>"><h4><?php echo $content->ad_headline; ?></h4></a>
<?php
$content->ad_text = str_replace ('<br />'," ",$content->ad_text);
$af_text = JString::substr($content->ad_text, 0, 60).".....";
echo $af_text;
?></div>
</div>
<?php
}
?></div>
<?php
}
}
<?php echo JText::_('ADSMANAGER_SIMILAR_ADS'); ?>
<?php
$this->displayMoreAds($this->more_ads, $this->Itemid, $this->conf->nb_images);
?>
<?php
$this->displayMoreAds($this->more_ads, $this->Itemid, $this->conf->nb_images);
?>
<?php echo JText::_('ADSMANAGER_SIMILAR_ADS'); ?>
<?php
$this->displayMoreAds($this->more_ads, $this->Itemid, $this->nbimages);
?>
<?php
$this->displayMoreAds($this->more_ads, $this->Itemid, $this->nbimages);
?>
$af_text = JString::substr($content->ad_text, 0, 60).".....";
вместо 60 символов вставьте своё число.