本文整理汇总了PHP中acymailing::checkRobots方法的典型用法代码示例。如果您正苦于以下问题:PHP acymailing::checkRobots方法的具体用法?PHP acymailing::checkRobots怎么用?PHP acymailing::checkRobots使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类acymailing
的用法示例。
在下文中一共展示了acymailing::checkRobots方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: doforward
function doforward()
{
acymailing::checkRobots();
$config = acymailing::config();
if (!$config->get('forward', true)) {
return $this->view();
}
$email = trim(JRequest::getString('email'));
$userClass = acymailing::get('helper.user');
if (!$userClass->validEmail($email)) {
echo "<script>alert('" . JText::_('VALID_EMAIL', true) . "'); window.history.go(-1);</script>";
exit;
}
$mailid = JRequest::getInt('mailid');
if (empty($mailid)) {
return $this->view();
}
$receiver = null;
$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;
$mailtosend = $mailerHelper->load($mailid);
$key = JRequest::getString('key');
if (empty($key) or $mailtosend->key !== $key) {
return $this->view();
}
if ($mailerHelper->sendOne($mailid, $receiver)) {
$db =& JFactory::getDBO();
$db->setQuery('UPDATE ' . acymailing::table('stats') . ' SET `forward` = `forward` +1 WHERE `mailid` = ' . (int) $mailid);
$db->query();
}
return $this->view();
}
示例2: savechanges
function savechanges()
{
JRequest::checkToken() or die('Please make sure your cookies are enabled');
acymailing::checkRobots();
$app =& JFactory::getApplication();
$config = acymailing::config();
$subscriberClass = acymailing::get('class.subscriber');
$status = $subscriberClass->saveForm();
if ($status) {
if ($subscriberClass->confirmationSent) {
if ($config->get('subscription_message', 1)) {
$app->enqueueMessage(JText::_('CONFIRMATION_SENT'), 'message');
}
$redirectlink = $config->get('sub_redirect');
} elseif ($subscriberClass->newUser) {
if ($config->get('subscription_message', 1)) {
$app->enqueueMessage(JText::_('SUBSCRIPTION_OK'), 'message');
}
$redirectlink = $config->get('sub_redirect');
} else {
$app->enqueueMessage(JText::_('SUBSCRIPTION_UPDATED_OK'), 'message');
$redirectlink = $config->get('modif_redirect');
}
} elseif ($subscriberClass->requireId) {
$app->enqueueMessage(JText::_('IDENTIFICATION_SENT'), 'notice');
} else {
$app->enqueueMessage(JText::_('ERROR_SAVING'), 'error');
}
if (!empty($redirectlink)) {
$this->setRedirect($redirectlink);
return;
}
if ($subscriberClass->identify(true)) {
return $this->modify();
}
return $this->subscribe();
}
示例3: optout
function optout()
{
acymailing::checkRobots();
$config = acymailing::config();
$app =& JFactory::getApplication();
$userClass = acymailing::get('class.subscriber');
$my =& JFactory::getUser();
$redirectUrl = urldecode(JRequest::getString('redirectunsub'));
if (!empty($redirectUrl)) {
$this->setRedirect($redirectUrl);
}
$formData = JRequest::getVar('user', array(), '', 'array');
$email = trim(strip_tags($formData['email']));
if (empty($email)) {
if (!empty($my->email)) {
$email = $my->email;
}
}
$userHelper = acymailing::get('helper.user');
if (empty($email) || !$userHelper->validEmail($email)) {
echo "<script>alert('" . JText::_('VALID_EMAIL', true) . "'); window.history.go(-1);</script>";
exit;
}
$alreadyExists = $userClass->get($email);
if (empty($alreadyExists->subid)) {
if (empty($redirectUrl)) {
acymailing::display(JText::sprintf('NOT_IN_LIST', $email), 'warning');
} else {
$app->enqueueMessage(JText::sprintf('NOT_IN_LIST', $email), 'notice');
}
return $this->_closepop($redirectUrl);
}
if ($config->get('allow_modif', 'data') == 'none' and empty($my->email) || $my->email != $email) {
$mailClass = acymailing::get('helper.mailer');
$mailClass->checkConfirmField = false;
$mailClass->checkEnabled = false;
$mailClass->report = false;
$mailClass->sendOne('modif', $alreadyExists->subid);
if (empty($redirectUrl)) {
acymailing::display(JText::_('IDENTIFICATION_SENT'), 'warning');
} else {
$app->enqueueMessage(JText::_('IDENTIFICATION_SENT'), 'notice');
}
return $this->_closepop($redirectUrl);
}
$visibleSubscription = JRequest::getVar('subscription', '', '', 'array');
$currentSubscription = $userClass->getSubscriptionStatus($alreadyExists->subid);
$hiddenSubscription = explode(',', JRequest::getVar('hiddenlists', '', '', 'string'));
$updatelists = array();
$removeSubscription = array_merge($visibleSubscription, $hiddenSubscription);
foreach ($removeSubscription as $idList) {
if (!empty($currentSubscription[$idList]) and $currentSubscription[$idList]->status != '-1') {
$updatelists[-1][] = $idList;
}
}
if (!empty($updatelists)) {
$listsubClass = acymailing::get('class.listsub');
$listsubClass->updateSubscription($alreadyExists->subid, $updatelists);
if ($config->get('unsubscription_message', 1)) {
if (empty($redirectUrl)) {
acymailing::display(JText::_('UNSUBSCRIPTION_OK'), 'info');
} else {
$app->enqueueMessage(JText::_('UNSUBSCRIPTION_OK'));
}
}
} elseif ($config->get('unsubscription_message', 1)) {
if (empty($redirectUrl)) {
acymailing::display(JText::_('UNSUBSCRIPTION_NOT_IN_LIST'), 'info');
} else {
$app->enqueueMessage(JText::_('UNSUBSCRIPTION_NOT_IN_LIST'));
}
}
return $this->_closepop($redirectUrl);
}
示例4: optout
function optout()
{
acymailing::checkRobots();
$config = acymailing::config();
$app =& JFactory::getApplication();
$userClass = acymailing::get('class.subscriber');
$my =& JFactory::getUser();
if (empty($my->id)) {
if ($config->get('captcha_enabled')) {
$seckey = JRequest::getString('seckey');
if (!empty($seckey)) {
if ($config->get('security_key') !== $seckey) {
echo JText::_('ERROR_SECURE_KEY', true);
exit;
}
} else {
$captchaClass = acymailing::get('class.acycaptcha');
$captchaClass->state = 'acycaptchamodule' . JRequest::getCmd('acyformname');
if (!$captchaClass->check(JRequest::getString('acycaptcha'))) {
$captchaClass->returnError();
}
}
}
}
$redirectUrl = urldecode(JRequest::getVar('redirectunsub', '', '', 'string'));
$formData = JRequest::getVar('user', array(), '', 'array');
$email = trim(strip_tags($formData['email']));
if (empty($email)) {
if (!empty($my->email)) {
$email = $my->email;
}
}
$alreadyExists = $userClass->get($email);
if (empty($alreadyExists->subid)) {
$this->setRedirect($redirectUrl, JText::sprintf('NOT_IN_LIST', $email), 'notice');
return false;
}
$visibleSubscription = JRequest::getVar('subscription', '', '', 'array');
$currentSubscription = $userClass->getSubscriptionStatus($alreadyExists->subid);
$hiddenSubscription = explode(',', JRequest::getVar('hiddenlists', '', '', 'string'));
$updatelists = array();
$removeSubscription = array_merge($visibleSubscription, $hiddenSubscription);
foreach ($removeSubscription as $idList) {
if (!empty($currentSubscription[$idList]) and $currentSubscription[$idList]->status != '-1') {
$updatelists[-1][] = $idList;
}
}
if (!empty($updatelists)) {
$listsubClass = acymailing::get('class.listsub');
$listsubClass->updateSubscription($alreadyExists->subid, $updatelists);
if ($config->get('unsubscription_message', 1)) {
$app->enqueueMessage(JText::_('UNSUBSCRIPTION_OK'));
}
} elseif ($config->get('unsubscription_message', 1)) {
$app->enqueueMessage(JText::_('UNSUBSCRIPTION_NOT_IN_LIST'));
}
$this->setRedirect($redirectUrl);
return true;
}