本文整理汇总了PHP中acymailing_config函数的典型用法代码示例。如果您正苦于以下问题:PHP acymailing_config函数的具体用法?PHP acymailing_config怎么用?PHP acymailing_config使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了acymailing_config函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: send
function send()
{
if (!$this->isAllowed('configuration', 'manage')) {
return;
}
JRequest::checkToken() or die('Invalid Token');
$bodyEmail = JRequest::getString('mailbody');
$code = JRequest::getString('code');
JRequest::setVar('code', $code);
if (empty($code)) {
return;
}
$config = acymailing_config();
$mailer = acymailing_get('helper.mailer');
$mailer->Subject = '[ACYMAILING LANGUAGE FILE] ' . $code;
$mailer->Body = 'The website ' . ACYMAILING_LIVE . ' using AcyMailing ' . $config->get('level') . $config->get('version') . ' sent a language file : ' . $code;
$mailer->Body .= "\n" . "\n" . "\n" . $bodyEmail;
$user = JFactory::getUser();
$mailer->AddAddress($user->email, $user->name);
$mailer->AddAddress('translate@acyba.com', 'Acyba Translation Team');
$mailer->report = false;
jimport('joomla.filesystem.file');
$path = JPath::clean(JLanguage::getLanguagePath(JPATH_ROOT) . DS . $code . DS . $code . '.com_acymailing.ini');
$mailer->AddAttachment($path);
$result = $mailer->Send();
if ($result) {
acymailing_display(JText::_('THANK_YOU_SHARING'), 'success');
acymailing_display($mailer->reportMessage, 'success');
} else {
acymailing_display($mailer->reportMessage, 'error');
}
}
示例2: 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);
}
示例3: remove
function remove()
{
JRequest::checkToken() or die('Invalid Token');
$app = JFactory::getApplication();
$config = acymailing_config();
$deleteBehaviour = $config->get('frontend_delete_button', 'delete');
$subscriberIds = JRequest::getVar('cid', array(), '', 'array');
if ($app->isAdmin() || $deleteBehaviour == 'delete') {
if (!$this->isAllowed('subscriber', 'delete')) {
return;
}
$subscriberObject = acymailing_get('class.subscriber');
$num = $subscriberObject->delete($subscriberIds);
$app->enqueueMessage(JText::sprintf('SUCC_DELETE_ELEMENTS', $num), 'message');
} else {
if (!$this->isAllowed('subscriber', 'manage')) {
return;
}
$listId = JRequest::getInt('filter_lists', 0);
if (empty($listId)) {
$app->enqueueMessage('List not found', 'error');
} else {
$listsubClass = acymailing_get('class.listsub');
foreach ($subscriberIds as $subid) {
$listsubClass->removeSubscription($subid, array($listId));
}
$listClass = acymailing_get('class.list');
$list = $listClass->get($listId);
$app->enqueueMessage(JText::sprintf('IMPORT_REMOVE', count($subscriberIds), $list->name), 'message');
}
}
JRequest::setVar('layout', 'listing');
return parent::display();
}
示例4: acyqueueHelper
public function acyqueueHelper()
{
$this->config = acymailing_config();
$this->subClass = acymailing_get('class.subscriber');
$this->listsubClass = acymailing_get('class.listsub');
$this->listsubClass->checkAccess = false;
$this->listsubClass->sendNotif = false;
$this->listsubClass->sendConf = false;
$this->send_limit = (int) $this->config->get('queue_nbmail', 40);
acymailing_increasePerf();
@ini_set('default_socket_timeout', 10);
@ignore_user_abort(true);
$timelimit = intval(ini_get('max_execution_time'));
if (empty($timelimit)) {
$timelimit = 600;
}
$calculatedTimeout = $this->config->get('max_execution_time');
if (!empty($calculatedTimeout) && $calculatedTimeout < $timelimit) {
$timelimit = $calculatedTimeout;
}
if (!empty($timelimit)) {
$this->stoptime = time() + $timelimit - 4;
}
$this->db = JFactory::getDBO();
}
示例5: getInput
function getInput() {
$config =& acymailing_config();
$level = $config->get('level');
$link = ACYMAILING_HELPURL.$this->value.'&level='.$level;
$text = '<a class="modal" title="'.JText::_('ACY_HELP',true).'" href="'.$link.'" rel="{handler: \'iframe\', size: {x: 800, y: 500}}"><button class="btn" onclick="return false">'.JText::_('ACY_HELP').'</button></a>';
return $text;
}
示例6: validEmail
function validEmail($email, $extended = false)
{
if (empty($email) or !is_string($email)) {
return false;
}
if (!preg_match('/^([a-z0-9_\'&\\.\\-\\+])+\\@(([a-z0-9\\-])+\\.)+([a-z0-9]{2,10})+$/i', $email)) {
return false;
}
if (!$extended) {
return true;
}
$config = acymailing_config();
if ($config->get('email_checkpopmailclient', false)) {
if (preg_match('#^.{1,5}@(gmail|yahoo|aol|hotmail|msn|ymail)#i', $email)) {
return false;
}
}
if ($config->get('email_checkdomain', false) and function_exists('getmxrr')) {
$domain = substr($email, strrpos($email, '@') + 1);
$mxhosts = array();
$checkDomain = getmxrr($domain, $mxhosts);
if (!empty($mxhosts) && strpos($mxhosts[0], 'hostnamedoesnotexist')) {
array_shift($mxhosts);
}
if (!$checkDomain || empty($mxhosts)) {
$dns = @dns_get_record($domain, DNS_A);
if (empty($dns)) {
return false;
}
}
}
return true;
}
示例7: acymailing_replaceusertags
function acymailing_replaceusertags(&$email, &$user, $send = true)
{
if (!empty($email->altbody)) {
$email->altbody = str_replace(array('{statpicture}', '{nostatpicture}'), '', $email->altbody);
}
if (!$email->sendHTML or empty($email->type) or !in_array($email->type, array('news', 'autonews', 'followup', 'welcome', 'unsub', 'joomlanotification')) or strpos($email->body, '{nostatpicture}')) {
$email->body = str_replace(array('{statpicture}', '{nostatpicture}'), '', $email->body);
return;
}
if (empty($user->subid) || !$send) {
$pictureLink = ACYMAILING_LIVE . $this->params->get('picture', 'media/com_acymailing/images/statpicture.png');
} else {
$config = acymailing_config();
$itemId = $config->get('itemid', 0);
$item = empty($itemId) ? '' : '&Itemid=' . $itemId;
$pictureLink = acymailing_frontendLink('index.php?option=com_acymailing&ctrl=stats&mailid=' . $email->mailid . '&subid=' . $user->subid . $item);
}
$widthsize = $this->params->get('width', 50);
$heightsize = $this->params->get('height', 1);
$width = empty($widthsize) ? '' : ' width="' . $widthsize . '" ';
$height = empty($heightsize) ? '' : ' height="' . $heightsize . '" ';
$statPicture = '<img class="spict" alt="' . $this->params->get('alttext', '') . '" src="' . $pictureLink . '" border="0" ' . $height . $width . '/>';
if (strpos($email->body, '{statpicture}')) {
$email->body = str_replace('{statpicture}', $statPicture, $email->body);
} elseif (strpos($email->body, '</body>')) {
$email->body = str_replace('</body>', $statPicture . '</body>', $email->body);
} else {
$email->body .= $statPicture;
}
}
示例8: 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');
}
示例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();
$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);
}
示例11: validEmail
function validEmail($email, $extended = false)
{
if (empty($email) or !is_string($email)) {
return false;
}
if (!preg_match('/^([a-z0-9_\'&\\.\\-\\+=])+\\@(([a-z0-9\\-])+\\.)+([a-z0-9]{2,10})+$/i', $email)) {
return false;
}
if (!$extended) {
return true;
}
$config = acymailing_config();
if ($config->get('email_checkpopmailclient', false)) {
if (preg_match('#^.{1,5}@(gmail|yahoo|aol|hotmail|msn|ymail)#i', $email)) {
return false;
}
}
if ($config->get('email_checkdomain', false) and function_exists('getmxrr')) {
$domain = substr($email, strrpos($email, '@') + 1);
$mxhosts = array();
$checkDomain = getmxrr($domain, $mxhosts);
if (!empty($mxhosts) && strpos($mxhosts[0], 'hostnamedoesnotexist')) {
array_shift($mxhosts);
}
if (!$checkDomain || empty($mxhosts)) {
$dns = @dns_get_record($domain, DNS_A);
if (empty($dns)) {
return false;
}
}
}
$object = new stdClass();
$object->IP = $this->getIP();
$object->emailAddress = $email;
if ($config->get('email_botscout', false)) {
$botscoutClass = new acybotscout();
$botscoutClass->apiKey = $config->get('email_botscout_key');
if (!$botscoutClass->getInfo($object)) {
return false;
}
}
if ($config->get('email_stopforumspam', false)) {
$email_stopforumspam = new acystopforumspam();
if (!$email_stopforumspam->getInfo($object)) {
return false;
}
}
if ($config->get('email_iptimecheck', 0)) {
$lapseTime = time() - 7200;
$db = JFactory::getDBO();
$db->setQuery('SELECT COUNT(*) FROM #__acymailing_subscriber WHERE created > ' . intval($lapseTime) . ' AND ip = ' . $db->Quote($object->IP));
$nbUsers = $db->loadResult();
if ($nbUsers >= 3) {
return false;
}
}
return true;
}
示例12: editorHelper
function editorHelper()
{
$config =& acymailing_config();
$this->editor = $config->get('editor', null);
if (empty($this->editor)) {
$this->editor = null;
}
$this->myEditor =& JFactory::getEditor($this->editor);
$this->myEditor->initialise();
}
示例13: 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));
}
示例14: plgAcymailingTemplate
function plgAcymailingTemplate(&$subject, $config)
{
parent::__construct($subject, $config);
if (!isset($this->params)) {
$plugin = JPluginHelper::getPlugin('acymailing', 'template');
$this->params = new acyParameter($plugin->params);
}
$this->config = acymailing_config();
if (version_compare(PHP_VERSION, '5.0.0', '>=') && class_exists('DOMDocument') && function_exists('mb_convert_encoding')) {
require_once ACYMAILING_FRONT . 'inc' . DS . 'emogrifier' . DS . 'emogrifier.php';
}
}
示例15: fetchButton
function fetchButton($type = 'Pophelp', $namekey = '', $id = 'pophelp')
{
JHTML::_('behavior.mootools');
$doc =& JFactory::getDocument();
$config =& acymailing_config();
$level = $config->get('level');
$url = ACYMAILING_HELPURL . $namekey . '&level=' . $level;
$iFrame = "'<iframe src=\\'{$url}\\' width=\\'100%\\' height=\\'100%\\' scrolling=\\'auto\\'></iframe>'";
$js = "var openHelp = true; function displayDoc(){var box=\$('iframedoc'); if(openHelp){box.innerHTML = " . $iFrame . ";box.style.display = 'block';box.style.height = '0';}";
$js .= "try{\r\r\n\t\t\t\t\tvar fx = box.effects({duration: 1500, transition:\r\r\n\t\t\t\t\tFx.Transitions.Quart.easeOut});\r\r\n\t\t\t\t\tif(openHelp){\r\r\n\t\t\t\t\t\tfx.start({'height': 300});\r\r\n\t\t\t\t\t}else{\r\r\n\t\t\t\t\t\tfx.start({'height': 0}).chain(function() {\r\r\n\t\t\t\t\t\t\tbox.innerHTML='';\r\r\n\t\t\t\t\t\t\tbox.setStyle('display','none');\r\r\n\t\t\t\t\t\t});\r\r\n\t\t\t\t\t}\r\r\n\t\t\t\t}catch(err){\r\r\n\t\t\t\t\tbox.style.height = '300px';\r\r\n\t\t\t\t\tvar myVerticalSlide = new Fx.Slide('iframedoc');\r\r\n \t\t\t\t\tif(openHelp){\r\r\n \t\t\t\t\t\tmyVerticalSlide.hide().slideIn();\r\r\n\t\t\t\t\t}else{\r\r\n\t\t\t\t\t\tmyVerticalSlide.slideOut().chain(function() {\r\r\n\t\t\t\t\t\tbox.innerHTML='';\r\r\n\t\t\t\t\t\tbox.setStyle('display','none');\r\r\n\t\t\t\t\t});\r\r\n\t\t\t\t}\r\r\n\t\t\t} openHelp = !openHelp;}";
$doc->addScriptDeclaration($js);
return '<a href="' . $url . '" target="_blank" onclick="displayDoc();return false;" class="toolbar"><span class="icon-32-help" title="' . JText::_('ACY_HELP', true) . '"></span>' . JText::_('ACY_HELP') . '</a>';
}