本文整理汇总了PHP中acymailing_isAllowed函数的典型用法代码示例。如果您正苦于以下问题:PHP acymailing_isAllowed函数的具体用法?PHP acymailing_isAllowed怎么用?PHP acymailing_isAllowed使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了acymailing_isAllowed函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: store
function store()
{
if (!$this->isAllowed('configuration', 'manage')) {
return;
}
$app = JFactory::getApplication();
JRequest::checkToken() or die('Invalid Token');
$source = is_array($_POST['config']) ? 'POST' : 'REQUEST';
$formData = JRequest::getVar('config', array(), $source, 'array');
$aclcats = JRequest::getVar('aclcat', array(), 'POST', 'array');
if (!empty($aclcats)) {
if (JRequest::getString('acl_configuration', 'all') != 'all' && !acymailing_isAllowed($formData['acl_configuration_manage'])) {
$app->enqueueMessage(JText::_('ACL_WRONG_CONFIG'), 'notice');
unset($formData['acl_configuration_manage']);
}
$deleteAclCats = array();
$unsetVars = array('save', 'create', 'manage', 'modify', 'delete', 'fields', 'export', 'import', 'view', 'send', 'schedule', 'bounce', 'test');
foreach ($aclcats as $oneCat) {
if (JRequest::getString('acl_' . $oneCat) == 'all') {
foreach ($unsetVars as $oneVar) {
unset($formData['acl_' . $oneCat . '_' . $oneVar]);
}
$deleteAclCats[] = $oneCat;
}
}
}
if (!empty($formData['hostname'])) {
$formData['hostname'] = preg_replace('#https?://#i', '', $formData['hostname']);
$formData['hostname'] = preg_replace('#[^a-z0-9_.-]#i', '', $formData['hostname']);
}
$reasons = JRequest::getVar('unsub_reasons', array(), 'POST', 'array');
$unsub_reasons = array();
foreach ($reasons as $oneReason) {
if (empty($oneReason)) {
continue;
}
$unsub_reasons[] = strip_tags($oneReason);
}
$formData['unsub_reasons'] = serialize($unsub_reasons);
$config =& acymailing_config();
$status = $config->save($formData);
if (!empty($deleteAclCats)) {
$db = JFactory::getDBO();
$db->setQuery("DELETE FROM `#__acymailing_config` WHERE `namekey` LIKE 'acl_" . implode("%' OR `namekey` LIKE 'acl_", $deleteAclCats) . "%'");
$db->query();
}
if ($status) {
$app->enqueueMessage(JText::_('JOOMEXT_SUCC_SAVED'), 'message');
} else {
$app->enqueueMessage(JText::_('ERROR_SAVING'), 'error');
}
$config->load();
}
示例2: update
function update()
{
$config = acymailing_config();
if (!acymailing_isAllowed($config->get('acl_config_manage', 'all'))) {
acymailing_display(JText::_('ACY_NOTALLOWED'), 'error');
return false;
}
acymailing_setTitle(JText::_('UPDATE_ABOUT'), 'acyupdate', 'update');
$bar =& JToolBar::getInstance('toolbar');
$bar->appendButton('Link', 'back', JText::_('ACY_CLOSE'), acymailing_completeLink('dashboard'));
return $this->_iframe(ACYMAILING_UPDATEURL . 'update');
}
示例3: update
function update()
{
$config = acymailing_config();
if (!acymailing_isAllowed($config->get('acl_config_manage', 'all'))) {
acymailing_display(JText::_('ACY_NOTALLOWED'), 'error');
return false;
}
$acyToolbar = acymailing::get('helper.toolbar');
$acyToolbar->setTitle(JText::_('UPDATE_ABOUT'), 'update');
$acyToolbar->link(acymailing_completeLink('dashboard'), JText::_('ACY_CLOSE'), 'cancel');
$acyToolbar->display();
return $this->_iframe(ACYMAILING_UPDATEURL . 'update');
}
示例4: addSubscription
function addSubscription($subid, $lists)
{
$app = JFactory::getApplication();
$my = JFactory::getUser();
$result = true;
$time = time();
$subid = intval($subid);
$listHelper = acymailing_get('helper.list');
foreach ($lists as $status => $listids) {
$status = intval($status);
JArrayHelper::toInteger($listids);
$this->database->setQuery('SELECT `listid`,`access_sub` FROM ' . acymailing_table('list') . ' WHERE `listid` IN (' . implode(',', $listids) . ') AND `type` = \'list\'');
$allResults = $this->database->loadObjectList('listid');
$listids = array_keys($allResults);
if ($status == '-1') {
$column = 'unsubdate';
} else {
$column = 'subdate';
}
$values = array();
foreach ($listids as $listid) {
if (empty($listid)) {
continue;
}
if ($status > 0 && acymailing_level(3)) {
if ((!$app->isAdmin() || !empty($this->gid)) && $this->checkAccess && $allResults[$listid]->access_sub != 'all') {
if (!acymailing_isAllowed($allResults[$listid]->access_sub, $this->gid)) {
continue;
}
}
}
$values[] = intval($listid) . ',' . $subid . ',' . $status . ',' . $time;
}
if (empty($values)) {
continue;
}
$query = 'INSERT INTO ' . acymailing_table('listsub') . ' (listid,subid,`status`,' . $column . ') VALUES (' . implode('),(', $values) . ')';
$this->database->setQuery($query);
$result = $this->database->query() && $result;
if ($status == 1) {
$listHelper->subscribe($subid, $listids);
}
}
return $result;
}
示例5: getFrontendLists
function getFrontendLists($index = '')
{
$lists = $this->getLists($index);
$copyAllLists = $lists;
$my = JFactory::getUser();
foreach ($copyAllLists as $id => $oneList) {
if (!$oneList->published or empty($my->id)) {
unset($lists[$id]);
continue;
}
if ((int) $my->id == (int) $oneList->userid) {
continue;
}
if (!acymailing_isAllowed($oneList->access_manage)) {
unset($lists[$id]);
continue;
}
}
return $lists;
}
示例6: store
function store()
{
if (!$this->isAllowed('configuration', 'manage')) {
return;
}
$app =& JFactory::getApplication();
JRequest::checkToken() or die('Invalid Token');
$formData = JRequest::getVar('config', array(), '', 'array');
$aclcats = JRequest::getVar('aclcat', array(), '', 'array');
if (!empty($aclcats)) {
if (JRequest::getString('acl_configuration', 'all') != 'all' && !acymailing_isAllowed($formData['acl_configuration_manage'])) {
$app->enqueueMessage(JText::_('ACL_WRONG_CONFIG'), 'notice');
unset($formData['acl_configuration_manage']);
}
$deleteAclCats = array();
$unsetVars = array('save', 'create', 'manage', 'modify', 'delete', 'fields', 'export', 'import', 'view', 'send', 'schedule', 'bounce', 'test');
foreach ($aclcats as $oneCat) {
if (JRequest::getString('acl_' . $oneCat) == 'all') {
foreach ($unsetVars as $oneVar) {
unset($formData['acl_' . $oneCat . '_' . $oneVar]);
}
$deleteAclCats[] = $oneCat;
}
}
}
$config =& acymailing_config();
$status = $config->save($formData);
if (!empty($deleteAclCats)) {
$db =& JFactory::getDBO();
$db->setQuery("DELETE FROM `#__acymailing_config` WHERE `namekey` LIKE 'acl_" . implode("%' OR `namekey` LIKE 'acl_", $deleteAclCats) . "%'");
$db->query();
}
if ($status) {
$app->enqueueMessage(JText::_('JOOMEXT_SUCC_SAVED'), 'message');
} else {
$app->enqueueMessage(JText::_('ERROR_SAVING'), 'error');
}
$config->load();
}
示例7: acymailing_dispSearch
<button class="btn button buttonreset" onclick="document.getElementById('acymailingsearch').value='';this.form.submit();"><?php echo JText::_( 'JOOMEXT_RESET' ); ?></button>
<?php }
$k = 1;
for($i = 0,$a = count($this->rows);$i<$a;$i++){
$row =& $this->rows[$i];
echo '<div class="archiveRow archiveRow'.$k.$this->values->suffix.'">';
if(!empty($row->thumb)) echo '<img class="archiveItemPict" src="'.$row->thumb.'"/>';
echo '<span class="acyarchivetitle"><a '.($this->config->get('open_popup',1) ? 'class="modal" rel="{handler: \'iframe\', size: {x: '.intval($this->config->get('popup_width',750)).', y: '.intval($this->config->get('popup_height',550)).'}}"' : '').'href="'.acymailing_completeLink('archive&task=view&listid='.$this->list->listid.'-'.$this->list->alias.'&mailid='.$row->mailid.'-'.strip_tags($row->alias).$this->item,(bool)$this->config->get('open_popup',1)).'">';
echo acymailing_dispSearch($row->subject,$this->pageInfo->search).'</a>';
if($this->access->frontEndManagement){
if(($this->config->get('frontend_modif',1) || ($row->userid == $this->my->id)) && ($this->config->get('frontend_modif_sent',1) || empty($row->senddate))){ ?>
<span class="acyeditbutton"><a href="<?php echo acymailing_completeLink('frontnewsletter&task=edit&mailid='.$row->mailid.'&listid='.$this->list->listid); ?>" title="<?php echo JText::_('ACY_EDIT',true) ?>" ><img class="icon16" src="<?php echo ACYMAILING_IMAGES ?>icons/icon-16-edit.png" alt="<?php echo JText::_('ACY_EDIT',true) ?>" /></a></span>
<?php }
if(!empty($row->senddate) && acymailing_isAllowed($this->config->get('acl_statistics_manage','all'))){ ?>
<span class="acystatsbutton"><a class="modal" rel="{handler: 'iframe', size: {x: 800, y: 590}}" href="<?php echo acymailing_completeLink('frontnewsletter&task=stats&mailid='.$row->mailid.'&listid='.$this->list->listid,true); ?>"><img src="<?php echo ACYMAILING_IMAGES; ?>icons/icon-16-stats.png" alt="<?php echo JText::_('STATISTICS',true) ?>" /></a></span>
<?php } ?>
<?php }
echo '</span>';
if($this->values->show_senddate && !empty($row->senddate)) {
echo '<span class="sentondate">'.JText::sprintf('ACY_SENT_ON', acymailing_getDate($row->senddate,JText::_('DATE_FORMAT_LC3'))).'</span>';
}
if($this->values->show_receiveemail){ ?>
<span class="receiveviaemail">
<input onclick="changeReceiveEmail(this.checked)" type="checkbox" name="receivemail[]" value="<?php echo $row->mailid; ?>" id="receive_<?php echo $row->mailid; ?>" /> <label for="receive_<?php echo $row->mailid; ?>"><?php echo JText::_('RECEIVE_VIA_EMAIL'); ?></label>
</span>
<?php
if(!empty($row->summary)) echo '<br/>';
}
if(!empty($row->summary)) echo '<span class="archiveItemDesc">'.nl2br($row->summary).'</span>';
示例8:
</td>
</tr>
</table>
<?php
if (!acymailing_isAllowed($this->config->get('acl_newsletters_sender_informations', 'all'))) {
echo '</div>';
} else {
echo $this->tabs->endPanel();
}
if ($this->type == 'joomlanotification') {
$doc = JFactory::getDocument();
$doc->addStyleDeclaration(" .mail_metadata_jnotif{display:none;} ");
echo '<div class="mail_metadata_jnotif">';
} else {
if (acymailing_isAllowed($this->config->get('acl_newsletters_meta_data', 'all'))) {
echo $this->tabs->startPanel(JText::_('META_DATA'), 'mail_metadata');
?>
<br style="font-size:1px"/>
<table width="100%" class="paramlist admintable" id="metadatatable">
<tr>
<td class="paramlist_key">
<label for="metakey"><?php
echo JText::_('META_KEYWORDS');
?>
</label>
</td>
<td class="paramlist_value">
<textarea id="metakey" name="data[mail][metakey]" rows="5" cols="30" ><?php
echo @$this->mail->metakey;
?>
示例9: GetInitialisationFunction
function GetInitialisationFunction($id)
{
JHtml::_('behavior.modal', 'a.modal');
$texteSuppression = JText::_('ACYEDITOR_DELETEAREA');
$tooltipSuppression = JText::_('ACY_DELETE');
$tooltipEdition = JText::_('ACY_EDIT');
$urlBase = JURI::root();
$urlAdminBase = JURI::base();
$cssurl = JRequest::getVar('acycssfile');
$forceComplet = JRequest::getCmd('option') != 'com_acymailing' || JRequest::getCmd('ctrl') == 'template' || JRequest::getCmd('ctrl') == 'list';
$modeList = JRequest::getCmd('option') == 'com_acymailing' && JRequest::getCmd('ctrl') == 'list';
$modeTemplate = JRequest::getCmd('option') == 'com_acymailing' && JRequest::getCmd('ctrl') == 'template';
$modeArticle = JRequest::getCmd('option') == 'com_content' && JRequest::getCmd('view') == 'article';
$joomla2_5 = ACYMAILING_J16;
$joomla3 = ACYMAILING_J30;
$titleTemplateDelete = JText::_('ACYEDITOR_TEMPLATEDELETE');
$titleTemplateText = JText::_('ACYEDITOR_TEMPLATETEXT');
$titleTemplatePicture = JText::_('ACYEDITOR_TEMPLATEPICTURE');
$titleShowAreas = JText::_('ACYEDITOR_SHOWAREAS');
$app = JFactory::getApplication();
$isBack = 0;
if ($app->isAdmin()) {
$isBack = 1;
}
$tagAllowed = 0;
$config = acymailing_config();
if (JRequest::getCmd('option') == 'com_acymailing' && JRequest::getCmd('ctrl') != 'list' && JRequest::getCmd('ctrl') != 'campaign' && acymailing_isAllowed($config->get('acl_tags_view', 'all')) && JRequest::getCmd('tmpl') != 'component') {
$tagAllowed = 1;
}
$type = 'news';
if (JRequest::getCmd('ctrl') == 'autonews' || JRequest::getCmd('ctrl') == 'followup') {
$type = JRequest::getCmd('ctrl');
}
$pasteType = $this->params->get('pasteType', 'plain');
$enterMode = $this->params->get('enterMode', 'br');
$inlineSource = $this->params->get('inlineSource', 0);
$doc = JFactory::getDocument();
$js = "\n\t\tacyEnterMode='" . $enterMode . "';\n\t\tpasteType='" . $pasteType . "';\n\t\turlSite='" . $urlBase . "';\n\t\tdefaultText='" . str_replace("'", "\\'", JText::_('ACYEDITOR_DEFAULTTEXT')) . "';\n\t\ttitleBtnMore='" . str_replace("'", "\\'", JText::_('ACYEDITOR_TEMPLATEMORE')) . "';\n\t\ttitleBtnDupliAfter='" . str_replace("'", "\\'", JText::_('ACYEDITOR_DUPLICATE_AFTER')) . "';\n\t\ttooltipInitAreas='" . str_replace("'", "\\'", JText::_('ACYEDITOR_REINIT_ZONE_TOOLTIP')) . "';\n\t\tconfirmInitAreas='" . str_replace("'", "\\'", JText::_('ACYEDITOR_REINIT_ZONE_CONFIRMATION')) . "';\n\t\tinlineSource='" . $inlineSource . "';\n\t\t";
$doc->addScriptDeclaration($js);
return "Initialisation(\"{$id}\", \"{$type}\", \"{$urlBase}\", \"{$urlAdminBase}\", \"{$cssurl}\", \"{$forceComplet}\", \"{$modeList}\", \"{$modeTemplate}\", \"{$modeArticle}\", \"{$joomla2_5}\", \"{$joomla3}\", \"{$isBack}\", \"{$tagAllowed}\", \"{$texteSuppression}\", \"{$tooltipSuppression}\", \"{$tooltipEdition}\", \"{$titleTemplateDelete}\", \"{$titleTemplateText}\", \"{$titleTemplatePicture}\", \"{$titleShowAreas}\");\n";
}
示例10: acymailing_dispSearch
</a></span>
<?php
}
}
?>
</td>
<td>
<?php
$subjectLine = acymailing_dispSearch($row->subject, $this->pageInfo->search);
echo acymailing_tooltip('<b>' . JText::_('JOOMEXT_ALIAS') . ' : </b>' . acymailing_dispSearch($row->alias, $this->pageInfo->search), ' ', '', $subjectLine, acymailing_completeLink(($this->app->isAdmin() ? '' : 'front') . 'newsletter&task=edit&mailid=' . $row->mailid));
?>
</td>
<td align="center" style="text-align:center">
<?php
echo acymailing_getDate($row->senddate);
if (!empty($row->countqueued) && acymailing_isAllowed($this->config->get('acl_queue_delete', 'all'))) {
?>
<br/>
<button class="acymailing_button"
onclick="if(confirm('<?php
echo str_replace("'", "\\'", JText::sprintf('ACY_VALID_DELETE_FROM_QUEUE', $row->countqueued));
?>
')){ window.location.href = '<?php
echo JURI::base();
?>
index.php?option=com_acymailing&ctrl=<?php
if (!JFactory::getApplication()->isAdmin()) {
echo 'front';
}
?>
newsletter&task=cancelNewsletter&<?php
示例11: listing
//.........这里部分代码省略.........
if (!empty($pageInfo->search) || !empty($selectedStatus) || $selectedStatusList == -2) {
if (!empty($joinQuery)) {
$queryCount .= ' JOIN ' . implode(' JOIN ', $joinQuery);
}
if (!empty($leftJoinQuery)) {
$queryCount .= ' LEFT JOIN ' . implode(' LEFT JOIN ', $leftJoinQuery);
}
}
if (!empty($filters)) {
$queryCount .= ' WHERE (' . implode(') AND (', $filters) . ')';
}
$database->setQuery($queryCount);
$pageInfo->elements->total = $database->loadResult();
}
if (!empty($rows)) {
$database->setQuery('SELECT * FROM `#__acymailing_listsub` WHERE `subid` IN (\'' . implode('\',\'', array_keys($rows)) . '\')');
$subscriptions = $database->loadObjectList();
if (!empty($subscriptions)) {
foreach ($subscriptions as $onesub) {
$sublistid = $onesub->listid;
if (empty($rows[$onesub->subid]->subscription)) {
$rows[$onesub->subid]->subscription = new stdClass();
}
$rows[$onesub->subid]->subscription->{$sublistid} = $onesub;
}
}
}
if (empty($pageInfo->limit->value)) {
if ($pageInfo->elements->total > 500) {
acymailing_display('We do not want you to crash your server so we displayed only the first 500 users', 'warning');
}
$pageInfo->limit->value = 100;
}
jimport('joomla.html.pagination');
$pagination = new JPagination($pageInfo->elements->total, $pageInfo->limit->start, $pageInfo->limit->value);
$filters = new stdClass();
$statusType = acymailing_get('type.statusfilter');
if (!empty($selectedList)) {
$statusList = acymailing_get('type.statusfilterlist');
if (!$app->isAdmin()) {
array_pop($statusList->values);
}
$filters->statuslist = $statusList->display('filter_statuslist', $selectedStatusList);
}
$listsType = acymailing_get('type.lists');
if ($app->isAdmin()) {
$filters->lists = $listsType->display('filter_lists', $selectedList);
$filters->status = $statusType->display('filter_status', $selectedStatus);
} else {
$listClass = acymailing_get('class.list');
$allLists = $listClass->getFrontendLists();
if (count($allLists) > 1) {
$filters->lists = JHTML::_('select.genericlist', $allLists, "filter_lists", 'class="inputbox" size="1" onchange="document.adminForm.limitstart.value=0;document.adminForm.submit( );"', 'listid', 'name', (int) $selectedList, "filter_lists");
} else {
$filters->lists = '<input type="hidden" name="filter_lists" value="' . $selectedList . '"/>';
}
$filters->status = '<input type="hidden" name="filter_status" value="0"/>';
}
if ($app->isAdmin()) {
acymailing_setTitle(JText::_('USERS'), 'acyusers', 'subscriber');
$bar = JToolBar::getInstance('toolbar');
if (acymailing_isAllowed($config->get('acl_lists_filter', 'all'))) {
$bar->appendButton('Acyactions');
JToolBarHelper::divider();
}
if (acymailing_isAllowed($config->get('acl_subscriber_import', 'all'))) {
$bar->appendButton('Link', 'import', JText::_('IMPORT'), acymailing_completeLink('data&task=import&filter_lists=' . $selectedList));
}
if (acymailing_isAllowed($config->get('acl_subscriber_export', 'all'))) {
JToolBarHelper::custom('export', 'acyexport', '', JText::_('ACY_EXPORT'), false);
}
JToolBarHelper::divider();
if (acymailing_isAllowed($config->get('acl_subscriber_manage', 'all'))) {
JToolBarHelper::addNew();
}
if (acymailing_isAllowed($config->get('acl_subscriber_manage', 'all'))) {
JToolBarHelper::editList();
}
if (acymailing_isAllowed($config->get('acl_subscriber_delete', 'all'))) {
JToolBarHelper::deleteList(JText::_('ACY_VALIDDELETEITEMS', true));
}
JToolBarHelper::divider();
$bar->appendButton('Pophelp', 'subscriber-listing');
if (acymailing_isAllowed($config->get('acl_cpanel_manage', 'all'))) {
$bar->appendButton('Link', 'acymailing', JText::_('ACY_CPANEL'), acymailing_completeLink('dashboard'));
}
}
$lists = $listsType->getData();
$this->assignRef('lists', $lists);
$toggleClass = acymailing_get('helper.toggle');
$this->assignRef('toggleClass', $toggleClass);
$this->assignRef('rows', $rows);
$this->assignRef('filters', $filters);
$this->assignRef('pageInfo', $pageInfo);
$this->assignRef('pagination', $pagination);
$config = acymailing_config();
$this->assignRef('config', $config);
$this->assignRef('displayFields', $displayFields);
$this->assignRef('customFields', $customFields);
}
示例12: view
function view(){
global $Itemid;
$app = JFactory::getApplication();
$document = JFactory::getDocument();
$this->addFeed();
$pathway = $app->getPathway();
$my = JFactory::getUser();
$frontEndManagement = false;
$listid = acymailing_getCID('listid');
$values = new stdClass();
$values->suffix = '';
$jsite = JFactory::getApplication('site');
$menus = $jsite->getMenu();
$menu = $menus->getActive();
if(empty($menu) AND !empty($Itemid)){
$menus->setActive($Itemid);
$menu = $menus->getItem($Itemid);
}
if (is_object( $menu )) {
jimport('joomla.html.parameter');
$menuparams = new acyParameter( $menu->params );
}
if(!empty($menuparams)){
$values->suffix = $menuparams->get('pageclass_sfx','');
}
if(empty($listid) && !empty($menuparams)){
$listid = $menuparams->get('listid');
if ($menuparams->get('menu-meta_description')) $document->setDescription($menuparams->get('menu-meta_description'));
if ($menuparams->get('menu-meta_keywords')) $document->setMetadata('keywords',$menuparams->get('menu-meta_keywords'));
if ($menuparams->get('robots')) $document->setMetadata('robots',$menuparams->get('robots'));
if ($menuparams->get('page_title')) acymailing_setPageTitle($menuparams->get('page_title'));
}
$config = acymailing_config();
$indexFollow = $config->get('indexFollow', '');
$tagIndFol = array();
if(strpos($indexFollow, 'noindex') !== false) $tagIndFol[] = 'noindex';
if(strpos($indexFollow, 'nofollow') !== false) $tagIndFol[] = 'nofollow';
if(!empty($tagIndFol)) $document->setMetadata('robots',implode(',',$tagIndFol));
if(!empty($listid)){
$listClass = acymailing_get('class.list');
$oneList = $listClass->get($listid);
if(!empty($oneList->visible) AND $oneList->published AND (empty($menuparams) || !$menuparams->get('listid'))){
$pathway->addItem($oneList->name,acymailing_completeLink('archive&listid='.$oneList->listid.':'.$oneList->alias));
}
if(!empty($oneList->listid) AND acymailing_level(3)){
if(!empty($my->id) AND (int)$my->id == (int)$oneList->userid){
$frontEndManagement = true;
}
if(!empty($my->id)){
if($oneList->access_manage == 'all' OR acymailing_isAllowed($oneList->access_manage)){
$frontEndManagement = true;
}
}
}
}
$mailid = JRequest::getString('mailid','nomailid');
if(empty($mailid)){
die('This is a Newsletter-template... and you can not access the online version of a Newsletter-template!<br />Please <a href="administrator/index.php?option=com_acymailing&ctrl=newsletter&task=edit" >create a Newsletter</a> using your template and then try again your "view it online" link!');
exit;
}
if($mailid == 'nomailid'){
$db = JFactory::getDBO();
$query = 'SELECT m.`mailid` FROM `#__acymailing_list` as l JOIN `#__acymailing_listmail` as lm ON l.listid=lm.listid JOIN `#__acymailing_mail` as m on lm.mailid = m.mailid';
$query .= ' WHERE l.`visible` = 1 AND l.`published` = 1 AND m.`visible`= 1 AND m.`published` = 1 AND m.`type` = "news" AND l.`type` = "list"';
if(!empty($listid)) $query .= ' AND l.`listid` = '.(int) $listid;
$query .= ' ORDER BY m.`senddate` DESC, m.`mailid` DESC LIMIT 1';
$db->setQuery($query);
$mailid = $db->loadResult();
}
$mailid = intval($mailid);
if(empty($mailid)) return JError::raiseError( 404, 'Newsletter not found');
$access_sub = true;
if(acymailing_level(3)){
$listmail = acymailing_get('class.listmail');
$allLists = $listmail->getLists($mailid);
$access_sub = false;
if(!empty($allLists)){
foreach($allLists as $alist){
if(empty($alist->mailid)) continue;
if(!$alist->published OR !$alist->visible OR $alist->access_sub == 'none') continue;
if(acymailing_isAllowed($alist->access_sub)){
//.........这里部分代码省略.........
示例13: preview
function preview()
{
$app = JFactory::getApplication();
$mailid = acymailing_getCID('mailid');
$config = acymailing_config();
JHTML::_('behavior.modal', 'a.modal');
$mailerHelper = acymailing_get('helper.mailer');
$mailerHelper->loadedToSend = false;
$mail = $mailerHelper->load($mailid);
$user = JFactory::getUser();
$userClass = acymailing_get('class.subscriber');
$receiver = $userClass->get($user->email);
$mail->sendHTML = true;
$mailerHelper->dispatcher->trigger('acymailing_replaceusertags', array(&$mail, &$receiver, false));
if (!empty($mail->altbody)) {
$mail->altbody = $mailerHelper->textVersion($mail->altbody, false);
}
$listmailClass = acymailing_get('class.listmail');
$lists = $listmailClass->getReceivers($mail->mailid, true, false);
$receiversClass = acymailing_get('type.testreceiver');
$paramBase = ACYMAILING_COMPONENT . '.' . $this->getName();
$infos = new stdClass();
$infos->receiver_type = $app->getUserStateFromRequest($paramBase . ".receiver_type", 'receiver_type', '', 'string');
$infos->test_html = $app->getUserStateFromRequest($paramBase . ".test_html", 'test_html', 1, 'int');
$infos->test_email = $app->getUserStateFromRequest($paramBase . ".test_email", 'test_email', '', 'string');
acymailing_setTitle(JText::_('ACY_PREVIEW') . ' : ' . $mail->subject, $this->icon, $this->ctrl . '&task=preview&mailid=' . $mailid);
$bar = JToolBar::getInstance('toolbar');
if ($this->type == 'news') {
if (acymailing_level(1) && acymailing_isAllowed($config->get('acl_newsletters_schedule', 'all'))) {
if ($mail->published == 2) {
JToolBarHelper::custom('unschedule', 'unschedule', '', JText::_('UNSCHEDULE'), false);
} else {
$bar->appendButton('Acypopup', 'schedule', JText::_('SCHEDULE'), "index.php?option=com_acymailing&ctrl=send&task=scheduleready&tmpl=component&mailid=" . $mailid);
}
}
if (acymailing_isAllowed($config->get('acl_newsletters_send', 'all'))) {
$bar->appendButton('Acypopup', 'acysend', JText::_('SEND'), "index.php?option=com_acymailing&ctrl=send&task=sendready&tmpl=component&mailid=" . $mailid);
}
JToolBarHelper::divider();
}
JToolBarHelper::custom('edit', 'edit', '', JText::_('ACY_EDIT'), false);
JToolBarHelper::cancel('cancel', JText::_('ACY_CLOSE'));
JToolBarHelper::divider();
$bar->appendButton('Pophelp', $this->doc);
$this->assignRef('lists', $lists);
$this->assignRef('infos', $infos);
$this->assignRef('receiverClass', $receiversClass);
$this->assignRef('mail', $mail);
}
示例14: listing
function listing()
{
$app = JFactory::getApplication();
$pageInfo = new stdClass();
$pageInfo->filter = new stdClass();
$pageInfo->filter->order = new stdClass();
$pageInfo->limit = new stdClass();
$pageInfo->elements = new stdClass();
$config = acymailing_config();
JHTML::_('behavior.modal', 'a.modal');
$paramBase = ACYMAILING_COMPONENT . '.' . $this->getName() . $this->getLayout();
$pageInfo->filter->order->value = $app->getUserStateFromRequest($paramBase . ".filter_order", 'filter_order', 'a.senddate', 'cmd');
$pageInfo->filter->order->dir = $app->getUserStateFromRequest($paramBase . ".filter_order_Dir", 'filter_order_Dir', 'desc', 'word');
if (strtolower($pageInfo->filter->order->dir) !== 'desc') {
$pageInfo->filter->order->dir = 'asc';
}
$pageInfo->search = $app->getUserStateFromRequest($paramBase . ".search", 'search', '', 'string');
$pageInfo->search = JString::strtolower(trim($pageInfo->search));
$pageInfo->limit->value = $app->getUserStateFromRequest($paramBase . '.list_limit', 'limit', $app->getCfg('list_limit'), 'int');
$pageInfo->limit->start = $app->getUserStateFromRequest($paramBase . '.limitstart', 'limitstart', 0, 'int');
$database = JFactory::getDBO();
$filters = array();
if (!empty($pageInfo->search)) {
$searchVal = '\'%' . acymailing_getEscaped($pageInfo->search, true) . '%\'';
$filters[] = implode(" LIKE {$searchVal} OR ", $this->searchFields) . " LIKE {$searchVal}";
}
$query = 'SELECT ' . implode(' , ', $this->selectFields);
$query .= ', CASE WHEN (a.senthtml+a.senttext-a.bounceunique) = 0 THEN 0 ELSE (a.openunique/(a.senthtml+a.senttext-a.bounceunique)) END AS openprct';
$query .= ', CASE WHEN (a.senthtml+a.senttext-a.bounceunique) = 0 THEN 0 ELSE (a.clickunique/(a.senthtml+a.senttext-a.bounceunique)) END AS clickprct';
$query .= ', CASE WHEN a.openunique = 0 THEN 0 ELSE (a.clickunique/a.openunique) END AS efficiencyprct';
$query .= ', CASE WHEN (a.senthtml+a.senttext-a.bounceunique) = 0 THEN 0 ELSE (a.unsub/(a.senthtml+a.senttext-a.bounceunique)) END AS unsubprct';
$query .= ', (a.senthtml+a.senttext) as totalsent';
$query .= ', CASE WHEN (a.senthtml+a.senttext) = 0 THEN 0 ELSE (a.bounceunique/(a.senthtml+a.senttext)) END AS bounceprct';
$query .= ' FROM ' . acymailing_table('stats') . ' as a';
$query .= ' JOIN ' . acymailing_table('mail') . ' as b on a.mailid = b.mailid';
if (!empty($filters)) {
$query .= ' WHERE (' . implode(') AND (', $filters) . ')';
}
if (!empty($pageInfo->filter->order->value)) {
$query .= ' ORDER BY ' . $pageInfo->filter->order->value . ' ' . $pageInfo->filter->order->dir;
}
$database->setQuery($query, $pageInfo->limit->start, $pageInfo->limit->value);
$rows = $database->loadObjectList();
if ($rows === null) {
acymailing_display(substr(strip_tags($database->getErrorMsg()), 0, 200) . '...', 'error');
if (file_exists(ACYMAILING_BACK . 'install.acymailing.php')) {
include_once ACYMAILING_BACK . 'install.acymailing.php';
$installClass = new acymailingInstall();
$installClass->fromVersion = '3.6.0';
$installClass->update = true;
$installClass->updateSQL();
}
}
$queryCount = 'SELECT COUNT(a.mailid) FROM ' . acymailing_table('stats') . ' as a';
if (!empty($pageInfo->search)) {
$queryCount .= ' JOIN ' . acymailing_table('mail') . ' as b on a.mailid = b.mailid';
}
if (!empty($filters)) {
$queryCount .= ' WHERE (' . implode(') AND (', $filters) . ')';
}
$database->setQuery($queryCount);
$pageInfo->elements->total = $database->loadResult();
$pageInfo->elements->page = count($rows);
jimport('joomla.html.pagination');
$pagination = new JPagination($pageInfo->elements->total, $pageInfo->limit->start, $pageInfo->limit->value);
acymailing_setTitle(JText::_('GLOBAL_STATISTICS'), 'stats', 'stats');
$bar = JToolBar::getInstance('toolbar');
JToolBarHelper::custom('exportglobal', 'acyexport', '', JText::_('ACY_EXPORT'), false);
JToolBarHelper::spacer();
if (acymailing_isAllowed($config->get('acl_statistics_delete', 'all'))) {
JToolBarHelper::deleteList(JText::_('ACY_VALIDDELETEITEMS'));
}
JToolBarHelper::divider();
$bar->appendButton('Pophelp', 'statistics');
if (acymailing_isAllowed($config->get('acl_cpanel_manage', 'all'))) {
$bar->appendButton('Link', 'acymailing', JText::_('ACY_CPANEL'), acymailing_completeLink('dashboard'));
}
$this->assignRef('rows', $rows);
$this->assignRef('pageInfo', $pageInfo);
$this->assignRef('pagination', $pagination);
}
示例15: preview
function preview()
{
$app = JFactory::getApplication();
$mailid = acymailing_getCID('mailid');
$config = acymailing_config();
JHTML::_('behavior.modal', 'a.modal');
$mailerHelper = acymailing_get('helper.mailer');
$mailerHelper->loadedToSend = false;
$mail = $mailerHelper->load($mailid);
$user = JFactory::getUser();
$userClass = acymailing_get('class.subscriber');
$receiver = $userClass->get($user->email);
$mail->sendHTML = true;
$mailerHelper->dispatcher->trigger('acymailing_replaceusertags', array(&$mail, &$receiver, false));
if (!empty($mail->altbody)) {
$mail->altbody = $mailerHelper->textVersion($mail->altbody, false);
}
$listmailClass = acymailing_get('class.listmail');
$lists = $listmailClass->getReceivers($mail->mailid, true, false);
$testreceiverType = acymailing_get('type.testreceiver');
$paramBase = ACYMAILING_COMPONENT . '.' . $this->getName();
$infos = new stdClass();
$infos->test_selection = $app->getUserStateFromRequest($paramBase . ".test_selection", 'test_selection', '', 'string');
$infos->test_group = $app->getUserStateFromRequest($paramBase . ".test_group", 'test_group', '', 'string');
$infos->test_emails = $app->getUserStateFromRequest($paramBase . ".test_emails", 'test_emails', '', 'string');
$infos->test_html = $app->getUserStateFromRequest($paramBase . ".test_html", 'test_html', 1, 'int');
if ($app->isAdmin()) {
acymailing_setTitle(JText::_('ACY_PREVIEW') . ' : ' . $mail->subject, $this->icon, $this->ctrl . '&task=preview&mailid=' . $mailid);
$bar = JToolBar::getInstance('toolbar');
if ($this->type == 'news') {
if (acymailing_level(1) && acymailing_isAllowed($config->get('acl_newsletters_schedule', 'all'))) {
if ($mail->published == 2) {
JToolBarHelper::custom('unschedule', 'unschedule', '', JText::_('UNSCHEDULE'), false);
} else {
$bar->appendButton('Acypopup', 'schedule', JText::_('SCHEDULE'), "index.php?option=com_acymailing&ctrl=send&task=scheduleready&tmpl=component&mailid=" . $mailid);
}
}
if (acymailing_isAllowed($config->get('acl_newsletters_send', 'all'))) {
$bar->appendButton('Acypopup', 'acysend', JText::_('SEND'), "index.php?option=com_acymailing&ctrl=send&task=sendready&tmpl=component&mailid=" . $mailid);
}
JToolBarHelper::divider();
}
if (acymailing_isAllowed($config->get('acl_' . $this->aclCat . '_spam_test', 'all'))) {
if (acymailing_level(1)) {
$height = 638;
$width = 1000;
} else {
$height = 50;
$width = 600;
}
$bar->appendButton('Acypopup', 'spamtest', JText::_('SPAM_TEST'), "index.php?option=com_acymailing&ctrl=send&task=spamtest&tmpl=component&mailid=" . $mailid, $width, $height);
}
JToolBarHelper::custom('edit', 'edit', '', JText::_('ACY_EDIT'), false);
JToolBarHelper::cancel('cancel', JText::_('ACY_CLOSE'));
JToolBarHelper::divider();
$bar->appendButton('Pophelp', $this->doc);
if (acymailing_isAllowed($config->get('acl_cpanel_manage', 'all'))) {
$bar->appendButton('Link', 'acymailing', JText::_('ACY_CPANEL'), acymailing_completeLink('dashboard'));
}
}
$this->assignRef('lists', $lists);
$this->assignRef('infos', $infos);
$this->assignRef('testreceiverType', $testreceiverType);
$this->assignRef('mail', $mail);
if ($mail->html) {
$templateClass = acymailing_get('class.template');
if (!empty($mail->tempid)) {
$templateClass->createTemplateFile($mail->tempid);
}
$templateClass->displayPreview('newsletter_preview_area', $mail->tempid, $mail->subject);
}
}