Salve, non ne capisco nulla di php. Mi aiutate a togliere le immagini da questo modulo. In particolare nella funzione di creazione newsletter html. E' un file di un modulo newsletter di jooma.
Vi posto il codice del file da cambiare:
function vmn_buildHTMLMessage($newsitem,&$message,$readmore ,$sidebarmodules,$newsmailHTML,$send,$unsubscribea lltext,$base_url,$categoryname,$subject,$stripmamb otsarray,$modulepreviewtext)
{
// Build e-mail message format
$message=stripslashes($newsmailHTML);
$introtext=$newsitem->introtext;
if ($newsitem->catid > -1)
{
$bodytext=$newsitem->fulltext;
truncateHTML($readmore,$introtext,$bodytext,$newsi tem);
$message=str_replace('[clickabletitle]','' . $newsitem->title . '',$message);
$message=str_replace('[readmore]','' . $readmore['text'] . '',$message);
}
else
{
$text=explode("[#*%*#]",$newsitem->fulltext);
$bodytext=$text[0];
$message=str_replace('[clickabletitle]',$newsitem->title,$message);
$message=str_replace('[readmore]','',$message);
}
$unsubscribealllink='' . $unsubscribealltext . '';
$search=array('[sitename]','[livesite]','[title]','[introtext]','[bodytext]','[subject]','[unsubscribeall]','[senddate]','[sendtime]','[categoryname]');
$replace=array(vmn_sitename(),vmn_live_site(),$new sitem->title,$introtext,$bodytext,$subject,$unsubscribea lllink,vmn_date(),vmn_shortTime(),$categoryname);
$message = str_replace($search,$replace,$message);
if (isset($newsitem->created_by))
{
$message = str_replace("[publishdatetime]", vmn_dateTime($newsitem->publish_up),$message);
$message = str_replace("[author]", vmn_getAuthorName($newsitem),$message);
}
else
{
$message = str_replace("[publishdatetime]", '',$message);
$message = str_replace("[author]", '',$message);
}
for ($i=0;$i<6;$i++)
{
//if (strlen($sidebarmodules[$i]['name']))
//{
$message=str_replace('[moduletitle'.($i+1).']',$sidebarmodules[$i]['title'],$message);
$message=str_replace('[modulecontent'.($i+1).']',vmn_getModuleContent($sidebarmodules[$i],$send,$modulepreviewtext),$message);
//}
}
$message=vmn_stripMambots($message,$stripmambotsar ray['plain'],true);
$message=vmn_stripMambots($message,$stripmambotsar ray['tags'],false);
if (isset($newsitem->images))
{
$message=vmn_mosImage($message,$newsitem->images);
}
$message = str_replace('{mospagebreak}','',$message );
return vmn_codeMessage($message);
}
function vmn_mosImage($text,$images)
{
$images = explode( "\n", $images );
$images1 = array();
foreach ($images as $img) {
$img = trim( $img );
if ($img) {
$temp = explode( '|', trim( $img ) );
if (!isset( $temp[1] ))
{
$temp[1] = "left";
}
if ($temp[1]=="")
{
$temp[1]="none";
}
if (!isset( $temp[2] )) {
$temp[2] = "Image";
} else {
$temp[2] = htmlspecialchars( $temp[2] );
}
if (!isset( $temp[3] )) {
$temp[3] = "0";
}
$size = '';
if (function_exists( 'getimagesize' )) {
$size = @getimagesize( vmn_absolute_path()."/images/stories/$temp[0]" );
if (is_array( $size )) {
$size = "width=\"$size[0]\" height=\"$size[1]\"";
}
}
if (!isset($temp[4]))
{
$temp[4]=""; //caption
}
if (!isset($temp[5]))
{
$temp[5]="bottom"; //caption pos bottom
}
if (!isset($temp[6]))
{
$temp[6]="0"; //caption align none
}
if (!isset($temp[7]))
{
$temp[7]="0"; //caption width 0
}
if ($temp[4]=="") //no caption
{
$images1[]="<div style=\" border-width: $temp[3]px; float: $temp[1]; width: $temp[7]px;\" align=\"$temp[1]\">
<img src=\"".vmn_live_site()."/images/stories/$temp[0]\" $size hspace=\"6\" alt=\"$temp[2]\" title=\"$temp[2]\" border=\"0\" />
</div>";
}
else if ($temp[1]=="none") //no align
{
$images1[]="<img src=\"".vmn_live_site()."/images/stories/$temp[0]\" $size hspace=\"6\" alt=\"$temp[2]\" title=\"$temp[2]\" border=\"0\" />";
}
else if ($temp[5]!="top") //caption below
{
$images1[]="<div style=\" border-width: $temp[3]px; float: $temp[1]; width: $temp[7]px;\" align=\"$temp[1]\">
<img src=\"".vmn_live_site()."/images/stories/$temp[0]\" $size hspace=\"6\" alt=\"$temp[2]\" title=\"$temp[2]\" border=\"0\" />
<div style=\"text-align: $temp[6]\" align=\"$temp[6]\">$temp[4]</div>
</div>";
}
else //caption above
{
$images1[]="<div style=\" border-width: $temp[3]px; float: $temp[1]; width: $temp[7]px;\" align=\"$temp[1]\">
<div style=\"text-align: $temp[6]\" align=\"$temp[6]\">$temp[4]</div>
<img src=\"".vmn_live_site()."/images/stories/$temp[0]\" $size hspace=\"6\" alt=\"$temp[2]\" title=\"$temp[2]\" border=\"0\" />
</div>";
}
}
}
$text1 = explode( '{mosimage}', $text );
$text = $text1[0];
for ($i=0, $n=count( $text1 )-1; $i < $n; $i++) {
if (isset( $images1[$i] )) {
$text .= $images1[$i];
}
if (isset( $text1[$i+1] )) {
$text .= $text1[$i+1];
}
}
unset( $text1 );
return $text;
}
function vmn_buildTextMessage($newsitem,&$message,$readmore ,$newsmailText,$unsubscribealltext,$base_url,$cate goryname,$subject,$sidebarmodules,$send,$stripmamb otsarray,$modulepreviewtext)
{
// Build e-mail message format
$h2t =& new vmn_class_html2text();
$h2t->set_html($newsitem->introtext);
$h2t->set_base_url(vmn_live_site());
$introtext = $h2t->get_text();
$message=stripslashes($newsmailText);
if ($newsitem->catid==-1)
{
$text=explode("[#*%*#]",$newsitem->fulltext);
$bodytext=$text[1];
$message=str_replace('[clickabletitle]',$newsitem->title,$message);
$message=str_replace('[readmore]','',$message);
}
else
{
$h2t->set_html($newsitem->fulltext);
$h2t->set_base_url(vmn_live_site());
$bodytext = $h2t->get_text();
truncateText($readmore,$introtext,$bodytext,$newsi tem);
$message=str_replace('[clickabletitle]',$newsitem->title.'
'.vmn_getContentURL($newsitem),$message);
$message=str_replace('[readmore]',$readmore['text'].'
'.vmn_getContentURL($newsitem),$message);
}
for ($i=0;$i<6;$i++)
{
//if (strlen($sidebarmodules[$i]['name']))
//{
$h2t->set_html($sidebarmodules[$i]['title']);
$h2t->set_base_url(vmn_live_site());
$message=str_replace('[moduletitle'.($i+1).']',$h2t->get_text(),$message);
$h2t->set_html(vmn_getModuleContent($sidebarmodules[$i],$send,$modulepreviewtext));
$h2t->set_base_url(vmn_live_site());
$message=str_replace('[modulecontent'.($i+1).']',$h2t->get_text(),$message);
//}
}
$h2t->set_html($newsitem->title);
$h2t->set_base_url(vmn_live_site());
$title = $h2t->get_text();
$unsubscribealllink=$unsubscribealltext . '
' . vmn_sefRelToAbs($base_url . '&unsubscribeall=1&userid=userid9999987' );
$search=array('[sitename]','[livesite]','[title]','[introtext]','[bodytext]','[subject]','[unsubscribeall]','[senddate]','[sendtime]','[categoryname]');
$replace=array(vmn_sitename(),vmn_live_site(),$tit le,$introtext,$bodytext,$subject,$unsubscribeallli nk,vmn_date(),vmn_shortTime(),$categoryname);
$message = str_replace($search,$replace,$message);
if (isset($newsitem->created_by))
{
$message = str_replace("[publishdatetime]", vmn_dateTime($newsitem->publish_up),$message);
$message = str_replace("[author]", vmn_getAuthorName($newsitem),$message);
}
else
{
$message = str_replace("[publishdatetime]", '',$message);
$message = str_replace("[author]", '',$message);
}
$message = str_replace( '{mosimage}','',$message );
$message = str_replace('{mospagebreak}','',$message );
$message=vmn_stripMambots($message,$stripmambotsar ray['plain'],true);
$message=vmn_stripMambots($message,$stripmambotsar ray['tags'],false);
return vmn_codeMessage($message);
}