Beispiel #1
0
 static function displaySocialShare($mailingId = 0, $social = 'facebook', $full_screen = false)
 {
     $socialShareHTML = '';
     $Itemid = $GLOBALS[JNEWS . 'itemidAca'];
     $archivelink = jNews_Tools::completeLink('option=' . JNEWS_OPTION . '&act=mailing&task=view&mailingid=' . $mailingId, false, $GLOBALS[JNEWS . 'use_sef']);
     $subject = jNews_Mailing::getMailingsSubject($mailingId);
     if ($social == 'twitter') {
         $img = 'twitter.png';
         $link = "http://twitter.com/home?status=" . urlencode($archivelink) . "&title=" . $subject;
         $title = "Share on Twitter";
     } elseif ($social == 'linkedin') {
         $img = 'linkedin.png';
         $link = "http://www.linkedin.com/shareArticle?mini=true&url=" . urlencode($archivelink) . "&title=" . $subject;
         $title = "Share on LinkedIn";
     } else {
         $img = 'facebook.png';
         $full_screen_text = $full_screen ? "&format=raw" : "";
         $link = "http://www.facebook.com/sharer.php?u=" . urlencode($archivelink . $full_screen_text) . "&title=" . $subject;
         $title = "Share on Facebook";
     }
     $imageLink = '<a target="_blank" href="' . $link . '" title="' . $title . '"><img src="' . JNEWS_JPATH_LIVE . '/components/' . JNEWS_OPTION . '/images/share/' . $img . '" width="16" height="16" border="0" alt="" /></a>';
     $socialShareHTML .= '<td>' . $imageLink . '</td>';
     return $socialShareHTML;
 }
Beispiel #2
0
 public static function replaceTags($content, $subscriber, $oneQueue, $html, $tags = null, $showSign = true)
 {
     $mailingId = $oneQueue->id;
     $Itemid = $GLOBALS[JNEWS . 'itemidAca'];
     $listId = '0';
     //can be empty
     $subscriptionslink = 'option=' . JNEWS_OPTION . '&Itemid=' . $Itemid . '&act=change&subscriber=' . $subscriber->id . '&cle=' . md5($subscriber->email);
     $unsubscribelink = 'option=' . JNEWS_OPTION . '&Itemid=' . $Itemid . '&act=unsubscribe&subscriber=' . $subscriber->id . '&mailingid=' . $mailingId . '&cle=' . md5($subscriber->email);
     $subscriptiontext = '';
     $subscriptionslink = jNews_Tools::completeLink($subscriptionslink, false, $GLOBALS[JNEWS . 'use_sef']);
     $unsubscribelink = jNews_Tools::completeLink($unsubscribelink, false, $GLOBALS[JNEWS . 'use_sef']);
     if ($html) {
         $subscriptionslink = '<a href="' . $subscriptionslink . '" target="_blank"><span class="aca_subscribe">' . _JNEWS_CHANGE_EMAIL_SUBSCRIPTION . '</span></a>';
         $unsubscribelink = '<a href="' . $unsubscribelink . '" target="_blank"><span class="aca_unsubscribe">' . _JNEWS_SAFEUNSUBSCRIBE . '</span></a>';
         $subscriptionstext = '<p>' . $subscriptionslink . '<br />' . $unsubscribelink . '</p>';
     } else {
         $subscriptionslink = _JNEWS_CHANGE_EMAIL_SUBSCRIPTION . ' ( ' . $subscriptionslink . ' )';
         $unsubscribelink = _JNEWS_SAFEUNSUBSCRIBE . ' ( ' . $unsubscribelink . ' )';
         $subscriptionstext = "\r\n" . $subscriptionslink . "\r\n" . $unsubscribelink;
     }
     $subscriptionstext = '';
     if ($showSign && $GLOBALS[JNEWS . 'show_signature']) {
         if ($html) {
             $signatureText = '<a href="http://www.joobi.co" target="_blank">';
             $signatureText .= '<br /><center><div style="width: 99%; color:#000; font-size: 0.8em; text-align: center; ">Powered by Joobi</div></center>';
             $signatureText .= '</a>';
         } else {
             $signatureText = '<br />Powered by Joobi ( http://www.joobi.co )';
         }
         $subscriptionstext .= "\r\n\r\n" . $signatureText;
     }
     $confirmlink = 'option=' . JNEWS_OPTION . '&act=confirm&listid=' . $listId . '&cle=' . md5($subscriber->email) . '&subscriber=' . $subscriber->id . '&Itemid=' . $Itemid;
     $confirmlink = jNews_Tools::completeLink($confirmlink, false, $GLOBALS[JNEWS . 'use_sef']);
     //for rpelacement of the {tag:title}
     $mailSubject = '';
     //		$mailingid = empty($oneQueue->mailing_id) OR !isset($oneQueue->mailing_id) ? jNews_Queue::getQueueMailingId($oneQueue->id) : $oneQueue->mailing_id;
     $mailSubject = jNews_Mailing::getMailingsSubject($oneQueue->id);
     if ($html) {
         $confirmlink = '<a href="' . $confirmlink . '" target="_blank">' . _JNEWS_CONFIRM_LINK . '</a>';
     } else {
         $confirmlink = _JNEWS_CONFIRM_LINK . "\n" . $confirmlink;
     }
     $tname = explode(" ", $subscriber->name);
     $firstname = $tname[0];
     $username = empty($subscriber->username) ? $firstname : $subscriber->username;
     $archiveLink = 'option=' . JNEWS_OPTION . '&act=mailing&task=view&mailingid=' . $mailingId . '&Itemid=' . $Itemid;
     $archiveLink = jNews_Tools::completeLink($archiveLink, false, $GLOBALS[JNEWS . 'use_sef']);
     $archiveAll = '<a href="' . $archiveLink . '">' . _JNEWS_VIEWARCHIVE . '</a>';
     //		$replaceWhat = array('[CONFIRM]','[NAME]','[FIRSTNAME]','[EMAIL]','[DATE]','[USERNAME]','[LINK]','[ARCHIVE]', '[SUBSCRIPTIONS]', '[UNSUBSCRIBE]');
     //		$replaceWhat = array('{tag:confirm}','{tag:name}','{tag:firstname}','{tag:email}','{tag:date}','{tag:username}','{tag:link}','{tag:archive}', '{tag:subscriptions}', '{tag:unsubscribe}', '{tag:title}');
     $replaceTagsA = array();
     $replaceTagsA['{tag:confirm}'] = $confirmlink;
     $replaceTagsA['{tag:name}'] = $subscriber->name;
     $replaceTagsA['{tag:firstname}'] = $firstname;
     $replaceTagsA['{tag:email}'] = $subscriber->email;
     if (version_compare(JVERSION, '3.0.0', '<')) {
         $replaceTagsA['{tag:date}'] = JHTML::_('date', jnews::getNow(), JText::_('DATE_FORMAT_LC1'));
         // , JNEWS_TIME_OFFSET
     } else {
         $replaceTagsA['{tag:date}'] = JHtml::_('date', jnews::getNow(), JText::_('DATE_FORMAT_LC1'));
         // , JNEWS_TIME_OFFSET
     }
     $replaceTagsA['{tag:username}'] = $username;
     $replaceTagsA['{tag:link}'] = $archiveLink;
     $replaceTagsA['{tag:archive}'] = $archiveAll;
     $mainframe = JFactory::getApplication();
     if (!$mainframe->isAdmin() && JRequest::getVar('act', '', '', 'WORD') == 'mailing' && JRequest::getVar('task') == 'view') {
         $replaceTagsA['{tag:subscriptions}'] = '';
         $replaceTagsA['{tag:unsubscribe}'] = '';
     } else {
         $replaceTagsA['{tag:subscriptions}'] = $subscriptionslink;
         $replaceTagsA['{tag:unsubscribe}'] = $unsubscribelink;
     }
     $replaceTagsA['{tag:title}'] = $mailSubject;
     if ($GLOBALS[JNEWS . 'level'] > 2) {
         //check if the version of jnews is pro
         $replaceTagsA['{tag:profile nb=1}'] = empty($subscriber->column1) ? '' : $subscriber->column1;
         $replaceTagsA['{tag:profile nb=2}'] = empty($subscriber->column2) ? '' : $subscriber->column2;
         $replaceTagsA['{tag:profile nb=3}'] = empty($subscriber->column3) ? '' : $subscriber->column3;
         $replaceTagsA['{tag:profile nb=4}'] = empty($subscriber->column4) ? '' : $subscriber->column4;
         $replaceTagsA['{tag:profile nb=5}'] = empty($subscriber->column5) ? '' : $subscriber->column5;
     }
     $replaceTagsKeysA = array_keys($replaceTagsA);
     $content = str_replace($replaceTagsKeysA, $replaceTagsA, $content);
     if (class_exists('jNews_Auto')) {
         jNews_Auto::tags($content, $tags);
     }
     $content = stristr($content, 'Powered by Joobi') !== false ? $content : $content . $subscriptionstext;
     if (class_exists('jNews_Tags')) {
         jNews_Tags::replace($content, $tags);
     }
     $mainframe = JFactory::getApplication();
     JPluginHelper::importPlugin('jnews');
     $plugin = JPluginHelper::getPlugin('jnews', 'forwardtofriend');
     if (!empty($plugin)) {
         jimport('joomla.html.parameter');
         $fwdObj = new stdClass();
         $fwdObj->subscriber = $subscriber;
         $fwdObj->mailingid = $mailingId;
         $fwdObj->listid = $listId;
         $bot_results = $mainframe->triggerEvent('jnewsbot_fwdtofriendTransform', array(&$content, $fwdObj));
     }
     if (!defined('JOOBI_SECURE')) {
         define('JOOBI_SECURE', true);
     }
     //check if we have Joobi install if so check for tags
     $joobiEntryPoint = '';
     if (defined('JPATH_ROOT')) {
         $path = JPATH_ROOT;
     } elseif (isset($mosConfig_absolute_path)) {
         $path = $mosConfig_absolute_path;
     }
     $status = @(include_once $path . DIRECTORY_SEPARATOR . 'joobi' . DIRECTORY_SEPARATOR . 'entry.php');
     if ($status) {
         //process joobi tag
         $tagProcessC = WClass::get('output.process', null, 'class', false);
         if (!empty($tagProcessC)) {
             $tagProcessC->replaceTags($content);
         }
     }
     if (!empty($mailingId) and $GLOBALS[JNEWS . 'enable_statistics'] == 1) {
         if ($GLOBALS[JNEWS . 'statistics_per_subscriber'] == 1) {
             if ($html) {
                 $content .= '<img src="' . JNEWS_JPATH_LIVE_NO_HTTPS . '/index.php?option=' . JNEWS_OPTION . '&Itemid=' . $Itemid . '&act=log' . '&mailingid=' . $mailingId . '&subscriber=' . $subscriber->id . '" border="0" width="1" height="1" />';
             }
         } else {
             if ($html) {
                 $content .= '<img src="' . JNEWS_JPATH_LIVE_NO_HTTPS . '/index.php?option=' . JNEWS_OPTION . '&Itemid=' . $Itemid . '&act=log' . '&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="' . JNEWS_JPATH_LIVE_NO_HTTPS . '/', $content);
     $content = preg_replace('#href[ ]*=[ ]*\\"(?!https?://)(?:\\.\\./|\\./|/)?#', 'href="' . JNEWS_JPATH_LIVE_NO_HTTPS . '/', $content);
     $content = str_replace($replaceBy, $replaceTag, $content);
     $content = preg_replace('#\\.(jpg|gif|jpeg|png)(?:(?!").)?"#', '.\\1"', $content);
     if (!$html) {
         $content = str_replace('&amp;', '&', $content);
     }
     return $content;
 }
Beispiel #3
0
    public static function _displayQueue($mailingq, $i)
    {
        if (empty($mailingq)) {
            return true;
        }
        if (version_compare(JVERSION, '3.0.0', '<')) {
            $onClickFct = '';
        } else {
            $onClickFct = 'Joomla.';
        }
        foreach ($mailingq as $mailingQ) {
            ?>
			<tr class="row<?php 
            echo ($i + 1) % 2;
            ?>
">
				<td><center><?php 
            echo $i + 1;
            ?>
</center></td>
				<td><center><input type="checkbox" id="cid[<?php 
            echo $i;
            ?>
]" name="cid[<?php 
            echo $i;
            ?>
]" value="<?php 
            echo $mailingQ->qid;
            ?>
" onclick="<?php 
            echo $onClickFct;
            ?>
isChecked(this.checked);"></center></td>
				<td><?php 
            $subject = jNews_Mailing::getMailingsSubject($mailingQ->mailing_id);
            echo $subject;
            ?>
</td>
				<td><?php 
            $email = jNews_ListsSubs::getSubscriberMail($mailingQ->subscriber_id);
            echo $email;
            ?>
</td>
				<td ><div align="center"><?php 
            if ($mailingQ->send_date == 0) {
                echo '0000-00-00 00:00:00';
            } else {
                echo date('D, d M Y H:i:s', jnews::getNow(0, true, $mailingQ->send_date));
            }
            ?>
</div></td>
				<td><center><?php 
            echo $mailingQ->priority;
            ?>
</center></td>
				<td><center><?php 
            echo $mailingQ->attempt;
            ?>
</center></td>
				<td><center><?php 
            echo $mailingQ->suspend;
            ?>
</center></td>
				<td><center><?php 
            if ($mailingQ->block) {
                $img = '16/block.png';
                ?>
					<img src="<?php 
                echo JNEWS_PATH_ADMIN_IMAGES2 . $img;
                ?>
" border="0" alt="" />
					<?php 
                jnews::getLegend('block.png', _JNEWS_QUEUE_BLOCK);
            } else {
                $img = '16/unblock.png';
                ?>
					<img src="<?php 
                echo JNEWS_PATH_ADMIN_IMAGES2 . $img;
                ?>
" border="0" alt="" />
					<?php 
                jnews::getLegend('unblock.png', _JNEWS_QUEUE_UNBLOCK);
            }
            ?>
</center></td>
				<td><center><?php 
            echo $mailingQ->qid;
            ?>
</center></td>
			</tr>
		<?php 
            $i = $i + 1;
        }
    }