本文整理汇总了PHP中acymailing_get函数的典型用法代码示例。如果您正苦于以下问题:PHP acymailing_get函数的具体用法?PHP acymailing_get怎么用?PHP acymailing_get使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了acymailing_get函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: continuesend
function continuesend()
{
$config = acymailing_config();
if (acymailing_level(1) && $config->get('queue_type') == 'onlyauto') {
JRequest::setVar('tmpl', 'component');
acymailing_display(JText::_('ACY_ONLYAUTOPROCESS'), 'warning');
return;
}
$newcrontime = time() + 120;
if ($config->get('cron_next') < $newcrontime) {
$newValue = new stdClass();
$newValue->cron_next = $newcrontime;
$config->save($newValue);
}
$mailid = acymailing_getCID('mailid');
$totalSend = JRequest::getVar('totalsend', 0, '', 'int');
$alreadySent = JRequest::getVar('alreadysent', 0, '', 'int');
$helperQueue = acymailing_get('helper.queue');
$helperQueue->mailid = $mailid;
$helperQueue->report = true;
$helperQueue->total = $totalSend;
$helperQueue->start = $alreadySent;
$helperQueue->pause = $config->get('queue_pause');
$helperQueue->process();
JRequest::setVar('tmpl', 'component');
}
示例2: getInput
function getInput()
{
include_once rtrim(JPATH_ADMINISTRATOR, DS) . DS . 'components' . DS . 'com_acymailing' . DS . 'helpers' . DS . 'helper.php';
$listType = acymailing_get('type.lists');
array_shift($listType->values);
return $listType->display($this->name, (int) $this->value, false);
}
示例3: getInput
function getInput() {
$listType = acymailing_get('type.lists');
array_shift($listType->values);
return $listType->display($this->name,(int) $this->value,false);
}
示例4: remove
function remove()
{
if (!$this->isAllowed($this->aclCat, 'delete')) {
return;
}
JRequest::checkToken() or die('Invalid Token');
$mailid = JRequest::getVar('filter_mail', 0, 'post', 'int');
$queueClass = acymailing_get('class.queue');
$search = JRequest::getString('search');
$filters = array();
if (!empty($search)) {
$db = JFactory::getDBO();
$searchVal = '\'%' . acymailing_getEscaped($search, true) . '%\'';
$searchFields = array('b.name', 'b.email', 'c.subject', 'a.mailid', 'a.subid');
$filters[] = implode(" LIKE {$searchVal} OR ", $searchFields) . " LIKE {$searchVal}";
}
if (!empty($mailid)) {
$filters[] = 'a.mailid = ' . intval($mailid);
}
$total = $queueClass->delete($filters);
$app = JFactory::getApplication();
$app->enqueueMessage(JText::sprintf('SUCC_DELETE_ELEMENTS', $total), 'message');
JRequest::setVar('filter_mail', 0, 'post');
JRequest::setVar('search', '', 'post');
return $this->listing();
}
示例5: insert
function insert($subid, $action, $data = array(), $mailid = 0)
{
$user =& JFactory::getUser();
if (!empty($user->id)) {
$data[] = 'EXECUTED_BY::' . $user->id . ' ( ' . $user->username . ' )';
}
$history = new stdClass();
$history->subid = intval($subid);
$history->action = strip_tags($action);
$history->data = implode("\n", $data);
if (strlen($history->data) > 100000) {
$history->data = substr($history->data, 0, 10000);
}
$history->date = time();
$history->mailid = $mailid;
$userHelper = acymailing_get('helper.user');
$history->ip = $userHelper->getIP();
if (!empty($_SERVER)) {
$source = array();
$vars = array('HTTP_REFERER', 'HTTP_USER_AGENT', 'HTTP_HOST', 'SERVER_ADDR', 'REMOTE_ADDR', 'REQUEST_URI', 'QUERY_STRING');
foreach ($vars as $oneVar) {
if (!empty($_SERVER[$oneVar])) {
$source[] = $oneVar . '::' . strip_tags($_SERVER[$oneVar]);
}
}
$history->source = implode("\n", $source);
}
return $this->database->insertObject(acymailing_table('history'), $history);
}
示例6: test
function test()
{
if (!$this->isAllowed('configuration', 'manage')) {
return;
}
$app =& JFactory::getApplication();
$this->store();
acymailing_displayErrors();
$config = acymailing_config();
$user =& JFactory::getUser();
$mailClass = acymailing_get('helper.mailer');
$addedName = $config->get('add_names', true) ? $mailClass->cleanText($user->name) : '';
$mailClass->AddAddress($user->email, $addedName);
$mailClass->Subject = 'Test e-mail from ' . ACYMAILING_LIVE;
$mailClass->Body = JText::_('TEST_EMAIL');
$mailClass->SMTPDebug = 1;
$result = $mailClass->send();
if (!$result) {
$bounce = $config->get('bounce_email');
if ($config->get('mailer_method') == 'smtp' && $config->get('smtp_secured') == 'ssl' && !function_exists('openssl_sign')) {
$app->enqueueMessage('The PHP Extension openssl is not enabled on your server, this extension is required to use an SSL connection, please enable it', 'notice');
} elseif (!empty($bounce) and !in_array($config->get('mailer_method'), array('smtp', 'smtp_com', 'elasticemail'))) {
$app->enqueueMessage(JText::sprintf('ADVICE_BOUNCE', $bounce), 'notice');
} elseif ($config->get('mailer_method') == 'smtp' and !$config->get('smtp_auth') and strlen($config->get('smtp_password')) > 1) {
$app->enqueueMessage(JText::_('ADVICE_SMTP_AUTH'), 'notice');
} elseif ((strpos(ACYMAILING_LIVE, 'localhost') or strpos(ACYMAILING_LIVE, '127.0.0.1')) and in_array($config->get('mailer_method'), array('sendmail', 'qmail', 'mail'))) {
$app->enqueueMessage(JText::_('ADVICE_LOCALHOST'), 'notice');
}
}
return $this->display();
}
示例7: saveStats
function saveStats()
{
$subid = JRequest::getInt('subid');
$mailid = JRequest::getInt('mailid');
if (empty($subid) or empty($mailid)) {
return false;
}
$db = JFactory::getDBO();
$db->setQuery('SELECT open FROM ' . acymailing_table('userstats') . ' WHERE mailid = ' . $mailid . ' AND subid = ' . $subid . ' LIMIT 1');
$actual = $db->loadObject();
if (empty($actual)) {
return false;
}
$open = 0;
if (empty($actual->open)) {
$open = 1;
$unique = ',openunique = openunique +1';
} elseif ($this->countReturn) {
$open = $actual->open + 1;
$unique = '';
}
if (empty($open)) {
return true;
}
$db->setQuery('UPDATE ' . acymailing_table('userstats') . ' SET open = ' . $open . ', opendate = ' . time() . ' WHERE mailid = ' . $mailid . ' AND subid = ' . $subid . ' LIMIT 1');
$db->query();
$db->setQuery('UPDATE ' . acymailing_table('stats') . ' SET opentotal = opentotal +1 ' . $unique . ' WHERE mailid = ' . $mailid . ' LIMIT 1');
$db->query();
if (!empty($subid)) {
$filterClass = acymailing_get('class.filter');
$filterClass->subid = $subid;
$filterClass->trigger('opennews');
}
return true;
}
示例8: onBeforeMailPrepare
public function onBeforeMailPrepare(&$mail, &$mailer, &$do){
if(empty($mail->mail_name)) return false;
require_once(rtrim(JPATH_ADMINISTRATOR,DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR.'components'.DIRECTORY_SEPARATOR.'com_acymailing'.DIRECTORY_SEPARATOR.'helpers'.DIRECTORY_SEPARATOR.'helper.php');
$alias_email = 'hikashop-'.str_replace('_', '-', $mail->mail_name);
$mailClass = acymailing_get('class.mail');
$overrideEmail = $mailClass->get($alias_email);
if(empty($overrideEmail) || $overrideEmail->published == 0) return false;
$acymailer = acymailing_get('helper.acymailer');
$acymailer->checkConfirmField = false;
$acymailer->checkEnabled = false;
$acymailer->checkAccept = false;
$acymailer->autoAddUser = true;
$acymailer->report = false;
$acymailer->trackEmail = true;
foreach($mail->data as $dataName => $dataValue){
if(is_string($dataValue)){
$acymailer->addParam($dataName, $dataValue);
} else{
foreach($dataValue as $dataSName => $dataSValue){
if(is_string($dataSValue)) $acymailer->addParam($dataName.'_'.$dataSName, $dataSValue);
}
}
}
$statusSend = $acymailer->sendOne($overrideEmail->mailid, $mail->data->email);
$app = JFactory::getApplication();
if(!$statusSend) $app->enqueueMessage(nl2br($acymailer->reportMessage), 'error');
$mail->mail_success = $statusSend;
$do = false;
return $statusSend;
}
示例9: Process
public function Process()
{
// Newsletter component disabled or not found. Aborting.
if (!$this->enabled) {
return true;
}
$config = acymailing_config();
// Build subscriber object
$subscriber = new stdClass();
// Name field may be absent. AcyMailing will guess the user's name from his email address
$subscriber->name = isset($this->FieldsBuilder->Fields['sender0']) ? $this->FieldsBuilder->Fields['sender0']['Value'] : "";
// AcyMailing refuses to save the user (return false) if the email address is empty, so we don't care to check it
$subscriber->email = empty($this->FieldsBuilder->Fields['sender1']['Value']) ? NULL : JMailHelper::cleanAddress($this->FieldsBuilder->Fields['sender1']['Value']);
// It seems that $subscriber->confirmed defaults to unconfirmed if unset, so we need to read and pass the actual value from the configuration
//ADRIEN : not necessary, you should keep the user as unconfirmed, Acy will take care of that
//$subscriber->confirmed = !(bool)$config->get('require_confirmation');
$userClass = acymailing_get('class.subscriber');
$userClass->checkVisitor = false;
// Add or update the user
$sub_id = $userClass->save($subscriber);
if (empty($sub_id)) {
// User save failed. Probably email address is empty or invalid
$this->logger->Write(get_class($this) . " Process(): User save failed");
return true;
}
// Lists
$cumulative = JRequest::getVar("acymailing_subscribe_cumulative", NULL, "POST");
$checkboxes = array(FAcyMailing::subscribe => JRequest::getVar("acymailing_subscribe", array(), "POST"));
$lists = $cumulative ? $checkboxes : array();
// Subscription
//$listsubClass = acymailing_get('class.listsub');
//$listsubClass->addSubscription($sub_id, $lists);
// ADRIEN : we use an other function so Acy will check the subscription and only subscribe the user if he was not already subscribed to that list.
/*
$newSubscription = array();
if(!empty($lists)){
foreach($lists[FAcyMailing::subscribe] as $listId){
$newList = array();
$newList['status'] = FAcyMailing::subscribe;
$newSubscription[$listId] = $newList;
}
$userClass->saveSubscription($sub_id, $newSubscription);
}
*/
// When in mode "one checkbox for each list" and no lists selected the code above produce an SQL error because passes an empty array to saveSubscription()
$newSubscription = array();
foreach ($lists[FAcyMailing::subscribe] as $listId) {
$newList = array();
$newList['status'] = FAcyMailing::subscribe;
$newSubscription[$listId] = $newList;
}
if (!empty($newSubscription)) {
$userClass->saveSubscription($sub_id, $newSubscription);
}
// implode() doesn't accept NULL values :(
@$lists[FAcyMailing::subscribe] or $lists[FAcyMailing::subscribe] = array();
// Log
$this->logger->Write(get_class($this) . " Process(): subscribed " . $this->FieldsBuilder->Fields['sender0']['Value'] . " (" . $this->FieldsBuilder->Fields['sender1']['Value'] . ") to lists " . implode(",", $lists[FAcyMailing::subscribe]));
return true;
}
示例10: listing
function listing()
{
$app = JFactory::getApplication();
global $Itemid;
$config = acymailing_config();
$jsite = JFactory::getApplication('site');
$menus = $jsite->getMenu();
$menu = $menus->getActive();
if (empty($menu) and !empty($Itemid)) {
$menus->setActive($Itemid);
$menu = $menus->getItem($Itemid);
}
if (empty($menu)) {
acymailing_enqueueMessage(JText::_('ACY_NOTALLOWED'));
$app->redirect('index.php');
}
$selectedLists = 'all';
if (is_object($menu)) {
jimport('joomla.html.parameter');
$menuparams = new acyParameter($menu->params);
$this->assign('listsintrotext', $menuparams->get('listsintrotext'));
$this->assign('listsfinaltext', $menuparams->get('listsfinaltext'));
$selectedLists = $menuparams->get('lists', 'all');
$document = JFactory::getDocument();
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'));
}
}
if (empty($menuparams)) {
$pathway = $app->getPathway();
$pathway->addItem(JText::_('MAILING_LISTS'));
}
$document = JFactory::getDocument();
$link = '&format=feed&limitstart=';
if ($config->get('acyrss_format') == 'rss' || $config->get('acyrss_format') == 'both') {
$attribs = array('type' => 'application/rss+xml', 'title' => 'RSS 2.0');
$document->addHeadLink(JRoute::_($link . '&type=rss'), 'alternate', 'rel', $attribs);
}
if ($config->get('acyrss_format') == 'atom' || $config->get('acyrss_format') == 'both') {
$attribs = array('type' => 'application/atom+xml', 'title' => 'Atom 1.0');
$document->addHeadLink(JRoute::_($link . '&type=atom'), 'alternate', 'rel', $attribs);
}
$listsClass = acymailing_get('class.list');
$allLists = $listsClass->getLists('', $selectedLists);
if (acymailing_level(1)) {
$allLists = $listsClass->onlyCurrentLanguage($allLists);
}
$myItem = empty($Itemid) ? '' : '&Itemid=' . $Itemid;
$this->assignRef('rows', $allLists);
$this->assignRef('item', $myItem);
}
示例11: listing
function listing()
{
$app = JFactory::getApplication();
$config = acymailing_config();
if (!class_exists('plgSystemAcymailingClassMail')) {
$app->enqueueMessage('AcyMailing can customize some Joomla messages. If you want to do this, please first <a href="index.php?option=com_acymailing&ctrl=cpanel">enable the plugin acymailingclassmail</a>', 'notice');
}
$pageInfo = new stdClass();
$pageInfo->filter = new stdClass();
$pageInfo->filter->order = new stdClass();
$paramBase = ACYMAILING_COMPONENT . '.' . $this->getName();
$pageInfo->filter->order->value = $app->getUserStateFromRequest($paramBase . ".filter_order", 'filter_order', 'mailid', 'cmd');
$pageInfo->filter->order->dir = $app->getUserStateFromRequest($paramBase . ".filter_order_Dir", 'filter_order_Dir', 'desc', 'word');
$db = JFactory::getDBO();
$query = 'SELECT mailid, subject, alias, fromname, published, fromname, fromemail, replyname, replyemail FROM #__acymailing_mail WHERE `type` = ' . $db->Quote($this->type);
if (!empty($pageInfo->filter->order->value)) {
$query .= ' ORDER BY ' . $pageInfo->filter->order->value . ' ' . $pageInfo->filter->order->dir;
}
$db->setQuery($query);
$rows = $db->loadObjectList();
acymailing_setTitle(JText::_($this->nameListing), $this->icon, $this->ctrl);
$bar = JToolBar::getInstance('toolbar');
JToolBarHelper::custom('preview', 'acypreview', '', JText::_('ACY_PREVIEW'), true);
JToolBarHelper::editList();
JToolBarHelper::deleteList(JText::_('ACY_VALIDDELETEITEMS'));
JToolBarHelper::divider();
$bar->appendButton('Pophelp', $this->doc);
$bar->appendButton('Link', 'acymailing', JText::_('ACY_CPANEL'), acymailing_completeLink('dashboard'));
$toggleClass = acymailing_get('helper.toggle');
$this->assignRef('toggleClass', $toggleClass);
$this->assignRef('pageInfo', $pageInfo);
$this->assign('config', $config);
$this->assign('rows', $rows);
}
示例12: listing
function listing()
{
JRequest::setVar('tmpl', 'component');
$statsClass = acymailing_get('class.stats');
$statsClass->saveStats();
header('Cache-Control: no-store, no-cache, must-revalidate');
header('Cache-Control: post-check=0, pre-check=0', false);
header('Pragma: no-cache');
header("Expires: Wed, 17 Sep 1975 21:32:10 GMT");
ob_end_clean();
JPluginHelper::importPlugin('acymailing');
$this->dispatcher = JDispatcher::getInstance();
$results = $this->dispatcher->trigger('acymailing_getstatpicture');
$picture = reset($results);
if (empty($picture)) {
$picture = 'media/com_acymailing/images/statpicture.png';
}
$picture = ltrim(str_replace(array('\\', '/'), DS, $picture), DS);
$imagename = ACYMAILING_ROOT . $picture;
$handle = fopen($imagename, 'r');
if (!$handle) {
exit;
}
header("Content-type: image/png");
$contents = fread($handle, filesize($imagename));
fclose($handle);
echo $contents;
exit;
}
示例13: onAfterRender
function onAfterRender()
{
if (empty($this->urlid)) {
return;
}
$urlClass = acymailing_get('class.url');
$urlClass->saveCurrentUrlName($this->urlid);
}
示例14: getInput
function getInput()
{
$listType = acymailing_get('type.lists');
if (empty($this->element['menu']) || (string) $this->element['menu'] != 'archive') {
array_shift($listType->values);
}
return $listType->display($this->name, (int) $this->value, false);
}
示例15: view
function view()
{
$statsClass = acymailing_get('class.stats');
$statsClass->countReturn = false;
$statsClass->saveStats();
JRequest::setVar('layout', 'view');
return parent::display();
}