本文整理汇总了PHP中acymailing_table函数的典型用法代码示例。如果您正苦于以下问题:PHP acymailing_table函数的具体用法?PHP acymailing_table怎么用?PHP acymailing_table使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了acymailing_table函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: save
function save($configObject)
{
$query = 'REPLACE INTO ' . acymailing_table('config') . ' (namekey,value) VALUES ';
$params = array();
$i = 0;
foreach ($configObject as $namekey => $value) {
$i++;
if ($i > 100) {
$query .= implode(',', $params);
$this->database->setQuery($query);
if (!$this->database->query()) {
return false;
}
$i = 0;
$query = 'REPLACE INTO ' . acymailing_table('config') . ' (namekey,value) VALUES ';
$params = array();
}
if (empty($this->values[$namekey])) {
$this->values[$namekey] = new stdClass();
}
$this->values[$namekey]->value = $value;
$params[] = '(' . $this->database->Quote(strip_tags($namekey)) . ',' . $this->database->Quote(strip_tags($value)) . ')';
}
if (empty($params)) {
return true;
}
$query .= implode(',', $params);
$this->database->setQuery($query);
return $this->database->query();
}
示例2: get
function get($urlid, $default = null)
{
$column = is_numeric($urlid) ? 'urlid' : 'url';
$query = 'SELECT * FROM ' . acymailing_table('url') . ' WHERE ' . $column . ' = ' . $this->database->Quote($urlid) . ' LIMIT 1';
$this->database->setQuery($query);
return $this->database->loadObject();
}
示例3: 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;
}
示例4: acymailingtagsubscriber_show
function acymailingtagsubscriber_show()
{
$descriptions['subid'] = JText::_('SUBSCRIBER_ID');
$descriptions['email'] = JText::_('SUBSCRIBER_EMAIL');
$descriptions['name'] = JText::_('SUBSCRIBER_NAME');
$descriptions['userid'] = JText::_('SUBSCRIBER_USERID');
$descriptions['ip'] = JText::_('SUBSCRIBER_IP');
$descriptions['created'] = JText::_('SUBSCRIBER_CREATED');
$text = '<table class="adminlist" cellpadding="1">';
$db =& JFactory::getDBO();
$tableInfos = $db->getTableFields(acymailing_table('subscriber'));
$others = array();
$others['{subtag:name|part:first|ucfirst}'] = array('name' => JText::_('SUBSCRIBER_FIRSTPART'), 'desc' => JText::_('SUBSCRIBER_FIRSTPART') . ' ' . JText::_('SUBSCRIBER_FIRSTPART_DESC'));
$others['{subtag:name|part:last|ucfirst}'] = array('name' => JText::_('SUBSCRIBER_LASTPART'), 'desc' => JText::_('SUBSCRIBER_LASTPART') . ' ' . JText::_('SUBSCRIBER_LASTPART_DESC'));
$k = 0;
$fields = reset($tableInfos);
foreach ($fields as $fieldname => $oneField) {
if (!isset($descriptions[$fieldname]) and $oneField == 'tinyint') {
continue;
}
$type = '';
if ($fieldname == 'created') {
$type = '|type:time';
}
$text .= '<tr style="cursor:pointer" class="row' . $k . '" onclick="setTag(\'{subtag:' . $fieldname . $type . '}\');insertTag();" ><td class="acytdcheckbox"></td><td>' . $fieldname . '</td><td>' . @$descriptions[$fieldname] . '</td></tr>';
$k = 1 - $k;
}
foreach ($others as $tagname => $tag) {
$text .= '<tr style="cursor:pointer" class="row' . $k . '" onclick="setTag(\'' . $tagname . '\');insertTag();" ><td class="acytdcheckbox"></td><td>' . $tag['name'] . '</td><td>' . $tag['desc'] . '</td></tr>';
$k = 1 - $k;
}
$text .= '</table>';
echo $text;
}
示例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: get
function get($ruleid, $default = null)
{
$query = 'SELECT * FROM ' . acymailing_table('rules') . ' WHERE `ruleid` = ' . intval($ruleid) . ' LIMIT 1';
$this->database->setQuery($query);
$rule = $this->database->loadObject();
return $this->_prepareRule($rule);
}
示例7: addClick
function addClick($urlid,$mailid,$subid){
$mailid = intval($mailid);
$urlid = intval($urlid);
$subid = intval($subid);
if(empty($mailid) OR empty($urlid) OR empty($subid)) return true;
$statsClass = acymailing_get('class.stats');
$statsClass->countReturn = false;
$statsClass->mailid = $mailid;
$statsClass->subid = $subid;
if(!$statsClass->saveStats()) return true;
$date = time();
$ipClass = acymailing_get('helper.user');
$ip = $ipClass->getIP();
$query = 'INSERT IGNORE INTO '.acymailing_table('urlclick').' (urlid,mailid,subid,date,click,ip) VALUES ('.$urlid.','.$mailid.','.$subid.','.$date.',1,'.$this->database->Quote($ip).')';
$this->database->setQuery($query);
if(!$this->database->query()){
acymailing_display($this->database->getErrorMsg(),'error');
exit;
}
if(!$this->database->getAffectedRows()){
$query = 'UPDATE '.acymailing_table('urlclick').' SET click = click +1,`date` = '.$date.' WHERE mailid = '.$mailid.' AND urlid = '.$urlid.' AND subid = '.$subid.' LIMIT 1';
$this->database->setQuery($query);
$this->database->query();
}
$query = 'SELECT SUM(click) FROM '.acymailing_table('urlclick').' WHERE mailid = '.$mailid.' AND subid = '.$subid;
$this->database->setQuery($query);
$totalUserClick = $this->database->loadResult();
$query = 'UPDATE '.acymailing_table('stats').' SET clicktotal = clicktotal + 1 ';
if($totalUserClick <= 1){
$query .= ' , clickunique = clickunique + 1';
}
$query .= ' WHERE mailid = '.$mailid.' LIMIT 1';
$this->database->setQuery($query);
$this->database->query();
$this->database->setQuery('UPDATE #__acymailing_subscriber SET lastclick_date = '.time().' WHERE subid = '.$subid);
$this->database->query();
$filterClass = acymailing_get('class.filter');
$filterClass->subid = $subid;
$filterClass->trigger('clickurl');
$classGeoloc = acymailing_get('class.geolocation');
$classGeoloc->saveGeolocation('clic', $subid);
JPluginHelper::importPlugin('acymailing');
$dispatcher = JDispatcher::getInstance();
$dispatcher->trigger('onAcyClickLink',array($subid,$mailid,$urlid));
return true;
}
示例8: 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));
}
示例9: detailstatsbounceType
function detailstatsbounceType()
{
$query = 'SELECT DISTINCT bouncerule FROM ' . acymailing_table('userstats') . ' WHERE bouncerule IS NOT NULL';
$db = JFactory::getDBO();
$db->setQuery($query);
$bouncerules = $db->loadObjectList();
$this->values = array();
$this->values[] = JHTML::_('select.option', 0, JText::_('ALL_RULES'));
foreach ($bouncerules as $oneRule) {
$this->values[] = JHTML::_('select.option', $oneRule->bouncerule, $oneRule->bouncerule);
}
}
示例10: queuemailType
function queuemailType()
{
$query = 'SELECT count(distinct a.subid) as totalsub, b.subject, a.mailid FROM ' . acymailing_table('queue') . ' as a';
$query .= ' LEFT JOIN ' . acymailing_table('mail') . ' as b on a.mailid = b.mailid GROUP BY a.mailid ORDER BY b.subject ASC';
$db =& JFactory::getDBO();
$db->setQuery($query);
$emails = $db->loadObjectList();
$this->values = array();
$this->values[] = JHTML::_('select.option', '0', JText::_('ALL_EMAILS'));
foreach ($emails as $oneMail) {
$this->values[] = JHTML::_('select.option', $oneMail->mailid, $oneMail->subject . ' ( ' . $oneMail->totalsub . ' )');
}
}
示例11: detailstatsmailType
function detailstatsmailType()
{
$query = 'SELECT b.subject, a.mailid FROM ' . acymailing_table('stats') . ' as a';
$query .= ' JOIN ' . acymailing_table('mail') . ' as b on a.mailid = b.mailid ORDER BY a.senddate DESC LIMIT 200';
$db = JFactory::getDBO();
$db->setQuery($query);
$emails = $db->loadObjectList();
$this->values = array();
$this->values[] = JHTML::_('select.option', '0', JText::_('ALL_EMAILS'));
foreach ($emails as $oneMail) {
$this->values[] = JHTML::_('select.option', $oneMail->mailid, $oneMail->subject);
}
}
示例12: welcomeType
function welcomeType()
{
$query = 'SELECT `subject`, `mailid` FROM ' . acymailing_table('mail') . ' WHERE `type`= \'welcome\'';
$db = JFactory::getDBO();
$db->setQuery($query);
$messages = $db->loadObjectList();
$this->values = array();
$this->values[] = JHTML::_('select.option', '0', JText::_('NO_WELCOME_MESSAGE'));
$this->values[] = JHTML::_('select.option', '-1', JText::_('LATEST_NEWSLETTER'));
foreach ($messages as $oneMessage) {
$this->values[] = JHTML::_('select.option', $oneMessage->mailid, '[' . JText::_('ACY_ID') . ' ' . $oneMessage->mailid . '] ' . $oneMessage->subject);
}
}
示例13: urlmailType
function urlmailType(){
$query = 'SELECT b.subject,b.mailid,count(distinct a.urlid) as totalmail FROM '.acymailing_table('urlclick').' as a';
$query .= ' JOIN '.acymailing_table('mail').' as b ON a.mailid = b.mailid';
$query .= ' GROUP BY a.mailid ORDER BY a.mailid DESC';
$db = JFactory::getDBO();
$db->setQuery($query);
$mails = $db->loadObjectList();
$this->values = array();
$this->values[] = JHTML::_('select.option', '0', JText::_('ALL_EMAILS') );
foreach($mails as $oneMail){
$this->values[] = JHTML::_('select.option', $oneMail->mailid, $oneMail->subject.' ( '.$oneMail->totalmail.' )' );
}
}
示例14: listcreatorType
function listcreatorType()
{
$query = 'SELECT b.name,a.userid,count(distinct a.listid) as total FROM ' . acymailing_table('list') . ' as a ';
$query .= ' LEFT JOIN ' . acymailing_table('users', false) . ' as b on a.userid = b.id WHERE a.type = \'list\' GROUP BY a.userid ORDER BY b.name ASC';
$db =& JFactory::getDBO();
$db->setQuery($query);
$creators = $db->loadObjectList();
$this->values = array();
$this->values[] = JHTML::_('select.option', '0', JText::_('ALL_CREATORS'));
foreach ($creators as $oneCreator) {
if (!empty($oneCreator->userid)) {
$this->values[] = JHTML::_('select.option', $oneCreator->userid, $oneCreator->name . ' ( ' . $oneCreator->total . ' )');
}
}
}
示例15: unsubType
function unsubType()
{
$query = 'SELECT `subject`, `mailid` FROM ' . acymailing_table('mail') . ' WHERE `type`= \'unsub\'';
$db = JFactory::getDBO();
$db->setQuery($query);
$messages = $db->loadObjectList();
$this->values = array();
$this->values[] = JHTML::_('select.option', '0', JText::_('NO_UNSUB_MESSAGE'));
foreach ($messages as $oneMessage) {
$this->values[] = JHTML::_('select.option', $oneMessage->mailid, '[' . JText::_('ACY_ID') . ' ' . $oneMessage->mailid . '] ' . $oneMessage->subject);
}
$js = "function changeMessage(idField,value){\r\n\t\t\tlinkEdit = idField+'_edit';\r\n\t\t\tif(value>0){\r\n\t\t\t\twindow.document.getElementById(linkEdit).href = 'index.php?option=com_acymailing&tmpl=component&ctrl=email&task=edit&mailid='+value;\r\n\t\t\t\twindow.document.getElementById(linkEdit).style.display = 'inline';\r\n\t\t\t}else{\r\n\t\t\t\twindow.document.getElementById(linkEdit).style.display = 'none';\r\n\t\t\t}\r\n\t\t}";
$doc = JFactory::getDocument();
$doc->addScriptDeclaration($js);
}