本文整理汇总了PHP中acymailing_absoluteURL函数的典型用法代码示例。如果您正苦于以下问题:PHP acymailing_absoluteURL函数的具体用法?PHP acymailing_absoluteURL怎么用?PHP acymailing_absoluteURL使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了acymailing_absoluteURL函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: resizePictures
function resizePictures($input)
{
$this->destination = ACYMAILING_MEDIA . 'resized' . DS;
acymailing_createDir($this->destination);
$content = acymailing_absoluteURL($input);
preg_match_all('#<img([^>]*)>#Ui', $content, $results);
if (empty($results[1])) {
return $input;
}
$replace = array();
foreach ($results[1] as $onepicture) {
if (strpos($onepicture, 'donotresize') !== false) {
continue;
}
if (!preg_match('#src="([^"]*)"#Ui', $onepicture, $path)) {
continue;
}
$imageUrl = $path[1];
$base = str_replace(array('http://www.', 'https://www.', 'http://', 'https://'), '', ACYMAILING_LIVE);
$replacements = array('https://www.' . $base, 'http://www.' . $base, 'https://' . $base, 'http://' . $base);
foreach ($replacements as $oneReplacement) {
if (strpos($imageUrl, $oneReplacement) === false) {
continue;
}
$imageUrl = str_replace(array($oneReplacement, '/'), array(ACYMAILING_ROOT, DS), urldecode($imageUrl));
break;
}
$newPicture = $this->generateThumbnail($imageUrl);
if (!$newPicture) {
$newDimension = 'max-width:' . $this->maxWidth . 'px;max-height:' . $this->maxHeight . 'px;';
if (strpos($onepicture, 'style="') !== false) {
$replace[$onepicture] = preg_replace('#style="([^"]*)"#Uis', 'style="' . $newDimension . '$1"', $onepicture);
} else {
$replace[$onepicture] = ' style="' . $newDimension . '" ' . $onepicture;
}
continue;
}
$newPicture['file'] = preg_replace('#^' . preg_quote(ACYMAILING_ROOT, '#') . '#i', ACYMAILING_LIVE, $newPicture['file']);
$newPicture['file'] = str_replace(DS, '/', $newPicture['file']);
$replaceImage = array();
$replaceImage[$path[1]] = $newPicture['file'];
if (preg_match_all('#(width|height)(:|=) *"?([0-9]+)#i', $onepicture, $resultsSize)) {
foreach ($resultsSize[0] as $i => $oneArg) {
$newVal = strtolower($resultsSize[1][$i]) == 'width' ? $newPicture['width'] : $newPicture['height'];
if ($newVal > $resultsSize[3][$i]) {
continue;
}
$replaceImage[$oneArg] = str_replace($resultsSize[3][$i], $newVal, $oneArg);
}
}
$replace[$onepicture] = str_replace(array_keys($replaceImage), $replaceImage, $onepicture);
}
if (!empty($replace)) {
$input = str_replace(array_keys($replace), $replace, $content);
}
return $input;
}
示例2: resizePictures
function resizePictures($input)
{
$this->destination = ACYMAILING_MEDIA . 'resized' . DS;
acymailing_createDir($this->destination);
$content = acymailing_absoluteURL($input);
preg_match_all('#<img([^>]*)>#Ui', $content, $results);
if (empty($results[1])) {
return $input;
}
$replace = array();
foreach ($results[1] as $onepicture) {
if (!preg_match('#src="([^"]*)"#Ui', $onepicture, $path)) {
continue;
}
$imageUrl = $path[1];
$otheracymailinglive = str_replace('http://www.', 'http://', ACYMAILING_LIVE);
if ($otheracymailinglive == ACYMAILING_LIVE) {
$otheracymailinglive = str_replace('http://', 'http://www.', ACYMAILING_LIVE);
}
if (strpos($imageUrl, ACYMAILING_LIVE) !== false || strpos($imageUrl, $otheracymailinglive) !== false) {
$imageUrl = str_replace(array(ACYMAILING_LIVE, $otheracymailinglive, '/'), array(ACYMAILING_ROOT, ACYMAILING_ROOT, DS), urldecode($imageUrl));
}
$newPicture = $this->generateThumbnail($imageUrl);
if (!$newPicture) {
continue;
}
$newPicture['file'] = str_replace(array(ACYMAILING_ROOT, DS), array(ACYMAILING_LIVE, '/'), $newPicture['file']);
$replaceImage = array();
$replaceImage[$path[1]] = $newPicture['file'];
if (preg_match_all('#(width|height)(:|=) *"?([0-9]+)#i', $onepicture, $resultsSize)) {
foreach ($resultsSize[0] as $i => $oneArg) {
$newVal = strtolower($resultsSize[1][$i]) == 'width' ? $newPicture['width'] : $newPicture['height'];
if ($newVal > $resultsSize[3][$i]) {
continue;
}
$replaceImage[$oneArg] = str_replace($resultsSize[3][$i], $newVal, $oneArg);
}
}
$replace[$onepicture] = str_replace(array_keys($replaceImage), $replaceImage, $onepicture);
}
if (!empty($replace)) {
$input = str_replace(array_keys($replace), $replace, $content);
}
return $input;
}
示例3: form
function form()
{
$mailid = acymailing_getCID('mailid');
$templateClass = acymailing_get('class.template');
$config =& acymailing_config();
if (!empty($mailid)) {
$mailClass = acymailing_get('class.mail');
$mail = $mailClass->get($mailid);
if (!empty($mail->tempid)) {
$myTemplate = $templateClass->get($mail->tempid);
}
} else {
$mail = new stdClass();
$mail->created = time();
$mail->published = 0;
if ($this->type == 'followup') {
$mail->published = 1;
}
$mail->visible = 1;
$mail->html = 1;
$mail->body = '';
$mail->altbody = '';
$mail->tempid = 0;
$templateid = JRequest::getInt('templateid');
if (empty($templateid)) {
$myTemplate = $templateClass->getDefault();
} else {
$myTemplate = $templateClass->get($templateid);
}
if (!empty($myTemplate->tempid)) {
$mail->body = acymailing_absoluteURL($myTemplate->body);
$mail->altbody = $myTemplate->altbody;
$mail->tempid = $myTemplate->tempid;
$mail->subject = $myTemplate->subject;
$mail->replyname = $myTemplate->replyname;
$mail->replyemail = $myTemplate->replyemail;
$mail->fromname = $myTemplate->fromname;
$mail->fromemail = $myTemplate->fromemail;
}
if ($this->type == 'autonews') {
$mail->frequency = 604800;
}
}
$sentbyname = '';
if (!empty($mail->sentby)) {
$db = JFactory::getDBO();
$db->setQuery('SELECT `name` FROM `#__users` WHERE `id`= ' . intval($mail->sentby) . ' LIMIT 1');
$sentbyname = $db->loadResult();
}
$this->assignRef('sentbyname', $sentbyname);
if (JRequest::getVar('task', '') == 'replacetags') {
$mailerHelper = acymailing_get('helper.mailer');
JPluginHelper::importPlugin('acymailing');
$dispatcher = JDispatcher::getInstance();
$dispatcher->trigger('acymailing_replacetags', array(&$mail, false));
if (!empty($mail->altbody)) {
$mail->altbody = $mailerHelper->textVersion($mail->altbody, false);
}
}
$extraInfos = '';
$values = new stdClass();
if ($this->type == 'followup') {
$campaignid = JRequest::getInt('campaign', 0);
$extraInfos .= '&campaign=' . $campaignid;
$values->delay = acymailing_get('type.delay');
$this->assignRef('campaignid', $campaignid);
} else {
$listmailClass = acymailing_get('class.listmail');
$lists = $listmailClass->getLists($mailid);
}
acymailing_setTitle(JText::_($this->nameForm), $this->icon, $this->ctrl . '&task=edit&mailid=' . $mailid . $extraInfos);
$bar = JToolBar::getInstance('toolbar');
if (acymailing_isAllowed($config->get('acl_templates_view', 'all'))) {
$bar->appendButton('Acypopup', 'acytemplate', JText::_('ACY_TEMPLATE'), "index.php?option=com_acymailing&ctrl=template&task=theme&tmpl=component", 750, 550);
}
if (acymailing_isAllowed($config->get('acl_tags_view', 'all'))) {
$bar->appendButton('Acytags', $this->type);
}
if (in_array($this->type, array('news', 'followup')) && acymailing_isAllowed($config->get('acl_tags_view', 'all'))) {
JToolBarHelper::custom('replacetags', 'replacetag', '', JText::_('REPLACE_TAGS'), false);
}
$buttonPreview = JText::_('ACY_PREVIEW');
if ($this->type == 'news') {
$buttonPreview .= ' / ' . JText::_('SEND');
}
JToolBarHelper::divider();
JToolBarHelper::custom('savepreview', 'acypreview', '', $buttonPreview, false);
JToolBarHelper::save();
JToolBarHelper::apply();
JToolBarHelper::cancel();
JToolBarHelper::divider();
$bar->appendButton('Pophelp', $this->doc);
$values->maxupload = acymailing_bytes(ini_get('upload_max_filesize')) > acymailing_bytes(ini_get('post_max_size')) ? ini_get('post_max_size') : ini_get('upload_max_filesize');
$toggleClass = acymailing_get('helper.toggle');
$editor = acymailing_get('helper.editor');
$editor->setTemplate($mail->tempid);
$editor->name = 'editor_body';
$editor->content = $mail->body;
$editor->prepareDisplay();
$js = "function updateAcyEditor(htmlvalue){";
//.........这里部分代码省略.........
示例4: acymailing_absoluteURL
<?php
echo acymailing_absoluteURL(nl2br($row->description));
?>
</div>
<div style="display:none" id="stylesheet_<?php
echo $row->tempid;
?>
"><?php
echo $row->stylesheet;
?>
</div>
<div style="display:none" id="htmlcontent_<?php
echo $row->tempid;
?>
"><?php
echo acymailing_absoluteURL($row->body);
?>
</div>
<div style="display:none" id="textcontent_<?php
echo $row->tempid;
?>
"><?php
echo $row->altbody;
?>
</div>
<div style="display:none" id="subject_<?php
echo $row->tempid;
?>
"><?php
echo $row->subject;
?>
示例5: form
function form()
{
$tempid = acymailing_getCID('tempid');
$app =& JFactory::getApplication();
$config = acymailing_config();
if (!empty($tempid)) {
$templateClass = acymailing_get('class.template');
$template = $templateClass->get($tempid);
if (!empty($template->body)) {
$template->body = acymailing_absoluteURL($template->body);
}
} else {
$template->body = '';
$template->tempid = 0;
$template->published = 1;
}
$editor = acymailing_get('helper.editor');
$editor->setTemplate($template->tempid);
$editor->name = 'editor_body';
$editor->content = $template->body;
$editor->prepareDisplay();
if (version_compare(JVERSION, '1.6.0', '<')) {
$script = 'function submitbutton(pressbutton){
if (pressbutton == \'cancel\') {
submitform( pressbutton );
return;
}';
} else {
$script = 'Joomla.submitbutton = function(pressbutton) {
if (pressbutton == \'cancel\') {
Joomla.submitform(pressbutton,document.adminForm);
return;
}';
}
$script .= 'if(window.document.getElementById("name").value.length < 2){alert(\'' . JText::_('ENTER_TITLE', true) . '\'); return false;}';
$script .= "if(pressbutton == 'test' && window.document.getElementById('sendtest') && window.document.getElementById('sendtest').style.display == 'none'){ window.document.getElementById('sendtest').style.display = 'block'; return false;}";
$script .= $editor->jsCode();
if (version_compare(JVERSION, '1.6.0', '<')) {
$script .= 'submitform( pressbutton );} ';
} else {
$script .= 'Joomla.submitform(pressbutton,document.adminForm);}; ';
}
$script .= "function insertTag(tag){ try{jInsertEditorText(tag,'editor_body'); return true;} catch(err){alert('Your editor does not enable AcyMailing to automatically insert the tag, please copy/paste it manually in your Newsletter'); return false;}}";
$script .= 'function addStyle(){
var myTable=window.document.getElementById("classtable");
var newline = document.createElement(\'tr\');
var column = document.createElement(\'td\');
var column2 = document.createElement(\'td\');
var input = document.createElement(\'input\');
var input2 = document.createElement(\'input\');
input.type = \'text\';
input2.type = \'text\';
input.size = \'30\';
input2.size = \'50\';
input.name = \'otherstyles[classname][]\';
input2.name = \'otherstyles[style][]\';
input.value = "' . JText::_('CLASS_NAME', true) . '";
input2.value = "' . JText::_('CSS_STYLE', true) . '";
column.appendChild(input);
column2.appendChild(input2);
newline.appendChild(column);
newline.appendChild(column2);
myTable.appendChild(newline);
}';
$script .= 'var currentValueId = \'\';
function showthediv(valueid,e)
{
if(currentValueId != valueid){
try{
document.getElementById(\'wysija\').style.left = e.pageX-50+"px";
document.getElementById(\'wysija\').style.top = e.pageY-40+"px";
}catch(err){
document.getElementById(\'wysija\').style.left = e.x-50+"px";
document.getElementById(\'wysija\').style.top = e.y-40+"px";
}
currentValueId = valueid;
}
document.getElementById(\'wysija\').style.display = \'block\';
initDiv();
}
function spanChange(span)
{
input = currentValueId;
if (document.getElementById(span).className == span.toLowerCase()+"elementselected")
{
document.getElementById(span).className = span.toLowerCase()+"element";
if(span == "B"){
document.getElementById("name_"+currentValueId).style.fontWeight = "";
document.getElementById("style_"+currentValueId).value = document.getElementById("style_"+currentValueId).value.replace(/font-weight *: *bold(;)?/i, "");
}
if(span == "I"){
document.getElementById("name_"+currentValueId).style.fontStyle = "";
document.getElementById("style_"+currentValueId).value = document.getElementById("style_"+currentValueId).value.replace(/font-style *: *italic(;)?/i, "");
}
if(span == "U"){
document.getElementById("name_"+currentValueId).style.textDecoration="";
document.getElementById("style_"+currentValueId).value = document.getElementById("style_"+currentValueId).value.replace(/text-decoration *: *underline(;)?/i,"");
}
}
else{
//.........这里部分代码省略.........
示例6: acymailing_replaceusertags
public function acymailing_replaceusertags(&$email, &$user, $send = true)
{
if (!$email->sendHTML) {
return;
}
$this->_applyTemplate($email, $send);
$email->body = preg_replace('#< *(tr|td|table)([^>]*)(style="[^"]*)background-image *: *url\\(\'?([^)\']*)\'?\\);?#Ui', '<$1 background="$4" $2 $3', $email->body);
$email->body = acymailing_absoluteURL($email->body);
$email->body = preg_replace('#< *img([^>]*)(style="[^"]*)(float *: *)(right|left|top|bottom|middle)#Ui', '<img$1 align="$4" hspace="5" $2$3$4', $email->body);
if (!preg_match('#(<thead|<tfoot|< *tbody *[^> ]+ *>)#Ui', $email->body)) {
$email->body = preg_replace('#< *\\/? *tbody *>#Ui', '', $email->body);
}
$email->body = preg_replace_callback('/src="([^"]* [^"]*)"/Ui', array($this, '_convertSpaces'), $email->body);
$this->fixPictureSize($email->body);
$acypluginsHelper = acymailing_get('helper.acyplugins');
$acypluginsHelper->fixPictureDim($email->body);
}
示例7: textVersion
public function textVersion($html, $fullConvert = true)
{
$html = acymailing_absoluteURL($html);
if ($fullConvert) {
$html = preg_replace('# +#', ' ', $html);
$html = str_replace(array("\n", "\r", "\t"), '', $html);
}
$removepictureslinks = "#< *a[^>]*> *< *img[^>]*> *< *\\/ *a *>#isU";
$removeScript = "#< *script(?:(?!< */ *script *>).)*< */ *script *>#isU";
$removeStyle = "#< *style(?:(?!< */ *style *>).)*< */ *style *>#isU";
$removeStrikeTags = '#< *strike(?:(?!< */ *strike *>).)*< */ *strike *>#iU';
$replaceByTwoReturnChar = '#< *(h1|h2)[^>]*>#Ui';
$replaceByStars = '#< *li[^>]*>#Ui';
$replaceByReturnChar1 = '#< */ *(li|td|dt|tr|div|p)[^>]*> *< *(li|td|dt|tr|div|p)[^>]*>#Ui';
$replaceByReturnChar = '#< */? *(br|p|h1|h2|legend|h3|li|ul|dd|dt|h4|h5|h6|tr|td|div)[^>]*>#Ui';
$replaceLinks = '/< *a[^>]*href *= *"([^#][^"]*)"[^>]*>(.+)< *\\/ *a *>/Uis';
$text = preg_replace(array($removepictureslinks, $removeScript, $removeStyle, $removeStrikeTags, $replaceByTwoReturnChar, $replaceByStars, $replaceByReturnChar1, $replaceByReturnChar, $replaceLinks), array('', '', '', '', "\n\n", "\n* ", "\n", "\n", '${2} ( ${1} )'), $html);
$text = preg_replace('#(<|&\\#60;)([^ \\n\\r\\t])#i', '< ${2}', $text);
$text = str_replace(array(" ", " "), ' ', strip_tags($text));
$text = trim(@html_entity_decode($text, ENT_QUOTES, 'UTF-8'));
if ($fullConvert) {
$text = preg_replace('# +#', ' ', $text);
$text = preg_replace('#\\n *\\n\\s+#', "\n\n", $text);
}
return $text;
}
示例8: test
function test()
{
if (!$this->isAllowed($this->aclCat, 'manage')) {
return;
}
$this->store();
$tempid = acymailing_getCID('tempid');
$test_selection = JRequest::getVar('test_selection', '', '', 'string');
if (empty($tempid) or empty($test_selection)) {
return;
}
$mailer = acymailing_get('helper.mailer');
$mailer->report = true;
$config = acymailing_config();
$subscriberClass = acymailing_get('class.subscriber');
$userHelper = acymailing_get('helper.user');
JPluginHelper::importPlugin('acymailing');
$dispatcher = JDispatcher::getInstance();
$receivers = array();
if ($test_selection == 'users') {
$receiverEntry = JRequest::getVar('test_emails', '', '', 'string');
if (!empty($receiverEntry)) {
if (substr_count($receiverEntry, '@') > 1) {
$receivers = explode(',', trim(preg_replace('# +#', '', $receiverEntry)));
} else {
$receivers[] = trim($receiverEntry);
}
}
} else {
$gid = JRequest::getInt('test_group', '-1');
if ($gid == -1) {
return false;
}
$db = JFactory::getDBO();
if (!ACYMAILING_J16) {
$db->setQuery('SELECT email FROM ' . acymailing_table('users', false) . ' WHERE gid = ' . intval($gid));
} else {
$db->setQuery('SELECT u.email FROM ' . acymailing_table('users', false) . ' AS u JOIN ' . acymailing_table('user_usergroup_map', false) . ' AS ugm ON u.id = ugm.user_id WHERE ugm.group_id = ' . intval($gid));
}
$receivers = acymailing_loadResultArray($db);
}
if (empty($receivers)) {
acymailing_enqueueMessage(JText::_('NO_SUBSCRIBER'), 'notice');
return $this->edit();
}
$classTemplate = acymailing_get('class.template');
$myTemplate = $classTemplate->get($tempid);
$myTemplate->sendHTML = 1;
$myTemplate->mailid = 0;
$myTemplate->template = $myTemplate;
if (empty($myTemplate->subject)) {
$myTemplate->subject = $myTemplate->name;
}
if (empty($myTemplate->altBody)) {
$myTemplate->altbody = $mailer->textVersion($myTemplate->body);
}
$dispatcher->trigger('acymailing_replacetags', array(&$myTemplate, true));
$myTemplate->body = acymailing_absoluteURL($myTemplate->body);
$result = true;
foreach ($receivers as $receiveremail) {
$copy = $myTemplate;
$mailer->clearAll();
$mailer->setFrom($copy->fromemail, $copy->fromname);
if (!empty($copy->replyemail)) {
$replyToName = $config->get('add_names', true) ? $mailer->cleanText($copy->replyname) : '';
$mailer->AddReplyTo($mailer->cleanText($copy->replyemail), $replyToName);
}
$receiver = $subscriberClass->get($receiveremail);
if (empty($receiver->subid)) {
if ($userHelper->validEmail($receiveremail)) {
$newUser = new stdClass();
$newUser->email = $receiveremail;
$subscriberClass->sendConf = false;
$subid = $subscriberClass->save($newUser);
$receiver = $subscriberClass->get($subid);
}
if (empty($receiver->subid)) {
continue;
}
}
$addedName = $config->get('add_names', true) ? $mailer->cleanText($receiver->name) : '';
$mailer->AddAddress($mailer->cleanText($receiver->email), $addedName);
$dispatcher->trigger('acymailing_replaceusertags', array(&$copy, &$receiver, true));
$mailer->isHTML(true);
$mailer->Body = $copy->body;
$mailer->Subject = $copy->subject;
if ($config->get('multiple_part', false)) {
$mailer->AltBody = $copy->altbody;
}
$mailer->send();
}
return $this->edit();
}
示例9: absoluteURL
static function absoluteURL($text)
{
return acymailing_absoluteURL($text);
}
示例10: form
function form()
{
$this->chosen = false;
$app = JFactory::getApplication();
$mailid = acymailing_getCID('mailid');
$templateClass = acymailing_get('class.template');
$config =& acymailing_config();
$my = JFactory::getUser();
if (!empty($mailid)) {
$mailClass = acymailing_get('class.mail');
$mail = $mailClass->get($mailid);
if (!empty($mail->tempid)) {
$myTemplate = $templateClass->get($mail->tempid);
}
if (empty($mail->mailid)) {
acymailing_display('Newsletter ' . $mailid . ' not found', 'error');
$mailid = 0;
}
}
if (empty($mailid)) {
$mail = new stdClass();
$mail->created = time();
$mail->published = 0;
$mail->thumb = '';
if ($this->type == 'followup') {
$mail->published = 1;
}
$mail->visible = 1;
$mail->html = 1;
$mail->body = '';
$mail->altbody = '';
$mail->tempid = 0;
$templateid = JRequest::getInt('templateid');
if (empty($templateid) and !empty($my->email)) {
$subscriberClass = acymailing_get('class.subscriber');
$currentSubscriber = $subscriberClass->get($my->email);
if (!empty($currentSubscriber->template)) {
$templateid = $currentSubscriber->template;
}
}
if (empty($templateid)) {
$myTemplate = $templateClass->getDefault();
} else {
$myTemplate = $templateClass->get($templateid);
}
if (!empty($myTemplate->tempid)) {
$mail->body = acymailing_absoluteURL($myTemplate->body);
$mail->altbody = $myTemplate->altbody;
$mail->tempid = $myTemplate->tempid;
$mail->subject = $myTemplate->subject;
$mail->replyname = $myTemplate->replyname;
$mail->replyemail = $myTemplate->replyemail;
$mail->fromname = $myTemplate->fromname;
$mail->fromemail = $myTemplate->fromemail;
}
if ($this->type == 'autonews') {
$mail->frequency = 0;
}
if (!$app->isAdmin()) {
if ($config->get('frontend_sender', 0)) {
$mail->fromname = $my->name;
$mail->fromemail = $my->email;
} else {
if (empty($mail->fromname)) {
$mail->fromname = $config->get('from_name');
}
if (empty($mail->fromemail)) {
$mail->fromemail = $config->get('from_email');
}
}
if ($config->get('frontend_reply', 0)) {
$mail->replyname = $my->name;
$mail->replyemail = $my->email;
} else {
if (empty($mail->replyname)) {
$mail->replyname = $config->get('reply_name');
}
if (empty($mail->replyemail)) {
$mail->replyemail = $config->get('reply_email');
}
}
}
}
$sentbyname = '';
if (!empty($mail->sentby)) {
$db = JFactory::getDBO();
$db->setQuery('SELECT `name` FROM `#__users` WHERE `id`= ' . intval($mail->sentby) . ' LIMIT 1');
$sentbyname = $db->loadResult();
}
$this->assignRef('sentbyname', $sentbyname);
if (JRequest::getVar('task', '') == 'replacetags') {
$mailerHelper = acymailing_get('helper.mailer');
$templateClass = acymailing_get('class.template');
$mail->template = $templateClass->get($mail->tempid);
JPluginHelper::importPlugin('acymailing');
$mailerHelper->triggerTagsWithRightLanguage($mail, false);
if (!empty($mail->altbody)) {
$mail->altbody = $mailerHelper->textVersion($mail->altbody, false);
}
}
//.........这里部分代码省略.........
示例11: acymailing_replaceusertags
public function acymailing_replaceusertags(&$email, &$user, $send = true)
{
if (!$email->sendHTML) {
return;
}
if (!acymailing_level(1) && !empty($email->type) && $email->type == 'news') {
$pict = '<div style="text-align:center;margin:10px auto;display:block;"><a target="_blank" href="https://www.acyba.com"><img alt="Powered by AcyMailing" src="media/com_acymailing/images/poweredby.png" /></a></div>';
if (strpos($email->body, '</body>')) {
$email->body = str_replace('</body>', $pict . '</body>', $email->body);
} else {
$email->body .= $pict;
}
}
$this->_applyTemplate($email, $send);
$email->body = preg_replace('#< *(tr|td|table)([^>]*)(style="[^"]*)background-image *: *url\\(\'?([^)\']*)\'?\\);?#Ui', '<$1 background="$4" $2 $3', $email->body);
$email->body = acymailing_absoluteURL($email->body);
if (preg_match_all('#< *img([^>]*)>#Ui', $email->body, $allPictures)) {
foreach ($allPictures[0] as $i => $onePict) {
if (strpos($onePict, 'align=') !== false) {
continue;
}
if (!preg_match('#(style="[^"]*)(float *: *)(right|left|top|bottom|middle)#Ui', $onePict, $pictParams)) {
continue;
}
$newPict = str_replace('<img', '<img align="' . $pictParams[3] . '" ', $onePict);
$email->body = str_replace($onePict, $newPict, $email->body);
if (strpos($onePict, 'hspace=') !== false) {
continue;
}
$hspace = 5;
if (preg_match('#margin(-right|-left)? *:([^";]*)#i', $onePict, $margins)) {
$currentMargins = explode(' ', trim($margins[2]));
$myMargin = count($currentMargins) > 1 ? $currentMargins[1] : $currentMargins[0];
if (strpos($myMargin, 'px') !== false) {
$hspace = preg_replace('#[^0-9]#i', '', $myMargin);
}
}
$lastPict = str_replace('<img', '<img hspace="' . $hspace . '" ', $newPict);
$email->body = str_replace($newPict, $lastPict, $email->body);
}
}
if (!preg_match('#(<thead|<tfoot|< *tbody *[^> ]+ *>)#Ui', $email->body)) {
$email->body = preg_replace('#< *\\/? *tbody *>#Ui', '', $email->body);
}
$email->body = preg_replace_callback('/src="([^"]* [^"]*)"/Ui', array($this, '_convertSpaces'), $email->body);
$this->fixPictureSize($email->body);
$acypluginsHelper = acymailing_get('helper.acyplugins');
$acypluginsHelper->fixPictureDim($email->body);
}
示例12: strip_tags
echo ACYMAILING_LIVE . strip_tags($row->thumb);
?>
" style="float:left;width:100px;margin-right:10px;" />
</a>
<?php
}
?>
<a href="<?php
echo acymailing_completeLink('template&task=edit&tempid=' . $row->tempid);
?>
"><?php
echo $row->name;
?>
</a><br/>
<?php
echo acymailing_absoluteURL($row->description);
?>
</td>
<td class="order" style="text-align:center;">
<span><?php
echo $this->pagination->orderUpIcon($i, $this->order->reverse xor $row->ordering >= @$this->rows[$i - 1]->ordering, $this->order->orderUp, 'Move Up', $this->order->ordering);
?>
</span>
<span><?php
echo $this->pagination->orderDownIcon($i, $a, $this->order->reverse xor $row->ordering <= @$this->rows[$i + 1]->ordering, $this->order->orderDown, 'Move Down', $this->order->ordering);
?>
</span>
<input type="text" name="order[]" size="5" <?php
if (!$this->order->ordering) {
echo 'disabled="disabled"';
}
示例13: handlepict
function handlepict(&$content, $templatepath)
{
$content = acymailing_absoluteURL($content);
if (!preg_match_all('#<img[^>]*src="([^"]*)"#i', $content, $pictures)) {
return true;
}
$pictFolder = rtrim($templatepath, DS) . DS . 'images';
if (!acymailing_createDir($pictFolder)) {
return false;
}
$replace = array();
foreach ($pictures[1] as $onePict) {
if (isset($replace[$onePict])) {
continue;
}
$location = str_replace(array(ACYMAILING_LIVE, '/'), array(ACYMAILING_ROOT, DS), $onePict);
if (strpos($location, 'http') === 0) {
continue;
}
if (!file_exists($location)) {
continue;
}
$filename = basename($location);
while (file_exists($pictFolder . DS . $filename)) {
$filename = rand(0, 99) . $filename;
}
if (JFile::copy($location, $pictFolder . DS . $filename) !== true) {
acymailing_display('Could not copy the file from ' . $location . ' to ' . $pictFolder . DS . $filename, 'error');
return false;
}
$replace[$onePict] = 'images/' . $filename;
}
$content = str_replace(array_keys($replace), $replace, $content);
return true;
}
示例14: acymailing_replaceusertags
public function acymailing_replaceusertags(&$email, &$user, $send = true)
{
if (!$email->sendHTML) {
return;
}
$this->_applyTemplate($email, $send);
$email->body = preg_replace('#< *(tr|td|table)([^>]*)(style="[^"]*)background-image *: *url\\(\'?([^)\']*)\'?\\);?#Ui', '<$1 background="$4" $2 $3', $email->body);
$email->body = acymailing_absoluteURL($email->body);
if (preg_match_all('#< *img([^>]*)>#Ui', $email->body, $allPictures)) {
foreach ($allPictures[0] as $i => $onePict) {
if (strpos($onePict, 'align=') !== false) {
continue;
}
if (!preg_match('#(style="[^"]*)(float *: *)(right|left|top|bottom|middle)#Ui', $onePict, $pictParams)) {
continue;
}
$newPict = str_replace('<img', '<img align="' . $pictParams[3] . '" ', $onePict);
$email->body = str_replace($onePict, $newPict, $email->body);
if (strpos($onePict, 'hspace=') !== false) {
continue;
}
$hspace = 5;
if (preg_match('#margin(-right|-left)? *:([^";]*)#i', $onePict, $margins)) {
$currentMargins = explode(' ', trim($margins[2]));
$myMargin = count($currentMargins) > 1 ? $currentMargins[1] : $currentMargins[0];
if (strpos($myMargin, 'px') !== false) {
$hspace = preg_replace('#[^0-9]#i', '', $myMargin);
}
}
$lastPict = str_replace('<img', '<img hspace="' . $hspace . '" ', $newPict);
$email->body = str_replace($newPict, $lastPict, $email->body);
}
}
if (!preg_match('#(<thead|<tfoot|< *tbody *[^> ]+ *>)#Ui', $email->body)) {
$email->body = preg_replace('#< *\\/? *tbody *>#Ui', '', $email->body);
}
$email->body = preg_replace_callback('/src="([^"]* [^"]*)"/Ui', array($this, '_convertSpaces'), $email->body);
$this->fixPictureSize($email->body);
$acypluginsHelper = acymailing_get('helper.acyplugins');
$acypluginsHelper->fixPictureDim($email->body);
}
示例15: rtrim
echo rtrim(JURI::root(), '/') . '/' . strip_tags($row->thumb);
?>
" style="float:left;width:100px;margin-right:10px;"/>
</a>
<?php
}
?>
<a href="<?php
echo acymailing_completeLink('template&task=edit&tempid=' . $row->tempid);
?>
"><?php
echo acymailing_dispSearch($row->name, $this->pageInfo->search);
?>
</a><br/>
<?php
echo acymailing_absoluteURL(nl2br($row->description));
?>
</td>
<?php
if (!ACYMAILING_J30) {
?>
<td class="order" style="text-align:center;">
<span><?php
echo $this->pagination->orderUpIcon($i, $this->order->reverse xor $row->ordering >= @$this->rows[$i - 1]->ordering, $this->order->orderUp, 'Move Up', $this->order->ordering);
?>
</span>
<span><?php
echo $this->pagination->orderDownIcon($i, $a, $this->order->reverse xor $row->ordering <= @$this->rows[$i + 1]->ordering, $this->order->orderDown, 'Move Down', $this->order->ordering);
?>
</span>
<input type="text" name="order[]" size="5" <?php