Quote

We're also available for Custom Joomla Development

Hire us now

How to remove image_fulltext in the latest + news?

Hi - please help me
I want the latest news module, when the image_intro image is not available, does not display image_fulltext.
In the absence of the image_intro image, only the default image will be displayed.

How do I modify this code?

$list = modLatestNewsHelperPlusDate::getList($params);
$n = 0;
foreach($list as $index => $item)
{
if($numofintrotext>0) {

if ($showthumb ) {

/* The code lines bellow are added to support intro and fulltext image in article parameter - schro added 13/11/2012 */
$images = json_decode($item->images);
/* First find image in intro text parameter - added 14/11/2012 */
if ( !empty($images->image_intro) ) {
$item->image = htmlspecialchars($images->image_intro);
$item->imgtitle = ($images->image_intro_caption) ? htmlspecialchars($images->image_intro_caption) : '';
$item->imgalt = htmlspecialchars($images->image_intro_alt);
} elseif ( empty($images->image_intro) && !empty($images->image_fulltext) ) {
/* If no image in introtext can be found, then find out image in full text parameter */
$item->image = htmlspecialchars($images->image_fulltext);
$item->imgtitle = ($images->image_fulltext_caption) ? htmlspecialchars($images->image_fulltext_caption) : '';
$item->imgalt = htmlspecialchars($images->image_fulltext_alt);
} elseif( empty($images->image_intro) && empty($images->image_fulltext) ) {
/* If still no image in fulltext parameter can be found, then find out image inserted inside text editor */
/* end added - schro */
$html = $item->introtext;
$html .= "alt='...' title='...' />";
$pattern = '/<img[^>]+src[\\s=\'"]';
$pattern .= '+([^"\'>\\s]+)/is';

if ( preg_match($pattern, $html, $match) ) {
$item->image = "$match[1]";
$item->imgtitle = '';
$item->imgalt = 'Thumbnail';
} else {
$item->image = "0";
$item->imgtitle = '';
$item->imgalt = 'Thumbnail';
}
}
} // end of thumbnail processing

if($introtext_limit){
$item->displayIntrotext = preg_replace("/{[^}]*}/","",$item->introtext);
//$item->introtext = modLatestNewsHelperPlusDate::lnd_limittext($item->introtext,$allowed_tags,$introtext_limit);
$item->displayIntrotext = modLatestNewsHelperPlusDate::_cleanIntrotext($item->introtext);
$item->displayIntrotext = $show_introtext ? modLatestNewsHelperPlusDate::truncate($item->displayIntrotext, $introtext_limit) : '';
} else {
$item->introtext = null;
}

$list[$index] = $item;
$numofintrotext--;
} else {
$item->introtext = null;
$item->image = '';
}
}

http://dl.holsyan.com/images/aaa.jpg
       
  • Replied by kolmedx2 on Wednesday, October 04 2017, 05:21 PM · Hide· #1
    I want to delete the image_fulltext code in the mod_latestnewsplusdate.php file. How do I delete this code?
    Please help me
  •  
  •  
    Replied by admin on Thursday, October 05 2017, 01:43 PM · Hide· #2
    Hi, There are quite alot codes you need to change in the mod_latestnewsplusdate.php and helper.php file. But basically you just need to remove and change the part where the $images->image_fulltext is not empty.
    Please post rating at the Joomla! Extensions Directory - http://extensions.joomla.org/profile/profile/details/264
Your Response
Please login first in order for you to submit comments