Codice PHP:
//echo $article->sectionid.' '.$article->catid.'$$$
';
$have_images = preg_match_all("|<[\s\v]*img[\s\v][^>]*>|Ui", $plg_entrytext, $plg_matches, PREG_PATTERN_ORDER) > 0;
//$have_images = false;
if (!$have_images && $fp_used_default_image && in_array($view[0],$viewtype)){
$fp_default_img = '[img]'.$fp_default_image.'[/img]';
$plg_entrytext .= $fp_default_img;
$plg_matches[0][] = $fp_default_img;
$have_images = TRUE;
//$plg_matches[0][0] = $fp_default_img;
}
if ($have_images)
{
$imagesxxx = 0;
//if($ar_remove_link && $view[0] == 'a') $plg_entrytext = preg_replace('@<a (.*?)>(.*?)<\\/a>@s', '$2', $plg_entrytext);
$this->remove_linked_image($ar_remove_link && $view[0] == 'a', $excluded_images,$plg_entrytext);
foreach ($plg_matches[0] as $plg_match)
{
//echo htmlspecialchars($plg_match)."
";
//echo $option.' '.$view.'
';
//$num_articles = count($plg_matches[0]);
// full link of image: [img]..[/img]
//$viewtype assigned to array('f','c','s')
if(in_array($view[0],$viewtype)) {//frontpage, catblog, sectionblog
$showbottext = $this->plg_images_resize2($plg_match,$fp_width,$fp_height,$quality, $fp_frcolor, $fp_bocolor, $widthm ,$heightm);
$showbottext = $this->remove_imagelink_info($showbottext,'width',$widthm);
$showbottext = $this->remove_imagelink_info($showbottext,'height',$heightm);
$showbottext = $this->change_imagelink_info($showbottext,'align',$fp_align);
$showbottext = $this->remove_imagelink_info($showbottext,'hspace',$fp_hspace);
$showbottext = $this->remove_imagelink_info($showbottext,'vspace',$fp_vspace);
$showbottext = $this->change_imagelink_info($showbottext,'style','width:'.$widthm.'px; '.
'height:'.$heightm.'px; margin:'.$fp_vspace.'px '.$fp_hspace.'px;');
$showbottext = $this->change_imagelink_info($showbottext,'border','0');
if($fp_remove_class)$showbottext = $this->remove_imagelink_info($showbottext,'class');
if($fp_image_link) { //$article->slug, $article->catslug, $article->sectionid
$link = JRoute::_(ContentHelperRoute::getArticleRoute(@$article->slug, @$article->catslug, @$article->sectionid.":testset"));
$showbottext = '[url="'.$link.'"]'.$showbottext.'[/url]';
}
$imagesxxx = $imagesxxx + 1;
if($imagesxxx == 1) $showbottext2 = $showbottext;
if($imagesxxx > 1) $showbottext = '';
}
elseif($view[0] == 'a' && $sized_img_article) {//Article
$showbottext = $this->plg_images_resize($plg_match,$ar_width,$ar_height,$quality, $widthm ,$heightm, $originallink);
$showbottext = $this->change_imagelink_info($showbottext,'width',$widthm);
$showbottext = $this->change_imagelink_info($showbottext,'height',$heightm);
$showbottext = $this->change_imagelink_info($showbottext,'align',$fp_align);
$showbottext = $this->change_imagelink_info($showbottext,'hspace',$fp_hspace);
$showbottext = $this->change_imagelink_info($showbottext,'vspace',$fp_vspace);
if($ar_remove_img_tag)
foreach($ar_remove_img_tag as $tag ) $showbottext = $this->remove_imagelink_info($showbottext,$tag);
} else return ;
//echo "$$$$".htmlspecialchars($showbottext)."
";
//$originallink
if($ar_link2originalimage && $view[0] == 'a'){
//$findme = 'download.gif';
$pos = false;
if($excluded_images)
foreach ($excluded_images as $findme)
if($findme) $pos = $pos || strpos($originallink, $findme);
//$pos = strpos((string)$originallink, $findme);
if ($pos === false) {
$plg_entrytext = str_replace( $plg_match, '[url="'.$originallink.'"]'.$plg_match.'[/url]', $plg_entrytext);
}
//$plg_entrytext = str_replace( $plg_match, '[url="'.$originallink.'"]'.$plg_match.'[/url]', $plg_entrytext);
}
$plg_entrytext = str_replace( $plg_match, $showbottext, $plg_entrytext);
}