本文整理汇总了PHP中acymailing::frontendLink方法的典型用法代码示例。如果您正苦于以下问题:PHP acymailing::frontendLink方法的具体用法?PHP acymailing::frontendLink怎么用?PHP acymailing::frontendLink使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类acymailing
的用法示例。
在下文中一共展示了acymailing::frontendLink方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: acymailing_replaceusertags
function acymailing_replaceusertags(&$email, &$user)
{
if (!empty($email->altbody)) {
$email->altbody = str_replace(array('{statpicture}', '{nostatpicture}'), '', $email->altbody);
}
if (!$email->sendHTML or empty($email->type) or !in_array($email->type, array('news', 'autonews', 'followup')) or strpos($email->body, '{nostatpicture}')) {
$email->body = str_replace(array('{statpicture}', '{nostatpicture}'), '', $email->body);
return;
}
if (empty($user->subid)) {
return $this->acymailing_replaceusertagspreview($email, $user);
}
$widthsize = $this->params->get('width', 50);
$heightsize = $this->params->get('height', 1);
$width = empty($widthsize) ? '' : ' width="' . $widthsize . '" ';
$height = empty($heightsize) ? '' : ' height="' . $heightsize . '" ';
$statPicture = '<img alt="' . $this->params->get('alttext', '') . '" src="' . acymailing::frontendLink('index.php?option=com_acymailing&ctrl=stats&mailid=' . $email->mailid . '&subid=' . $user->subid) . '" border="0" ' . $height . $width . '/>';
if (strpos($email->body, '{statpicture}')) {
$email->body = str_replace('{statpicture}', $statPicture, $email->body);
} elseif (strpos($email->body, '</body>')) {
$email->body = str_replace('</body>', $statPicture . '</body>', $email->body);
} else {
$email->body .= $statPicture;
}
}
示例2: acymailing_replacetags
function acymailing_replacetags(&$email)
{
$match = '#{share:(.*)}#Ui';
$variables = array('body', 'altbody');
$found = false;
$results = array();
foreach ($variables as $var) {
if (empty($email->{$var})) {
continue;
}
$found = preg_match_all($match, $email->{$var}, $results[$var]) || $found;
if (empty($results[$var][0])) {
unset($results[$var]);
}
}
if (!$found) {
return;
}
$archiveLink = acymailing::frontendLink('index.php?option=com_acymailing&ctrl=archive&task=view&mailid=' . $email->mailid, $this->params->get('template') == 'component' ? true : false);
$tags = array();
foreach ($results as $var => $allresults) {
foreach ($allresults[0] as $i => $tagname) {
if (isset($tags[$tagname])) {
continue;
}
$arguments = explode('|', $allresults[1][$i]);
$tag = null;
$tag->network = $arguments[0];
for ($i = 1, $a = count($arguments); $i < $a; $i++) {
$args = explode(':', $arguments[$i]);
if (isset($args[1])) {
$tag->{$args}[0] = $args[1];
} else {
$tag->{$args}[0] = true;
}
}
if ($tag->network == 'facebook') {
$tags[$tagname] = '<a target="_blank" href="http://www.facebook.com/sharer.php?u=' . urlencode($archiveLink) . '&t=' . urlencode($email->subject) . '" title="' . JText::sprintf('SOCIAL_SHARE', 'Facebook') . '"><img src="' . ACYMAILING_LIVE . $this->params->get('picturefb', 'media/com_acymailing/images/fbshare.gif') . '" /></a>';
} elseif ($tag->network == 'twitter') {
$text = JText::sprintf('SHARE_TEXT', $archiveLink);
$tags[$tagname] = '<a target="_blank" href="http://twitter.com/home?status=' . urlencode($text) . '" title="' . JText::sprintf('SOCIAL_SHARE', 'Twitter') . '"><img src="' . ACYMAILING_LIVE . $this->params->get('picturetwitter', 'media/com_acymailing/images/twittershare.png') . '" /></a>';
} elseif ($tag->network == 'linkedin') {
$tags[$tagname] = '<a target="_blank" href="http://www.linkedin.com/shareArticle?mini=true&url=' . urlencode($archiveLink) . '&title=' . urlencode($email->subject) . '" title="' . JText::sprintf('SOCIAL_SHARE', 'LinkedIn') . '"><img src="' . ACYMAILING_LIVE . $this->params->get('picturelinkedin', 'media/com_acymailing/images/linkedin.png') . '" /></a>';
}
}
}
$email->body = str_replace(array_keys($tags), $tags, $email->body);
$email->altbody = str_replace(array_keys($tags), '', $email->altbody);
}
示例3: getUrl
function getUrl($url, $mailid, $subid)
{
static $allurls;
$url = str_replace('&', '&', $url);
if (empty($allurls[$url])) {
$currentURL = $this->get($url);
if (empty($currentURL->urlid)) {
$currentURL = null;
$currentURL->url = $url;
$currentURL->name = $url;
$currentURL->urlid = $this->save($currentURL);
}
$allurls[$url] = $currentURL;
} else {
$currentURL = $allurls[$url];
}
$config = acymailing::config();
$itemId = $config->get('itemid', 0);
$item = empty($itemId) ? '' : '&Itemid=' . $itemId;
return str_replace('&', '&', acymailing::frontendLink('index.php?option=com_acymailing&ctrl=url&urlid=' . $currentURL->urlid . '&mailid=' . $mailid . '&subid=' . $subid . $item));
}
示例4: acymailing_replaceusertags
function acymailing_replaceusertags(&$email, &$user)
{
$match = '#{(readonline|forward)}(.*){/(readonline|forward)}#Uis';
$variables = array('body', 'altbody');
$found = false;
foreach ($variables as $var) {
if (empty($email->{$var})) {
continue;
}
$found = preg_match_all($match, $email->{$var}, $results[$var]) || $found;
if (empty($results[$var][0])) {
unset($results[$var]);
}
}
if (!$found) {
return;
}
$config = acymailing::config();
$itemId = $config->get('itemid', 0);
$item = empty($itemId) ? '' : '&Itemid=' . $itemId;
$tags = array();
$tmplview = '';
$tmplforward = '';
if (!empty($email->key) and $this->params->get('addkey', 'yes') == 'yes') {
$tmplview .= '&key=' . $email->key;
$tmplforward .= '&key=' . $email->key;
}
if (!empty($user->key) and $this->params->get('adduserkey', 'yes') == 'yes') {
$tmplview .= '&subid=' . $user->subid . '-' . $user->key;
$tmplforward .= '&subid=' . $user->subid . '-' . $user->key;
}
if ($this->params->get('viewtemplate', 'standard') == 'notemplate') {
$tmplview .= '&tmpl=component';
}
if ($this->params->get('forwardtemplate', 'standard') == 'notemplate') {
$tmplforward .= '&tmpl=component';
}
foreach ($results as $var => $allresults) {
foreach ($allresults[0] as $i => $oneTag) {
if (isset($tags[$oneTag])) {
continue;
}
if ($allresults[1][$i] == 'readonline') {
$link = acymailing::frontendLink('index.php?option=com_acymailing&ctrl=archive&task=view&mailid=' . $email->mailid . $tmplview . $item);
} elseif ($allresults[1][$i] == 'forward') {
$link = acymailing::frontendLink('index.php?option=com_acymailing&ctrl=archive&task=forward&mailid=' . $email->mailid . $tmplforward . $item);
}
if (empty($allresults[2][$i])) {
$tags[$oneTag] = $link;
} else {
$tags[$oneTag] = '<a style="text-decoration:none;" href="' . $link . '"><span class="acymailing_online">' . $allresults[2][$i] . '</span></a>';
}
}
}
$email->body = str_replace(array_keys($tags), $tags, $email->body);
if (!empty($email->altbody)) {
$email->altbody = str_replace(array_keys($tags), $tags, $email->altbody);
}
}
示例5: _replaceContent
function _replaceContent(&$results, $i)
{
$arguments = explode('|', strip_tags($results[1][$i]));
$tag = null;
$tag->id = (int) $arguments[0];
for ($i = 1, $a = count($arguments); $i < $a; $i++) {
$args = explode(':', $arguments[$i]);
if (isset($args[1])) {
$tag->{$args}[0] = $args[1];
} else {
$tag->{$args}[0] = true;
}
}
if (version_compare(JVERSION, '1.6.0', '<')) {
$query = 'SELECT a.*,b.name as authorname, c.alias as catalias, c.title as cattitle, s.alias as secalias, s.title as sectitle FROM ' . acymailing::table('content', false) . ' as a ';
$query .= 'LEFT JOIN ' . acymailing::table('users', false) . ' as b ON a.created_by = b.id ';
$query .= ' LEFT JOIN ' . acymailing::table('categories', false) . ' AS c ON c.id = a.catid ';
$query .= ' LEFT JOIN ' . acymailing::table('sections', false) . ' AS s ON s.id = a.sectionid ';
$query .= 'WHERE a.id = ' . $tag->id . ' LIMIT 1';
} else {
$query = 'SELECT a.*,b.name as authorname, c.alias as catalias, c.title as cattitle FROM ' . acymailing::table('content', false) . ' as a ';
$query .= 'LEFT JOIN ' . acymailing::table('users', false) . ' as b ON a.created_by = b.id ';
$query .= ' LEFT JOIN ' . acymailing::table('categories', false) . ' AS c ON c.id = a.catid ';
$query .= 'WHERE a.id = ' . $tag->id . ' LIMIT 1';
}
$db =& JFactory::getDBO();
$db->setQuery($query);
$article = $db->loadObject();
$result = '';
if (empty($article)) {
$app =& JFactory::getApplication();
if ($app->isAdmin()) {
$app->enqueueMessage('The article "' . $tag->id . '" could not be loaded', 'notice');
}
return $result;
}
if (!empty($tag->lang)) {
$langid = (int) substr($tag->lang, strpos($tag->lang, ',') + 1);
if (!empty($langid)) {
$query = "SELECT reference_field, value FROM `#__jf_content` WHERE `published` = 1 AND `reference_table` = 'content' AND `language_id` = {$langid} AND `reference_id` = " . $tag->id;
$db->setQuery($query);
$translations = $db->loadObjectList();
if (!empty($translations)) {
foreach ($translations as $oneTranslation) {
if (!empty($oneTranslation->value)) {
$translatedfield = $oneTranslation->reference_field;
$article->{$translatedfield} = $oneTranslation->value;
}
}
}
}
}
if ($this->params->get('integration') == 'jreviews' and !empty($article->images)) {
$firstpict = explode('|', trim(reset(explode("\n", $article->images))) . '|||||||');
if (!empty($firstpict[0])) {
$myPict = '<img src="' . ACYMAILING_LIVE . 'images/stories/' . $firstpict[0] . '" hspace="5" style="margin:5px" align="left" border="' . intval($firstpict[5]) . '" />';
$article->introtext = $myPict . $article->introtext;
}
}
$completeId = $article->id;
$completeCat = $article->catid;
if (!empty($article->alias)) {
$completeId .= ':' . $article->alias;
}
if (!empty($article->catalias)) {
$completeCat .= ':' . $article->catalias;
}
if (version_compare(JVERSION, '1.6.0', '<')) {
$completeSec = $article->sectionid;
if (!empty($article->secalias)) {
$completeSec .= ':' . $article->secalias;
}
$link = ContentHelperRoute::getArticleRoute($completeId, $completeCat, $completeSec);
} else {
$link = ContentHelperRoute::getArticleRoute($completeId, $completeCat);
}
if ($this->params->get('integration') == 'flexicontent') {
$link = 'index.php?option=com_flexicontent&view=items&id=' . $completeId;
}
if (!empty($tag->lang)) {
$link .= (strpos($link, '?') ? '&' : '?') . 'lang=' . substr($tag->lang, 0, strpos($tag->lang, ','));
}
$link = acymailing::frontendLink($link);
$styleTitle = '';
$styleTitleEnd = '';
if ($tag->type != "title") {
$styleTitle = '<h2 class="acymailing_title">';
$styleTitleEnd = '</h2>';
}
if (empty($tag->notitle)) {
if (!empty($tag->link)) {
$result .= '<a href="' . $link . '" ';
if ($tag->type != "title") {
$result .= 'style="text-decoration:none" name="content-' . $article->id . '" ';
}
$result .= 'target="_blank" >' . $styleTitle . $article->title . $styleTitleEnd . '</a>';
} else {
$result .= $styleTitle . $article->title . $styleTitleEnd;
}
}
//.........这里部分代码省略.........
示例6: replaceSubscriptionTag
function replaceSubscriptionTag(&$allresults, $i, &$user, &$email)
{
if (empty($user->subid)) {
return '';
}
if (empty($user->key)) {
$user->key = md5(substr($user->email, 0, strpos($user->email, '@')) . time());
$db = JFactory::getDBO();
$db->setQuery('UPDATE ' . acymailing::table('subscriber') . ' SET `key`= ' . $db->Quote($user->key) . ' WHERE subid = ' . (int) $user->subid . ' LIMIT 1');
$db->query();
}
$config = acymailing::config();
$itemId = $config->get('itemid', 0);
$item = empty($itemId) ? '' : '&Itemid=' . $itemId;
if ($allresults[1][$i] == 'confirm') {
//confirm your subscription link
$myLink = acymailing::frontendLink('index.php?option=com_acymailing&ctrl=user&task=confirm&subid=' . $user->subid . '&key=' . $user->key . $item);
if (empty($allresults[2][$i])) {
$allresults[2][$i] = $myLink;
}
return '<a target="_blank" href="' . $myLink . '">' . $allresults[2][$i] . '</a>';
} elseif ($allresults[1][$i] == 'modify') {
//modify your subscription link
$myLink = acymailing::frontendLink('index.php?option=com_acymailing&ctrl=user&task=modify&subid=' . $user->subid . '&key=' . $user->key . $item);
if (empty($allresults[2][$i])) {
$allresults[2][$i] = $myLink;
}
return '<a style="text-decoration:none;" target="_blank" href="' . $myLink . '"><span class="acymailing_unsub">' . $allresults[2][$i] . '</span></a>';
}
//unsubscribe link
$myLink = acymailing::frontendLink('index.php?option=com_acymailing&ctrl=user&task=unsub&mailid=' . $email->mailid . '&subid=' . $user->subid . '&key=' . $user->key . $item);
if (empty($allresults[2][$i])) {
$allresults[2][$i] = $myLink;
}
$email->customHeaders['list-unsub'] = 'List-Unsubscribe: <' . $myLink . '>';
return '<a style="text-decoration:none;" target="_blank" href="' . $myLink . '"><span class="acymailing_unsub">' . $allresults[2][$i] . '</span></a>';
}
示例7: _replaceContent
function _replaceContent(&$results, $i)
{
$arguments = explode('|', strip_tags($results[1][$i]));
$tag = null;
$tag->id = (int) $arguments[0];
for ($i = 1, $a = count($arguments); $i < $a; $i++) {
$args = explode(':', $arguments[$i]);
if (isset($args[1])) {
$tag->{$args}[0] = $args[1];
} else {
$tag->{$args}[0] = true;
}
}
$query = 'SELECT a.*,b.name as authorname, c.alias as catalias, c.title as cattitle, s.alias as secalias, s.title as sectitle FROM ' . acymailing::table('content', false) . ' as a ';
$query .= 'LEFT JOIN ' . acymailing::table('users', false) . ' as b ON a.created_by = b.id ';
$query .= ' LEFT JOIN ' . acymailing::table('categories', false) . ' AS c ON c.id = a.catid ';
$query .= ' LEFT JOIN ' . acymailing::table('sections', false) . ' AS s ON s.id = a.sectionid ';
$query .= 'WHERE a.id = ' . $tag->id . ' LIMIT 1';
$db =& JFactory::getDBO();
$db->setQuery($query);
$article = $db->loadObject();
$result = null;
$result->text = '';
$result->html = '';
if (empty($article)) {
$app =& JFactory::getApplication();
if ($app->isAdmin()) {
$app->enqueueMessage('The article "' . $tag->id . '" could not be loaded', 'notice');
}
return $result;
}
if (!empty($tag->lang)) {
$langid = (int) substr($tag->lang, strpos($tag->lang, ',') + 1);
if (!empty($langid)) {
$query = "SELECT reference_field, value FROM `#__jf_content` WHERE `published` = 1 AND `reference_table` = 'content' AND `language_id` = {$langid} AND `reference_id` = " . $tag->id;
$db->setQuery($query);
$translations = $db->loadObjectList();
if (!empty($translations)) {
foreach ($translations as $oneTranslation) {
if (!empty($oneTranslation->value)) {
$translatedfield = $oneTranslation->reference_field;
$article->{$translatedfield} = $oneTranslation->value;
}
}
}
}
}
$completeId = $article->id;
$completeCat = $article->catid;
$completeSec = $article->sectionid;
if (!empty($article->alias)) {
$completeId .= ':' . $article->alias;
}
if (!empty($article->catalias)) {
$completeCat .= ':' . $article->catalias;
}
if (!empty($article->secalias)) {
$completeSec .= ':' . $article->secalias;
}
$link = ContentHelperRoute::getArticleRoute($completeId, $completeCat, $completeSec);
if (!empty($tag->lang)) {
$link .= (strpos($link, '?') ? '&' : '?') . 'lang=' . substr($tag->lang, 0, strpos($tag->lang, ','));
}
$link = acymailing::frontendLink($link);
$styleTitle = '';
$styleTitleEnd = '';
if ($tag->type != "title") {
$styleTitle = '<h2 class="acymailing_title">';
$styleTitleEnd = '</h2>';
}
if (!empty($tag->link)) {
$result->html .= '<a href="' . $link . '" ';
if ($tag->type != "title") {
$result->html .= 'style="text-decoration:none" name="content-' . $article->id . '" ';
}
$result->html .= 'target="_blank" >' . $styleTitle . $article->title . $styleTitleEnd . '</a>';
$result->text .= $article->title . ' ( ' . $link . ' )';
} else {
$result->html .= $styleTitle . $article->title . $styleTitleEnd;
$result->text .= $article->title;
}
if (!empty($tag->author)) {
$authorName = empty($article->created_by_alias) ? $article->authorname : $article->created_by_alias;
$result->html .= $authorName . '<br/>';
$result->text .= "\n" . $authorName;
}
if ($tag->type != "title") {
if ($this->params->get('removejs', 'yes') == 'yes') {
$article->introtext = $this->_removeJS($article->introtext);
$article->fulltext = $this->_removeJS($article->fulltext);
}
if ($this->params->get('removepictures', 'never') == 'always') {
$article->introtext = $this->_removePictures($article->introtext);
$article->fulltext = $this->_removePictures($article->fulltext);
} elseif ($this->params->get('removepictures', 'never') == 'intro' and $tag->type == "intro") {
$article->introtext = $this->_removePictures($article->introtext);
}
if ($tag->type == "intro") {
$forceReadMore = false;
$wordwrap = $this->params->get('wordwrap', 0);
//.........这里部分代码省略.........