function replaceTags($content, $subscriber, $list, $mailingId, $html, $tags = null) { global $_MAMBOTS; global $_VERSION, $mainframe, $database; $joomAca15 = $_VERSION->RELEASE != '1.0' && class_exists('JFactory') ? true : false; /* $content = str_replace('href="mailto:' , '9aca7aca5', $content); // mailto tag good ones $content = str_replace('@', '9aca4aca1', $content); // mailto tag good ones */ $Itemid = $GLOBALS[ACA . 'itemidAca']; $listId = $list->id; if ($GLOBALS[ACA . 'use_sef'] == '1' and $GLOBALS['mosConfig_sef'] == '1' and function_exists('sefRelToAbs')) { $subscriptionslink = sefRelToAbs('index.php?option=com_acajoom&Itemid=' . $Itemid . '&act=change&subscriber=' . $subscriber->id . '&cle=' . md5($subscriber->email) . '&listid=' . $listId); $unsubscribelink = sefRelToAbs('index.php?option=com_acajoom&Itemid=' . $Itemid . '&act=unsubscribe&subscriber=' . $subscriber->id . '&cle=' . md5($subscriber->email) . '&listid=' . $listId); } else { $subscriptionslink = $GLOBALS['mosConfig_live_site'] . '/index.php?option=com_acajoom&Itemid=' . $Itemid . '&act=change&subscriber=' . $subscriber->id . '&cle=' . md5($subscriber->email) . '&listid=' . $listId; $unsubscribelink = $GLOBALS['mosConfig_live_site'] . '/index.php?option=com_acajoom&Itemid=' . $Itemid . '&act=unsubscribe&subscriber=' . $subscriber->id . '&cle=' . md5($subscriber->email) . '&listid=' . $listId; } if ($html) { $subscriptionslink = '<a href="' . $subscriptionslink . '" target="_blank"><span class="subscriptionlink_nws">' . _ACA_CHANGE_EMAIL_SUBSCRIPTION . '</span></a>'; $unsubscribelink = '<a href="' . $unsubscribelink . '" target="_blank"><span class="subscriptionlink_nws">' . _ACA_UNSUBSCRIBE . '</span></a>'; $subscriptionstext = '<p>' . $subscriptionslink . '<br />' . $unsubscribelink . '</p>'; } else { $subscriptionslink = _ACA_CHANGE_EMAIL_SUBSCRIPTION . ' ( ' . $subscriptionslink . ' )'; $unsubscribelink = _ACA_UNSUBSCRIBE . ' ( ' . $unsubscribelink . ' )'; $subscriptionstext = "\r\n" . $subscriptionslink . "\r\n" . $unsubscribelink; if (substr_count($content, '[SUBSCRIPTIONS]') < 1) { $content .= "\r\n [SUBSCRIPTIONS] \r\n"; } } if ($GLOBALS[ACA . 'show_signature'] == 1) { if ($html) { $signatureText = '<a href="http://www.joobisoft.com" target="_blank">'; $signatureText .= '<br /><center><span style="color:#666666; font-size: .8em; text-align: center; ">Powered by Joobi</span></center>'; $signatureText .= '</a>'; } else { $signatureText = 'Powered by Joobi ( http://www.joobisoft.com )'; } $subscriptionstext .= "\r\n\r\n" . $signatureText; } if ($GLOBALS['mosConfig_sef'] == '1' and $GLOBALS[ACA . 'use_sef'] == '1' and function_exists('sefRelToAbs')) { $confirmlink = sefRelToAbs('index.php?option=com_acajoom&act=confirm&listid=' . $listId . '&cle=' . md5($subscriber->email) . '&subscriber=' . $subscriber->id); } else { $confirmlink = $GLOBALS['mosConfig_live_site'] . '/index.php?option=com_acajoom&act=confirm&listid=' . $listId . '&cle=' . md5($subscriber->email) . '&subscriber=' . $subscriber->id; } if ($html) { $confirmlink = '<a href="' . $confirmlink . '" target="_blank">' . _ACA_CONFIRM_LINK . '</a>'; } else { $confirmlink = _ACA_CONFIRM_LINK . "\n" . $confirmlink; } $tname = explode(" ", $subscriber->name); $firstname = $tname[0]; $content = str_replace('[CONFIRM]', $confirmlink, $content); $content = str_replace('[NAME]', $subscriber->name, $content); $content = str_replace('[FIRSTNAME]', $firstname, $content); if (class_exists('auto')) { auto::tags($content, $tags); } if ($list->footer == '0') { $content = str_replace('[SUBSCRIPTIONS]', '', $content); } else { $content = str_replace('[SUBSCRIPTIONS]', $subscriptionstext, $content); } if (class_exists('tags') and $tags) { tags::replace($content, $tags); } if (!empty($mailingId) and $GLOBALS[ACA . 'enable_statistics'] == 1) { if ($GLOBALS[ACA . 'statistics_per_subscriber'] == 1) { if ($html) { $content .= '<img src="' . $GLOBALS['mosConfig_live_site'] . '/index.php?option=com_acajoom&Itemid=' . $Itemid . '&act=log&listid=' . $listId . '&mailingid=' . $mailingId . '&subscriber=' . $subscriber->id . '" border="0" width="1" height="1" />'; } } else { if ($html) { $content .= '<img src="' . $GLOBALS['mosConfig_live_site'] . '/index.php?option=com_acajoom&Itemid=' . $Itemid . '&act=log&listid=' . $listId . '&mailingid=' . $mailingId . '" border="0" width="1" height="1" />'; } } } // replace for images // put the good mailto tag back (replaced before the content mambot) $replaceTag = array('href="mailto:', '@', 'href="#'); $replaceBy = array('9aca7aca5', '9aca4aca1', '9aca12aca3'); $content = str_replace($replaceTag, $replaceBy, $content); $content = preg_replace('#src[ ]*=[ ]*\\"(?!https?://)(?:\\.\\./|\\./|/)?#', 'src="' . $GLOBALS['mosConfig_live_site'] . '/', $content); $content = preg_replace('#href[ ]*=[ ]*\\"(?!https?://)(?:\\.\\./|\\./|/)?#', 'href="' . $GLOBALS['mosConfig_live_site'] . '/', $content); $content = str_replace($replaceBy, $replaceTag, $content); $content = preg_replace('#\\.(jpg|gif|jpeg|png)(?:(?!").)?"#', '.\\1"', $content); if (!$html) { $content = str_replace('&', '&', $content); } if ($html) { $textonly = ''; acajoom_mail::replaceClass($content, $textonly); } return $content; }