当前位置: 首页>>代码示例>>PHP>>正文


PHP acymailing_loadResultArray函数代码示例

本文整理汇总了PHP中acymailing_loadResultArray函数的典型用法代码示例。如果您正苦于以下问题:PHP acymailing_loadResultArray函数的具体用法?PHP acymailing_loadResultArray怎么用?PHP acymailing_loadResultArray使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了acymailing_loadResultArray函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: unsubscribe

 function unsubscribe($subid, $listids)
 {
     $app = JFactory::getApplication();
     if (acymailing_level(3)) {
         $campaignClass = acymailing_get('helper.campaign');
         $campaignClass->stop($subid, $listids);
     }
     $config = acymailing_config();
     static $alreadySent = false;
     if ($this->sendNotif and !$alreadySent and $config->get('notification_unsub') and !$app->isAdmin()) {
         $alreadySent = true;
         $mailer = acymailing_get('helper.mailer');
         $mailer->report = false;
         $mailer->autoAddUser = true;
         $mailer->checkConfirmField = false;
         $userClass = acymailing_get('class.subscriber');
         $subscriber = $userClass->get($subid);
         $ipClass = acymailing_get('helper.user');
         $mailer->addParam('survey', $this->survey);
         $listSubClass = acymailing_get('class.listsub');
         $mailer->addParam('user:subscription', $listSubClass->getSubscriptionString($subscriber->subid));
         $mailer->addParam('user:subscriptiondates', $listSubClass->getSubscriptionString($subscriber->subid, true));
         $mailer->addParamInfo();
         $subscriber->ip = $ipClass->getIP();
         foreach ($subscriber as $fieldname => $value) {
             $mailer->addParam('user:' . $fieldname, $value);
         }
         $allUsers = explode(',', $config->get('notification_unsub'));
         foreach ($allUsers as $oneUser) {
             $mailer->sendOne('notification_unsub', $oneUser);
         }
     }
     $db = JFactory::getDBO();
     if ($this->forceConf || ($this->sendConf and !$app->isAdmin())) {
         $db->setQuery('SELECT DISTINCT `unsubmailid` FROM ' . acymailing_table('list') . ' WHERE `listid` IN (' . implode(',', $listids) . ') AND `published` = 1  AND `unsubmailid` > 0');
         $messages = acymailing_loadResultArray($db);
         if (!empty($messages)) {
             $config = acymailing_config();
             $mailHelper = acymailing_get('helper.mailer');
             $mailHelper->report = $config->get('unsub_message', true);
             $mailHelper->checkAccept = false;
             foreach ($messages as $mailid) {
                 $mailHelper->trackEmail = true;
                 $mailHelper->sendOne($mailid, $subid);
             }
         }
     }
     //end only frontend
     $db->setQuery('DELETE  FROM ' . acymailing_table('queue') . ' WHERE `subid` = ' . (int) $subid . ' AND `mailid` IN (SELECT `mailid` FROM ' . acymailing_table('listmail') . ' WHERE `listid` IN (' . implode(',', $listids) . '))');
     $db->query();
     JPluginHelper::importPlugin('acymailing');
     $dispatcher = JDispatcher::getInstance();
     $resultsTrigger = $dispatcher->trigger('onAcyUnsubscribe', array($subid, $listids));
 }
开发者ID:Roma48,项目名称:abazherka,代码行数:54,代码来源:list.php

示例2: acymailing_generateautonews

 public function acymailing_generateautonews(&$email)
 {
     $time = time();
     $tags = $this->acypluginsHelper->extractTags($email, 'autocontent');
     $return = new stdClass();
     $return->status = true;
     $return->message = '';
     $this->tags = array();
     if (empty($tags)) {
         return $return;
     }
     foreach ($tags as $oneTag => $parameter) {
         if (isset($this->tags[$oneTag])) {
             continue;
         }
         $allcats = explode('-', $parameter->id);
         $selectedArea = array();
         foreach ($allcats as $oneCat) {
             if (!ACYMAILING_J16) {
                 $sectype = substr($oneCat, 0, 3);
                 $num = substr($oneCat, 3);
                 if (empty($num)) {
                     continue;
                 }
                 if ($sectype == 'cat') {
                     $selectedArea[] = 'catid = ' . (int) $num;
                 } elseif ($sectype == 'sec') {
                     $selectedArea[] = 'sectionid = ' . (int) $num;
                 }
             } else {
                 if (empty($oneCat)) {
                     continue;
                 }
                 $selectedArea[] = intval($oneCat);
             }
         }
         $query = 'SELECT a.id FROM `#__content` as a ';
         $where = array();
         if (!empty($parameter->tags) && version_compare(JVERSION, '3.1.0', '>=')) {
             $tagsArray = explode(',', $parameter->tags);
             JArrayHelper::toInteger($tagsArray);
             if (!empty($tagsArray)) {
                 foreach ($tagsArray as $oneTagId) {
                     $query .= 'JOIN #__contentitem_tag_map AS tagsmap' . $oneTagId . ' ON (a.id = tagsmap' . $oneTagId . '.content_item_id AND tagsmap' . $oneTagId . '.type_alias LIKE "com_content.article" AND tagsmap' . $oneTagId . '.tag_id = ' . $oneTagId . ') ';
                 }
             }
         }
         if (!empty($parameter->featured)) {
             if (ACYMAILING_J16) {
                 $where[] = 'a.featured = 1';
             } else {
                 $query .= 'JOIN `#__content_frontpage` as b ON a.id = b.content_id ';
                 $where[] = 'b.content_id IS NOT NULL';
             }
         }
         if (!empty($parameter->nofeatured)) {
             if (ACYMAILING_J16) {
                 $where[] = 'a.featured = 0';
             } else {
                 $query .= 'LEFT JOIN `#__content_frontpage` as b ON a.id = b.content_id ';
                 $where[] = 'b.content_id IS NULL';
             }
         }
         if (ACYMAILING_J16 && !empty($parameter->subcats) && !empty($selectedArea)) {
             $this->db->setQuery('SELECT lft,rgt FROM #__categories WHERE id IN (' . implode(',', $selectedArea) . ')');
             $catinfos = $this->db->loadObjectList();
             if (!empty($catinfos)) {
                 $whereCats = array();
                 foreach ($catinfos as $onecat) {
                     $whereCats[] = 'lft > ' . $onecat->lft . ' AND rgt < ' . $onecat->rgt;
                 }
                 $this->db->setQuery('SELECT id FROM #__categories WHERE (' . implode(') OR (', $whereCats) . ')');
                 $othercats = acymailing_loadResultArray($this->db);
                 $selectedArea = array_merge($selectedArea, $othercats);
             }
         }
         if (!empty($selectedArea)) {
             if (!ACYMAILING_J16) {
                 $where[] = implode(' OR ', $selectedArea);
             } else {
                 $filter_cat = '`catid` IN (' . implode(',', $selectedArea) . ')';
                 if (file_exists(JPATH_SITE . DS . 'components' . DS . 'com_multicats')) {
                     $filter_cat = '`catid` REGEXP "^([0-9]+,)*' . implode('(,[0-9]+)*$" OR `catid` REGEXP "^([0-9]+,)*', $selectedArea) . '(,[0-9]+)*$"';
                 }
                 $where[] = $filter_cat;
             }
         }
         if (!empty($parameter->excludedcats)) {
             $excludedCats = explode('-', $parameter->excludedcats);
             JArrayHelper::toInteger($excludedCats);
             $filter_cat = '`catid` NOT IN ("' . implode('","', $excludedCats) . '")';
             if (file_exists(JPATH_SITE . DS . 'components' . DS . 'com_multicats')) {
                 $filter_cat = '`catid` NOT REGEXP "^([0-9]+,)*' . implode('(,[0-9]+)*$" AND `catid` NOT REGEXP "^([0-9]+,)*', $excludedCats) . '(,[0-9]+)*$"';
             }
             $where[] = $filter_cat;
         }
         if (!empty($parameter->filter) && !empty($email->params['lastgenerateddate'])) {
             $condition = '(`publish_up` > \'' . date('Y-m-d H:i:s', $email->params['lastgenerateddate'] - date('Z')) . '\' AND `publish_up` < \'' . date('Y-m-d H:i:s', $time - date('Z')) . '\')';
             $condition .= ' OR (`created` > \'' . date('Y-m-d H:i:s', $email->params['lastgenerateddate'] - date('Z')) . '\' AND `created` < \'' . date('Y-m-d H:i:s', $time - date('Z')) . '\')';
             if ($parameter->filter == 'modify') {
//.........这里部分代码省略.........
开发者ID:proyectoseb,项目名称:ShoppyStore,代码行数:101,代码来源:tagcontent.php

示例3: _displayHTML

    private function _displayHTML()
    {
        $config =& acymailing_config();
        $app = JFactory::getApplication();
        $mediaFolders = explode(',', $config->get('mediafolder', 'media/com_acymailing/upload'));
        $mediaFolders = $this->_generateSpecificFolders($mediaFolders);
        $receivedFolder = $app->getUserStateFromRequest(ACYMAILING_COMPONENT . ".acyeditor.selected_folder", 'selected_folder', '', 'string');
        $defaultFolder = reset($mediaFolders);
        if (!empty($receivedFolder)) {
            $allowed = false;
            foreach ($mediaFolders as $oneMedia) {
                if (preg_match('#^' . preg_quote($oneMedia) . '[a-z_0-9\\-/]*$#i', $receivedFolder)) {
                    $allowed = true;
                    break;
                }
            }
            if ($allowed) {
                $defaultFolder = $receivedFolder;
            } else {
                acymailing_display('You are not allowed to access this folder', 'error');
            }
        }
        $uploadPath = JPath::clean(ACYMAILING_ROOT . trim(str_replace('/', DS, trim($defaultFolder)), DS));
        $uploadedImage = JRequest::getVar('uploadedImage', array(), 'files', 'array');
        if (!empty($uploadedImage)) {
            if (!empty($uploadedImage['name'])) {
                if ($this->_importImage($uploadedImage, $uploadPath)) {
                    $uploadMessage = 'success';
                } else {
                    $uploadMessage = 'error';
                }
            } else {
                $uploadMessage = 'error';
                $this->message = JText::_('BROWSE_FILE');
            }
        }
        $pictToDelete = JRequest::getString('pictName', '');
        if (!empty($pictToDelete) && file_exists($uploadPath . DS . $pictToDelete)) {
            $db = JFactory::getDBO();
            $db->setQuery('SELECT * FROM #__acymailing_mail WHERE body like \'%src="' . ACYMAILING_LIVE . $defaultFolder . '/' . $pictToDelete . '"%\'');
            $checkPict = acymailing_loadResultArray($db);
            if (!empty($checkPict)) {
                acymailing_display(JText::_('ACY_CANT_DELETE') . ': ' . implode($checkPict, ', '), 'error');
            } else {
                if (JFile::delete($uploadPath . DS . $pictToDelete)) {
                    acymailing_display(JText::_('ACY_DELETED_PICT_SUCCESS'), 'success');
                } else {
                    acymailing_display(JText::_('ACY_DELETED_PICT_ERROR'), 'error');
                }
            }
        }
        ?>

		<div id="acy_media_browser" >
			<!-- <br style="font-size:1px"/> -->
			<table id="acy_media_browser_table" style="height:420px;">
				<tr>
					<td style="width:65%; vertical-align:top;">
						<?php 
        $folders = $this->_generateArborescence($mediaFolders);
        foreach ($folders as $folder) {
            $this->values[] = JHTML::_('select.option', $folder, $folder);
        }
        echo '<div style="display:inline-block;width:100%;">';
        echo '<form method="post" action="index.php?option=com_acymailing&ctrl=' . (JFactory::getApplication()->isAdmin() ? '' : 'front') . 'editor&task=createFolder" >';
        echo '<div id="acy_media_browser_path_dropdown" >';
        echo JHTML::_('select.genericlist', $this->values, 'acy_media_browser_files_path', 'class="inputbox chzn-done" size="1" onchange="changeFolder(this.value)" style="width:350px; min-height:19px;" ', 'value', 'text', $defaultFolder) . '<br />';
        echo '</div>';
        echo '<div id="acy_media_browser_global_create_folder" >';
        echo '<div id="acy_media_browser_create_folder" >';
        echo '<button id="create_folder_btn" class="btn" onclick="displayAppropriateField(this.id)" type="button" style="width:100%;" >' . JText::_('CREATE_FOLDER') . '</button>';
        echo '</div>';
        echo '<div id="acy_media_browser_area_create_folder" style=\'display:none;\'>';
        echo '<input id="subFolderName" name="subFolderName" type="text" placeholder="' . JText::_('FOLDER_NAME') . '" name="text" required="required" />';
        echo '<input type="submit" class="btn btn-primary" value="' . JText::_('ACY_APPLY') . '" />';
        echo '</div>';
        echo '</div>';
        echo JHTML::_('form.token');
        echo '</form>';
        echo '</div>';
        acymailing_createDir($uploadPath);
        $files = JFolder::files($uploadPath);
        echo '<ul id="acy_media_browser_list">';
        if (!empty($uploadMessage)) {
            if ($uploadMessage == 'success') {
                acymailing_display($this->message);
            } else {
                if ($uploadMessage == 'error') {
                    acymailing_display($this->message, 'error');
                }
            }
        }
        $images = array();
        $imagesFound = false;
        foreach ($files as $k => $file) {
            if (strrpos($file, '.') === false) {
                continue;
            }
            $ext = strtolower(substr($file, strrpos($file, '.') + 1));
            $extensions = array('jpg', 'jpeg', 'png', 'gif');
//.........这里部分代码省略.........
开发者ID:ForAEdesWeb,项目名称:AEW1,代码行数:101,代码来源:editor.php

示例4: complete_abtest

 function complete_abtest($typeAction, $mailid)
 {
     $db = JFactory::getDBO();
     $db->setQuery("SELECT abtesting FROM #__acymailing_mail WHERE mailid=" . (int) $mailid);
     $resDetails = acymailing_loadResultArray($db);
     $abTestDetail = unserialize($resDetails[0]);
     $dataForCopy = array('mailid' => $mailid, 'abTestDetail' => $abTestDetail);
     $newMailid = $this->abTest_createFinalNewletter($typeAction, $dataForCopy);
     $queueClass = acymailing_get('class.queue');
     $time = time();
     $queueClass->queue($newMailid, $time);
     $mailidsTest = $abTestDetail['mailids'];
     $db->setQuery("SELECT subid FROM #__acymailing_userstats WHERE mailid IN (" . $mailidsTest . ")");
     $resUsersFromTest = acymailing_loadResultArray($db);
     if (!empty($resUsersFromTest)) {
         $db->setQuery("DELETE FROM #__acymailing_queue WHERE subid IN (" . implode(',', $resUsersFromTest) . ") AND mailid=" . $newMailid);
         $db->query();
     }
     $abTestDetail['status'] = 'abTestFinalSend';
     $abTestDetail['newMail'] = $newMailid;
     $query = "UPDATE #__acymailing_mail SET abtesting=" . $db->quote(serialize($abTestDetail)) . " WHERE mailid IN (" . $mailidsTest . ")";
     $db->setQuery($query);
     $db->query();
     return $newMailid;
 }
开发者ID:proyectoseb,项目名称:ShoppyStore,代码行数:25,代码来源:mail.php

示例5: _ifstatement

 private function _ifstatement(&$email, $user)
 {
     if (isset($this->foundtags[$email->mailid])) {
         return;
     }
     $match = '#{if:(.*)}(.*){/if}#Uis';
     $variables = array('subject', '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) {
         $this->foundtags[$email->mailid] = false;
         return;
     }
     $app = JFactory::getApplication();
     static $a = false;
     $tags = array();
     foreach ($results as $var => $allresults) {
         foreach ($allresults[0] as $i => $oneTag) {
             if (isset($tags[$oneTag])) {
                 continue;
             }
             if (!preg_match('#^([^=!<>~]+)(=|!=|<|>|&gt;|&lt;|~)([^=!<>~]+)$#i', $allresults[1][$i], $operators)) {
                 if ($app->isAdmin()) {
                     acymailing_display('Operation not found : ' . $allresults[1][$i], 'error');
                 }
                 $tags[$oneTag] = $allresults[2][$i];
                 continue;
             }
             $field = trim($operators[1]);
             $prop = '';
             $operatorsParts = explode('.', $operators[1]);
             $operatorComp = 'acymailing';
             if (count($operatorsParts) == 2 and in_array($operatorsParts[0], array('acymailing', 'joomla', 'var'))) {
                 $operatorComp = $operatorsParts[0];
                 $field = $operatorsParts[1];
             }
             if ($operatorComp == 'joomla') {
                 if (!empty($user->userid)) {
                     if ($field == 'gid' && ACYMAILING_J16) {
                         $db = JFactory::getDBO();
                         $db->setQuery('SELECT group_id FROM #__user_usergroup_map WHERE user_id = ' . intval($user->userid));
                         $prop = implode(';', acymailing_loadResultArray($db));
                     } else {
                         $db = JFactory::getDBO();
                         $db->setQuery('SELECT * FROM #__users WHERE id = ' . intval($user->userid));
                         $juser = $db->loadObject();
                         if (isset($juser->{$field})) {
                             $prop = strtolower($juser->{$field});
                         } else {
                             if ($app->isAdmin() && !$a) {
                                 acymailing_display('User variable not set : ' . $field . ' in ' . $allresults[1][$i], 'error');
                             }
                             $a = true;
                         }
                     }
                 }
             } elseif ($operatorComp == 'var') {
                 $prop = $field;
             } else {
                 if (!isset($user->{$field})) {
                     if ($app->isAdmin() && !$a) {
                         acymailing_display('User variable not set : ' . $field . ' in ' . $allresults[1][$i], 'error');
                     }
                     $a = true;
                 } else {
                     $prop = strtolower($user->{$field});
                 }
             }
             $tags[$oneTag] = '';
             $val = trim(strtolower($operators[3]));
             if ($operators[2] == '=' and $prop == $val || in_array($prop, explode(';', $val)) || in_array($val, explode(';', $prop))) {
                 $tags[$oneTag] = $allresults[2][$i];
             } elseif ($operators[2] == '!=' and $prop != $val) {
                 $tags[$oneTag] = $allresults[2][$i];
             } elseif ($operators[2] == '>' || $operators[2] == '&gt;' and $prop > $val) {
                 $tags[$oneTag] = $allresults[2][$i];
             } elseif ($operators[2] == '<' || $operators[2] == '&lt;' and $prop < $val) {
                 $tags[$oneTag] = $allresults[2][$i];
             } elseif ($operators[2] == '~' and strpos($prop, $val) !== false) {
                 $tags[$oneTag] = $allresults[2][$i];
             }
         }
     }
     foreach ($results as $var => $allresults) {
         $email->{$var} = str_replace(array_keys($tags), $tags, $email->{$var});
     }
 }
开发者ID:unrealprojects,项目名称:journal,代码行数:95,代码来源:managetext.php

示例6: confirmSubscription

 function confirmSubscription($subid)
 {
     $historyClass = acymailing_get('class.acyhistory');
     $historyClass->insert($subid, 'confirmed');
     $userHelper = acymailing_get('helper.user');
     $ip = $userHelper->getIP();
     $this->database->setQuery('UPDATE ' . acymailing_table('subscriber') . ' SET `confirmed` = 1, `confirmed_date` = ' . time() . ', `confirmed_ip` = ' . $this->database->Quote($ip) . ' WHERE `subid` = ' . intval($subid) . ' LIMIT 1');
     if (!$this->database->query()) {
         acymailing_display('Please contact the admin of this website with the error message :<br />' . substr(strip_tags($this->database->getErrorMsg()), 0, 200) . '...', 'error');
         exit;
     }
     $this->database->setQuery('SELECT `listid` FROM ' . acymailing_table('listsub') . ' WHERE `status` = 2 AND `subid` = ' . intval($subid));
     $listids = acymailing_loadResultArray($this->database);
     JPluginHelper::importPlugin('acymailing');
     $dispatcher = JDispatcher::getInstance();
     $dispatcher->trigger('onAcyConfirmUser', array($subid));
     if ($this->geolocRight) {
         $classGeoloc = acymailing_get('class.geolocation');
         $this->geolocData = $classGeoloc->saveGeolocation('confirm', $subid);
     }
     if (empty($listids)) {
         return;
     }
     $listsubClass = acymailing_get('class.listsub');
     $listsubClass->sendConf = $this->sendWelcome;
     $listsubClass->forceConf = $this->forceConf;
     $listsubClass->sendNotif = $this->sendNotif;
     $listsubClass->updateSubscription($subid, array(1 => $listids));
 }
开发者ID:sumithMadhushan,项目名称:joomla-project,代码行数:29,代码来源:subscriber.php

示例7: onAcyProcessFilter_joomlagroup

 function onAcyProcessFilter_joomlagroup(&$query, $filter, $num)
 {
     $operator = empty($filter['type']) || $filter['type'] == 'IN' ? 'IS NOT NULL AND joomlauser' . $num . '.' . (ACYMAILING_J16 ? 'user_' : '') . 'id != 0' : "IS NULL";
     $filter['group'] = intval($filter['group']);
     if (!empty($filter['subgroups'])) {
         $db = JFactory::getDBO();
         $groupTable = ACYMAILING_J16 ? 'usergroups' : 'core_acl_aro_groups';
         $db->setQuery('SELECT lft, rgt FROM #__' . $groupTable . ' WHERE id = ' . $filter['group']);
         $lftrgt = $db->loadObject();
         $db->setQuery('SELECT id FROM #__' . $groupTable . ' WHERE lft > ' . $lftrgt->lft . ' AND rgt < ' . $lftrgt->rgt);
         $allGroups = acymailing_loadResultArray($db);
         array_unshift($allGroups, $filter['group']);
         $value = ' IN (' . implode(', ', $allGroups) . ')';
     } else {
         $value = ' = ' . $filter['group'];
     }
     if (!ACYMAILING_J16) {
         $query->leftjoin['joomlauser' . $num] = "#__users AS joomlauser{$num} ON joomlauser{$num}.id = sub.userid AND joomlauser{$num}.gid" . $value;
         $query->where[] = "joomlauser{$num}.id " . $operator;
     } else {
         $query->leftjoin['joomlauser' . $num] = "#__user_usergroup_map AS joomlauser{$num} ON joomlauser{$num}.user_id = sub.userid AND joomlauser{$num}.group_id" . $value;
         $query->where[] = "joomlauser{$num}.user_id " . $operator;
     }
 }
开发者ID:ForAEdesWeb,项目名称:AEW1,代码行数:24,代码来源:taguser.php

示例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();
 }
开发者ID:sam-akopyan,项目名称:hamradio,代码行数:93,代码来源:template.php

示例9: sobipro

 function sobipro()
 {
     $config = acymailing_config();
     $app = JFactory::getApplication();
     $db = JFactory::getDBO();
     $sobiproImport = JRequest::getVar('config', array(), 'POST', 'array');
     $newConfig = new stdClass();
     $affectedRows = 0;
     $newConfig->sobipro_import = serialize($sobiproImport);
     $config->save($newConfig);
     foreach ($sobiproImport as $oneImport => $oneValue) {
         $query = 'SELECT fid, nid FROM #__sobipro_field WHERE fid="' . $oneValue['sobiEmail'] . '" OR fid="' . $oneValue['sobiName'] . '"';
         $db->setQuery($query);
         $nidResult = $db->loadObjectList("fid");
         if (empty($nidResult[$oneValue['sobiEmail']]) or empty($nidResult[$oneValue['sobiName']])) {
             continue;
         }
         $time = time();
         $query = 'INSERT IGNORE INTO ' . acymailing_table('subscriber') . ' (`email`,`name`,`confirmed`,`created`,`enabled`,`accept`,`html`) SELECT b.baseData AS email, a.baseData AS name, 1 as confirmed, ' . $time . ' as created, 1 as enabled, 1 as accept, 1 as html FROM #__sobipro_field_data AS a LEFT JOIN #__sobipro_field_data AS b ON a.sid=b.sid WHERE a.`fid` = ' . $nidResult[$oneValue["sobiName"]]->fid . ' AND b.`fid` = ' . $nidResult[$oneValue["sobiEmail"]]->fid . ' AND b.baseData LIKE "%@%" AND b.baseData IS NOT NULL AND a.baseData IS NOT NULL ORDER by a.sid ';
         $db->setQuery($query);
         $db->query();
         $affectedRows += $db->getAffectedRows();
     }
     $app->enqueueMessage(JText::sprintf('IMPORT_NEW', $affectedRows));
     $query = 'SELECT b.subid FROM `#__sobipro_field_data` as a JOIN ' . acymailing_table('subscriber') . ' as b on a.baseData = b.email';
     $this->db->setQuery($query);
     $this->allSubid = acymailing_loadResultArray($this->db);
     $this->_subscribeUsers();
     $this->_displaySubscribedResult();
     return true;
 }
开发者ID:alesconti,项目名称:FF_2015,代码行数:31,代码来源:import.php

示例10: deleteAddress

 function deleteAddress(&$allSubid, $userList)
 {
     $db = JFactory::getDBO();
     $subscriberClass = acymailing_get('class.subscriber');
     $IdArray = array();
     foreach ($allSubid as $oneID) {
         $IdArray[] = $db->Quote($oneID);
     }
     $query = 'SELECT subid FROM  #__acymailing_subscriber WHERE zoholist LIKE "' . $userList[0] . '" AND zohoid IS NOT NULL AND subid NOT IN (' . implode(',', $IdArray) . ')';
     $db->setQuery($query);
     $subidToDelete = acymailing_loadResultArray($db);
     $subscriberClass->delete($subidToDelete);
 }
开发者ID:ForAEdesWeb,项目名称:AEW4,代码行数:13,代码来源:zoho.php

示例11: onAcyProcessFilter_hikaorder

 function onAcyProcessFilter_hikaorder(&$query, $filter, $num)
 {
     if (!$this->loadAcymailing()) {
         return;
     }
     $config =& hikashop_config();
     $statuses = explode(',', $config->get('invoice_order_statuses', 'confirmed,shipped'));
     $condition = array();
     foreach ($statuses as $status) {
         $condition[] = $query->db->Quote($status);
     }
     $myquery = "SELECT DISTINCT b.user_email\r\n\t\t\t\t\tFROM #__hikashop_order_product AS a\r\n\t\t\t\t\tLEFT JOIN #__hikashop_order AS c ON a.order_id = c.order_id\r\n\t\t\t\t\tLEFT JOIN #__hikashop_user AS b on c.order_user_id = b.user_id\r\n\t\t\t\t\tWHERE c.order_status IN (" . implode(',', $condition) . ")";
     if (!empty($filter['product']) and is_numeric($filter['product'])) {
         $myquery .= " AND a.product_id = " . (int) $filter['product'];
     } elseif (!empty($filter['cat']) and is_numeric($filter['cat'])) {
         $myquery .= " AND a.product_id IN (SELECT product_id FROM #__hikashop_product_category WHERE category_id = " . $filter['cat'] . ")";
     }
     $datesVar = array('creationdatesup', 'creationdateinf');
     foreach ($datesVar as $oneDate) {
         if (empty($filter[$oneDate])) {
             continue;
         }
         $filter[$oneDate] = acymailing_replaceDate($filter[$oneDate]);
         if (!is_numeric($filter[$oneDate])) {
             $filter[$oneDate] = strtotime($filter[$oneDate]);
         }
     }
     if (empty($filter['datefield'])) {
         $filter['datefield'] = 'order_created';
     }
     if (!empty($filter['creationdateinf'])) {
         $myquery .= ' AND c.`' . $filter['datefield'] . '` > ' . $filter['creationdateinf'];
     }
     if (!empty($filter['creationdatesup'])) {
         $myquery .= ' AND c.`' . $filter['datefield'] . '` < ' . $filter['creationdatesup'];
     }
     $query->db->setQuery($myquery);
     $allEmails = acymailing_loadResultArray($query->db);
     if (empty($allEmails)) {
         $allEmails[] = 'none';
     }
     if (empty($filter['type'])) {
         $query->where[] = "sub.email NOT IN ('" . implode("','", $allEmails) . "')";
     } else {
         $query->where[] = "sub.email IN ('" . implode("','", $allEmails) . "')";
     }
 }
开发者ID:q0821,项目名称:esportshop,代码行数:47,代码来源:hikashop.php

示例12: sendarchive

	function sendarchive(){

		$config = acymailing_config();
		if(!$config->get('show_receiveemail',0)) return $this->listing();

		JRequest::checkToken() or die( 'Please make sure your cookies are enabled' );
		acymailing_checkRobots();

		$receiveEmails = JRequest::getVar( 'receivemail', array(), '', 'array' );

		$email = trim(JRequest::getString('email'));

		$userClass = acymailing_get('helper.user');
		if(!$userClass->validEmail($email,true)){
			echo "<script>alert('".JText::_('VALID_EMAIL',true)."'); window.history.go(-1);</script>";
			exit;
		}

		$captchaClass = acymailing_get('class.acycaptcha');
		$captchaClass->state = 'acycaptchacomponent';
		if(!$captchaClass->check(JRequest::getString('acycaptcha'))){
			$captchaClass->returnError();
		}

		JArrayHelper::toInteger( $receiveEmails, array() );

		$db = JFactory::getDBO();
		$db->setQuery("SELECT mailid FROM #__acymailing_mail WHERE mailid IN ('".implode("','",$receiveEmails)."') AND published = 1 AND visible = 1");
		$mailids = acymailing_loadResultArray($db);

		$receiver = new stdClass();
		$receiver->email = $email;
		$receiver->subid = 0;
		$receiver->html = 1;
		$receiver->name = trim(strip_tags(JRequest::getString('name','')));

		$mailerHelper = acymailing_get('helper.mailer');
		$mailerHelper->checkConfirmField = false;
		$mailerHelper->checkEnabled = false;
		$mailerHelper->checkAccept = false;
		$mailerHelper->loadedToSend = true;

		foreach($mailids as $oneMailid){
			$mailerHelper->sendOne($oneMailid,$receiver);
		}

		return $this->listing();
	}
开发者ID:utopszkij,项目名称:lmp,代码行数:48,代码来源:archive.php

示例13: confirmSubscription

 function confirmSubscription($subid)
 {
     $historyClass = acymailing_get('class.acyhistory');
     $historyClass->insert($subid, 'confirmed');
     $this->database->setQuery('UPDATE ' . acymailing_table('subscriber') . ' SET `confirmed` = 1 WHERE `subid` = ' . intval($subid) . ' LIMIT 1');
     $this->database->query();
     $this->database->setQuery('SELECT `listid` FROM ' . acymailing_table('listsub') . ' WHERE `status` = 2 AND `subid` = ' . intval($subid));
     $listids = acymailing_loadResultArray($this->database);
     if (empty($listids)) {
         return;
     }
     $listsubClass = acymailing_get('class.listsub');
     $listsubClass->sendConf = $this->sendWelcome;
     $listsubClass->sendNotif = $this->sendNotif;
     $listsubClass->updateSubscription($subid, array(1 => $listids));
 }
开发者ID:alesconti,项目名称:FF_2015,代码行数:16,代码来源:subscriber.php

示例14: _sendtest

 function _sendtest()
 {
     JRequest::checkToken() or die('Invalid Token');
     $mailid = acymailing_getCID('mailid');
     $test_selection = JRequest::getVar('test_selection', '', '', 'string');
     if (empty($mailid) or empty($test_selection)) {
         return false;
     }
     $app = JFactory::getApplication();
     $mailer = acymailing_get('helper.mailer');
     $mailer->forceVersion = JRequest::getVar('test_html', 1, '', 'int');
     $mailer->autoAddUser = true;
     if ($app->isAdmin()) {
         $mailer->SMTPDebug = 1;
     }
     $mailer->checkConfirmField = false;
     $comment = JRequest::getString('commentTest', '');
     if (!empty($comment)) {
         $mailer->introtext = '<div align="center" style="width:600px;margin:auto;margin-top:10px;margin-bottom:10px;padding:10px;border:1px solid #cccccc;background-color:#f6f6f6;color:#333333;">' . nl2br($comment) . '</div>';
     }
     $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)) {
         $app->enqueueMessage(JText::_('NO_SUBSCRIBER'), 'notice');
         return false;
     }
     $result = true;
     foreach ($receivers as $receiver) {
         $result = $mailer->sendOne($mailid, $receiver) && $result;
     }
     return $result;
 }
开发者ID:proyectoseb,项目名称:University,代码行数:53,代码来源:newsletter.php

示例15: acymailing_generateautonews

 public function acymailing_generateautonews(&$email)
 {
     $acypluginsHelper = acymailing_get('helper.acyplugins');
     $return = new stdClass();
     $return->status = true;
     $return->message = '';
     $time = time();
     $match = '#{autocontent:(.*)}#Ui';
     $variables = array('subject', '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 $return;
     }
     $this->tags = array();
     $db = JFactory::getDBO();
     foreach ($results as $var => $allresults) {
         foreach ($allresults[0] as $i => $oneTag) {
             if (isset($this->tags[$oneTag])) {
                 continue;
             }
             $parameter = $acypluginsHelper->extractTag($allresults[1][$i]);
             $allcats = explode('-', $parameter->id);
             $selectedArea = array();
             foreach ($allcats as $oneCat) {
                 if (!ACYMAILING_J16) {
                     $sectype = substr($oneCat, 0, 3);
                     $num = substr($oneCat, 3);
                     if (empty($num)) {
                         continue;
                     }
                     if ($sectype == 'cat') {
                         $selectedArea[] = 'catid = ' . (int) $num;
                     } elseif ($sectype == 'sec') {
                         $selectedArea[] = 'sectionid = ' . (int) $num;
                     }
                 } else {
                     if (empty($oneCat)) {
                         continue;
                     }
                     $selectedArea[] = (int) $oneCat;
                 }
             }
             $query = 'SELECT a.id FROM `#__content` as a ';
             $where = array();
             if (!empty($parameter->featured)) {
                 if (ACYMAILING_J16) {
                     $where[] = 'a.featured = 1';
                 } else {
                     $query .= 'JOIN `#__content_frontpage` as b ON a.id = b.content_id ';
                     $where[] = 'b.content_id IS NOT NULL';
                 }
             }
             if (!empty($parameter->nofeatured)) {
                 if (ACYMAILING_J16) {
                     $where[] = 'a.featured = 0';
                 } else {
                     $query .= 'LEFT JOIN `#__content_frontpage` as b ON a.id = b.content_id ';
                     $where[] = 'b.content_id IS NULL';
                 }
             }
             if (ACYMAILING_J16 && !empty($parameter->subcats) && !empty($selectedArea)) {
                 $db->setQuery('SELECT lft,rgt FROM #__categories WHERE id IN (' . implode(',', $selectedArea) . ')');
                 $catinfos = $db->loadObjectList();
                 if (!empty($catinfos)) {
                     $whereCats = array();
                     foreach ($catinfos as $onecat) {
                         $whereCats[] = 'lft > ' . $onecat->lft . ' AND rgt < ' . $onecat->rgt;
                     }
                     $db->setQuery('SELECT id FROM #__categories WHERE (' . implode(') OR (', $whereCats) . ')');
                     $othercats = acymailing_loadResultArray($db);
                     $selectedArea = array_merge($selectedArea, $othercats);
                 }
             }
             if (!empty($selectedArea)) {
                 if (!ACYMAILING_J16) {
                     $where[] = implode(' OR ', $selectedArea);
                 } else {
                     $where[] = '`catid` IN (' . implode(',', $selectedArea) . ')';
                 }
             }
             if (!empty($parameter->excludedcats)) {
                 $excludedCats = explode('-', $parameter->excludedcats);
                 JArrayHelper::toInteger($excludedCats);
                 $where[] = '`catid` NOT IN ("' . implode('","', $excludedCats) . '")';
             }
             if (!empty($parameter->filter) and !empty($email->params['lastgenerateddate'])) {
                 $condition = '`publish_up` >\'' . date('Y-m-d H:i:s', $email->params['lastgenerateddate'] - date('Z')) . '\'';
                 $condition .= ' OR `created` >\'' . date('Y-m-d H:i:s', $email->params['lastgenerateddate'] - date('Z')) . '\'';
                 if ($parameter->filter == 'modify') {
                     $condition .= ' OR (';
                     $condition .= ' `modified` > \'' . date('Y-m-d H:i:s', $email->params['lastgenerateddate'] - date('Z')) . '\'';
//.........这里部分代码省略.........
开发者ID:freaqzilla,项目名称:joomla-site,代码行数:101,代码来源:tagcontent.php


注:本文中的acymailing_loadResultArray函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。