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


PHP acymailing_getTime函数代码示例

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


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

示例1: formatString

 function formatString(&$replaceme, $mytag)
 {
     if (!empty($mytag->part)) {
         $parts = explode(' ', $replaceme);
         if ($mytag->part == 'last') {
             $replaceme = count($parts) > 1 ? end($parts) : '';
         } else {
             $replaceme = reset($parts);
         }
     }
     if (!empty($mytag->type)) {
         if (empty($mytag->format)) {
             $mytag->format = JText::_('DATE_FORMAT_LC3');
         }
         if ($mytag->type == 'date') {
             $replaceme = acymailing_getDate(acymailing_getTime($replaceme), $mytag->format);
         } elseif ($mytag->type == 'time') {
             $replaceme = acymailing_getDate($replaceme, $mytag->format);
         }
     }
     if (!empty($mytag->lower)) {
         $replaceme = strtolower($replaceme);
     }
     if (!empty($mytag->upper)) {
         $replaceme = strtoupper($replaceme);
     }
     if (!empty($mytag->ucwords)) {
         $replaceme = ucwords($replaceme);
     }
     if (!empty($mytag->ucfirst)) {
         $replaceme = ucfirst($replaceme);
     }
     if (!empty($mytag->urlencode)) {
         $replaceme = urlencode($replaceme);
     }
     if (!empty($mytag->maxheight) || !empty($mytag->maxwidth)) {
         $pictureHelper = acymailing_get('helper.acypict');
         $pictureHelper->maxHeight = empty($mytag->maxheight) ? 999 : $mytag->maxheight;
         $pictureHelper->maxWidth = empty($mytag->maxwidth) ? 999 : $mytag->maxwidth;
         $replaceme = $pictureHelper->resizePictures($replaceme);
     }
 }
开发者ID:alesconti,项目名称:FF_2015,代码行数:42,代码来源:acyplugins.php

示例2: saveForm

 function saveForm()
 {
     $filter = new stdClass();
     $filter->filid = acymailing_getCID('filid');
     $formData = JRequest::getVar('data', array(), '', 'array');
     foreach ($formData['filter'] as $column => $value) {
         acymailing_secureField($column);
         $filter->{$column} = strip_tags($value);
     }
     $config = acymailing_config();
     $alltriggers = array_keys((array) JRequest::getVar('trigger'));
     $filter->trigger = implode(',', $alltriggers);
     $newConfig = new stdClass();
     foreach ($alltriggers as $oneTrigger) {
         $name = 'triggerfilter_' . $oneTrigger;
         if ($config->get($name)) {
             continue;
         }
         $newConfig->{$name} = 1;
     }
     if (in_array('daycron', $alltriggers)) {
         $oldTime = $config->get('cron_plugins_next', 0);
         $newHours = JRequest::getVar('triggerhours');
         $newMinutes = JRequest::getVar('triggerminutes');
         $newTime = acymailing_getTime(date('Y') . '-' . date('m') . '-' . date('d') . ' ' . $newHours . ':' . $newMinutes);
         if ($newTime < $oldTime || $newTime < time()) {
             $newTime += 86400;
         }
         $newConfig->cron_plugins_next = $newTime;
     }
     if (!empty($newConfig)) {
         $config->save($newConfig);
     }
     $data = array('action', 'filter');
     foreach ($data as $oneData) {
         $filter->{$oneData} = array();
         $formData = JRequest::getVar($oneData);
         foreach ($formData['type'] as $num => $oneType) {
             if (empty($oneType)) {
                 continue;
             }
             $filter->{$oneData}['type'][$num] = $oneType;
             $filter->{$oneData}[$num][$oneType] = $formData[$num][$oneType];
         }
         $filter->{$oneData} = serialize($filter->{$oneData});
     }
     $filid = $this->save($filter);
     if (!$filid) {
         return false;
     }
     JRequest::setVar('filid', $filid);
     return true;
 }
开发者ID:ForAEdesWeb,项目名称:AEW1,代码行数:53,代码来源:filter.php

示例3: save

 function save($mail)
 {
     if (isset($mail->alias) or empty($mail->mailid)) {
         if (empty($mail->alias)) {
             $mail->alias = $mail->subject;
         }
         $mail->alias = JFilterOutput::stringURLSafe(trim($mail->alias));
     }
     if (empty($mail->mailid)) {
         if (empty($mail->created)) {
             $mail->created = time();
         }
         if (empty($mail->userid)) {
             $user = JFactory::getUser();
             $mail->userid = $user->id;
         }
         if (empty($mail->key)) {
             $mail->key = acymailing_generateKey(8);
         }
     } else {
         if (!empty($mail->attach)) {
             $oldMailObject = $this->get($mail->mailid);
             if (!empty($oldMailObject)) {
                 $mail->attach = array_merge($oldMailObject->attach, $mail->attach);
             }
         }
     }
     if (!empty($mail->attach) and !is_string($mail->attach)) {
         $mail->attach = serialize($mail->attach);
     }
     if (isset($mail->filter) and !is_string($mail->filter)) {
         $mail->filter = serialize($mail->filter);
     }
     if (!empty($mail->params)) {
         if (!empty($mail->params['lastgenerateddate']) && !is_numeric($mail->params['lastgenerateddate'])) {
             $mail->params['lastgenerateddate'] = acymailing_getTime($mail->params['lastgenerateddate']);
         }
         $mail->params = serialize($mail->params);
     }
     if (!empty($mail->senddate) && !is_numeric($mail->senddate)) {
         $mail->senddate = acymailing_getTime($mail->senddate);
     }
     JPluginHelper::importPlugin('acymailing');
     $dispatcher = JDispatcher::getInstance();
     if (empty($mail->mailid)) {
         $dispatcher->trigger('onAcyBeforeMailCreate', array(&$mail));
         $status = $this->database->insertObject(acymailing_table('mail'), $mail);
     } else {
         $dispatcher->trigger('onAcyBeforeMailModify', array(&$mail));
         $status = $this->database->updateObject(acymailing_table('mail'), $mail, 'mailid');
     }
     if (!$status) {
         $this->errors[] = substr(strip_tags($this->database->getErrorMsg()), 0, 200) . '...';
     }
     if (!empty($mail->params) and is_string($mail->params)) {
         $mail->params = unserialize($mail->params);
     }
     if (!empty($mail->attach) and is_string($mail->attach)) {
         $mail->attach = unserialize($mail->attach);
     }
     if ($status) {
         return empty($mail->mailid) ? $this->database->insertid() : $mail->mailid;
     }
     return false;
 }
开发者ID:proyectoseb,项目名称:ShoppyStore,代码行数:65,代码来源:mail.php

示例4: onAcyProcessAction_addqueue

 function onAcyProcessAction_addqueue($cquery, $action, $num)
 {
     $action['mailid'] = intval($action['mailid']);
     if (empty($action['mailid'])) {
         return 'mailid not valid';
     }
     $action['senddate'] = acymailing_replaceDate($action['senddate']);
     if (!is_numeric($action['senddate'])) {
         $action['senddate'] = acymailing_getTime($action['senddate']);
     }
     if (empty($action['senddate'])) {
         return 'send date not valid';
     }
     $query = 'INSERT IGNORE INTO `#__acymailing_queue` (`mailid`,`subid`,`senddate`,`priority`) ' . $cquery->getQuery(array($action['mailid'], 'sub.`subid`', $action['senddate'], '2'));
     $db = JFactory::getDBO();
     $db->setQuery($query);
     $db->query();
     return JText::sprintf('ADDED_QUEUE', $db->getAffectedRows());
 }
开发者ID:unrealprojects,项目名称:journal,代码行数:19,代码来源:managetext.php

示例5: display


//.........这里部分代码省略.........
     $desc['autonews'] = '<ul><li>' . JText::_('AUTONEWS_DESC');
     if (!acymailing_level(2)) {
         $desc['autonews'] .= acymailing_getUpgradeLink('business');
     }
     $desc['autonews'] .= '</li></ul>';
     $desc['campaign'] = '<ul><li>' . JText::_('CAMPAIGN_DESC_CREATE');
     if (!acymailing_level(3)) {
         $desc['campaign'] .= acymailing_getUpgradeLink('enterprise');
     }
     $desc['campaign'] .= '</li><li>' . JText::_('CAMPAIGN_DESC_AFFECT');
     if (!acymailing_level(3)) {
         $desc['campaign'] .= acymailing_getUpgradeLink('enterprise');
     }
     $desc['campaign'] .= '</li></ul>';
     $desc['update'] = '<ul><li>' . JText::_('UPDATE_DESC') . '</li><li>' . JText::_('CHANGELOG_DESC') . '</li><li>' . JText::_('ABOUT_DESC') . '</li></ul>';
     $buttons[] = array('link' => 'subscriber', 'level' => 0, 'image' => 'acyusers', 'text' => JText::_('USERS'), 'acl' => 'acl_subscriber_manage');
     $buttons[] = array('link' => 'list', 'level' => 0, 'image' => 'acylist', 'text' => JText::_('LISTS'), 'acl' => 'acl_lists_manage');
     $buttons[] = array('link' => 'newsletter', 'level' => 0, 'image' => 'newsletter', 'text' => JText::_('NEWSLETTERS'), 'acl' => 'acl_newsletters_manage');
     $buttons[] = array('link' => 'autonews', 'level' => 2, 'image' => 'autonewsletter', 'text' => JText::_('AUTONEWSLETTERS'), 'acl' => 'acl_autonewsletters_manage');
     $buttons[] = array('link' => 'campaign', 'level' => 3, 'image' => 'campaign', 'text' => JText::_('CAMPAIGN'), 'acl' => 'acl_campaign_manage');
     $buttons[] = array('link' => 'template', 'level' => 0, 'image' => 'acytemplate', 'text' => JText::_('ACY_TEMPLATES'), 'acl' => 'acl_templates_manage');
     $buttons[] = array('link' => 'queue', 'level' => 0, 'image' => 'process', 'text' => JText::_('QUEUE'), 'acl' => 'acl_queue_manage');
     $buttons[] = array('link' => 'stats', 'level' => 0, 'image' => 'stats', 'text' => JText::_('STATISTICS'), 'acl' => 'acl_statistics_manage');
     if (!ACYMAILING_J16 || JFactory::getUser()->authorise('core.admin', 'com_acymailing')) {
         $buttons[] = array('link' => 'cpanel', 'level' => 0, 'image' => 'acyconfig', 'text' => JText::_('CONFIGURATION'), 'acl' => 'acl_configuration_manage');
     }
     $buttons[] = array('link' => 'update', 'level' => 0, 'image' => 'acyupdate', 'text' => JText::_('UPDATE_ABOUT'), 'acl' => 'acl_configuration_manage');
     $htmlbuttons = array();
     foreach ($buttons as $oneButton) {
         if (acymailing_isAllowed($config->get($oneButton['acl'], 'all'))) {
             $htmlbuttons[] = $this->_quickiconButton($oneButton['link'], $oneButton['image'], $oneButton['text'], $desc[$oneButton['link']], $oneButton['level']);
         }
     }
     $geolocParam = $config->get('geolocation');
     if (!empty($geolocParam) && $geolocParam != 1) {
         $condition = '';
         if (strpos($geolocParam, 'creation') !== false) {
             $condition = " WHERE geolocation_type='creation'";
         }
         $db = JFactory::getDBO();
         $query = 'SELECT geolocation_type, geolocation_subid, geolocation_country_code, geolocation_city';
         $query .= ' FROM #__acymailing_geolocation' . $condition . ' GROUP BY geolocation_subid ORDER BY geolocation_created DESC LIMIT 100';
         $db->setQuery($query);
         $geoloc = $db->loadObjectList();
         if (!empty($geoloc)) {
             $markCities = array();
             $diffCountries = false;
             $dataDetails = array();
             foreach ($geoloc as $mark) {
                 $indexCity = array_search($mark->geolocation_city, $markCities);
                 if ($indexCity === false) {
                     array_push($markCities, $mark->geolocation_city);
                     array_push($dataDetails, 1);
                 } else {
                     $dataDetails[$indexCity] += 1;
                 }
                 if (!$diffCountries) {
                     if (!empty($region) && $region != $mark->geolocation_country_code) {
                         $region = 'world';
                         $diffCountries = true;
                     } else {
                         $region = $mark->geolocation_country_code;
                     }
                 }
             }
             $this->assignRef('geoloc_city', $markCities);
             $this->assignRef('geoloc_details', $dataDetails);
             $this->assignRef('geoloc_region', $region);
         }
     }
     acymailing_setTitle(ACYMAILING_NAME, 'acymailing', 'dashboard');
     $bar = JToolBar::getInstance('toolbar');
     if (ACYMAILING_J16 && JFactory::getUser()->authorise('core.admin', 'com_acymailing')) {
         JToolBarHelper::preferences('com_acymailing');
     }
     $bar->appendButton('Pophelp', 'dashboard');
     $this->assignRef('buttons', $htmlbuttons);
     $toggleClass = acymailing_get('helper.toggle');
     $this->assignRef('toggleClass', $toggleClass);
     $db = JFactory::getDBO();
     $db->setQuery('SELECT name,email,html,confirmed,subid,created FROM ' . acymailing_table('subscriber') . ' ORDER BY subid DESC LIMIT 15');
     $users10 = $db->loadObjectList();
     $this->assignRef('users', $users10);
     $db->setQuery('SELECT a.*, b.subject FROM ' . acymailing_table('stats') . ' as a JOIN ' . acymailing_table('mail') . ' as b on a.mailid = b.mailid ORDER BY a.senddate DESC LIMIT 15');
     $newsletters10 = $db->loadObjectList();
     $this->assignRef('stats', $newsletters10);
     $doc->addScript("https://www.google.com/jsapi");
     $today = acymailing_getTime(date('Y-m-d'));
     $joomConfig = JFactory::getConfig();
     $offset = ACYMAILING_J30 ? $joomConfig->get('offset') : $joomConfig->getValue('config.offset');
     $diff = date('Z') + intval($offset * 60 * 60);
     $db->setQuery("SELECT count(`subid`) as total, DATE_FORMAT(FROM_UNIXTIME(`created` - {$diff}),'%Y-%m-%d') as subday FROM " . acymailing_table('subscriber') . " WHERE `created` > 100000 GROUP BY subday ORDER BY subday DESC LIMIT 15");
     $statsusers = $db->loadObjectList();
     $this->assignRef('statsusers', $statsusers);
     $tabs = acymailing_get('helper.acytabs');
     $tabs->setOptions(array('useCookie' => true));
     $this->assignRef('tabs', $tabs);
     $this->assignRef('config', $config);
     parent::display($tpl);
 }
开发者ID:educakanchay,项目名称:educared,代码行数:101,代码来源:view.html.php

示例6: getTime

 static function getTime($date)
 {
     return acymailing_getTime($date);
 }
开发者ID:ForAEdesWeb,项目名称:AEW1,代码行数:4,代码来源:helper.php

示例7: formatString

 function formatString(&$replaceme, $mytag)
 {
     if (!empty($mytag->part)) {
         $parts = explode(' ', $replaceme);
         if ($mytag->part == 'last') {
             $replaceme = count($parts) > 1 ? end($parts) : '';
         } else {
             $replaceme = reset($parts);
         }
     }
     if (!empty($mytag->type)) {
         if (empty($mytag->format)) {
             $mytag->format = JText::_('DATE_FORMAT_LC3');
         }
         if ($mytag->type == 'date') {
             $replaceme = acymailing_getDate(acymailing_getTime($replaceme), $mytag->format);
         } elseif ($mytag->type == 'time') {
             $replaceme = acymailing_getDate($replaceme, $mytag->format);
         } elseif ($mytag->type == 'diff') {
             try {
                 $date = $replaceme;
                 if (is_numeric($date)) {
                     $date = acymailing_getDate($replaceme, '%Y-%m-%d %H:%M:%S');
                 }
                 $dateObj = new DateTime($date);
                 $nowObj = new DateTime();
                 $diff = $dateObj->diff($nowObj);
                 $replaceme = $diff->format($mytag->format);
             } catch (Exception $e) {
                 $replaceme = 'Error using the "diff" parameter in your tag. Please make sure the DateTime() and diff() functions are available on your server.';
             }
         }
     }
     if (!empty($mytag->lower) || !empty($mytag->lowercase)) {
         $replaceme = function_exists('mb_strtolower') ? mb_strtolower($replaceme, 'UTF-8') : strtolower($replaceme);
     }
     if (!empty($mytag->upper) || !empty($mytag->uppercase)) {
         $replaceme = function_exists('mb_strtoupper') ? mb_strtoupper($replaceme, 'UTF-8') : strtoupper($replaceme);
     }
     if (!empty($mytag->ucwords)) {
         $replaceme = ucwords($replaceme);
     }
     if (!empty($mytag->ucfirst)) {
         $replaceme = ucfirst($replaceme);
     }
     if (isset($mytag->rtrim)) {
         $replaceme = empty($mytag->rtrim) ? rtrim($replaceme) : rtrim($replaceme, $mytag->rtrim);
     }
     if (!empty($mytag->urlencode)) {
         $replaceme = urlencode($replaceme);
     }
     if (!empty($mytag->substr)) {
         $args = explode(',', $mytag->substr);
         if (isset($args[1])) {
             $replaceme = substr($replaceme, intval($args[0]), intval($args[1]));
         } else {
             $replaceme = substr($replaceme, intval($args[0]));
         }
     }
     if (!empty($mytag->maxheight) || !empty($mytag->maxwidth)) {
         $pictureHelper = acymailing_get('helper.acypict');
         $pictureHelper->maxHeight = empty($mytag->maxheight) ? 999 : $mytag->maxheight;
         $pictureHelper->maxWidth = empty($mytag->maxwidth) ? 999 : $mytag->maxwidth;
         $replaceme = $pictureHelper->resizePictures($replaceme);
     }
 }
开发者ID:ForAEdesWeb,项目名称:AEW1,代码行数:66,代码来源:acyplugins.php

示例8: statsusers

<script language="JavaScript" type="text/javascript">
     function statsusers(){
		var dataTable = new google.visualization.DataTable();
		dataTable.addRows(<?php 
echo count($this->statsusers);
?>
);
		dataTable.addColumn('string');
		dataTable.addColumn('number','<?php 
echo JText::_('USERS', true);
?>
');
		<?php 
$i = count($this->statsusers) - 1;
foreach ($this->statsusers as $oneResult) {
    echo "dataTable.setValue({$i}, 0, '" . addslashes(acymailing_getDate(acymailing_getTime($oneResult->subday), JText::_('DATE_FORMAT_LC3'))) . "'); ";
    echo "dataTable.setValue({$i}, 1, " . intval(@$oneResult->total) . "); ";
    if ($i-- == 0) {
        break;
    }
}
?>
        var vis = new google.visualization.ColumnChart(document.getElementById('statsusers'));
        var options = {
        	width:document.documentElement.clientWidth/2,
          height: 300,
          legend:'none'
        };
        vis.draw(dataTable, options);
	}
	google.load("visualization", "1", {packages:["corechart"]});
开发者ID:andreassetiawanhartanto,项目名称:PDKKI,代码行数:31,代码来源:userstats.php

示例9: scheduleone

 function scheduleone()
 {
     if (!$this->isAllowed('newsletters', 'schedule')) {
         return;
     }
     $mailid = JRequest::getInt('mailid');
     $subid = JRequest::getInt('subid');
     $senddate = JRequest::getString('senddate', '');
     $sendhours = JRequest::getString('sendhours', '');
     $sendminutes = JRequest::getString('sendminutes', '');
     $senddateComplete = $senddate . ' ' . $sendhours . ':' . $sendminutes;
     $app = JFactory::getApplication();
     JRequest::checkToken() && !empty($mailid) && !empty($subid) or die('Invalid Token');
     $realSendDate = acymailing_getTime($senddateComplete);
     if ($realSendDate < time()) {
         acymailing_display(JText::_('DATE_FUTURE'), 'warning');
         if ($app->isAdmin()) {
             return $this->addqueue();
         } else {
             $frontSubController = acymailing_get('controller.frontsubscriber');
             return $frontSubController->addqueue();
         }
     }
     $mailClass = acymailing_get('class.mail');
     $myNewsletter = $mailClass->get($mailid);
     $queueEntry = new stdClass();
     $queueEntry->mailid = $myNewsletter->mailid;
     $queueEntry->subid = $subid;
     $queueEntry->senddate = $realSendDate;
     $queueEntry->priority = 1;
     $db = JFactory::getDBO();
     $status = $db->insertObject('#__acymailing_queue', $queueEntry);
     if ($status) {
         acymailing_display(JText::sprintf('AUTOSEND_DATE', '<b><i>' . $myNewsletter->subject . '</i></b>', acymailing_getDate($realSendDate)), 'success');
     } else {
         acymailing_display(array(JText::_('ERROR_SAVING'), $db->getErrorMsg()), 'error');
         if ($app->isAdmin()) {
             return $this->addqueue();
         } else {
             $frontSubController = acymailing_get('controller.frontsubscriber');
             return $frontSubController->addqueue();
         }
     }
 }
开发者ID:utopszkij,项目名称:lmp,代码行数:44,代码来源:send.php

示例10: listing

 function listing()
 {
     $config =& acymailing_config();
     acymailing_setTitle(JText::_('CHARTS'), 'stats', 'diagram');
     $bar = JToolBar::getInstance('toolbar');
     $bar->appendButton('Link', 'cancel', JText::_('GLOBAL_STATISTICS'), acymailing_completeLink('stats'));
     JToolBarHelper::divider();
     JToolBarHelper::custom('export', 'acyexport', '', JText::_('ACY_EXPORT'), false);
     $bar->appendButton('Directprint');
     JToolBarHelper::divider();
     $bar->appendButton('Pophelp', 'charts');
     if (acymailing_isAllowed($config->get('acl_cpanel_manage', 'all'))) {
         $bar->appendButton('Link', 'acymailing', JText::_('ACY_CPANEL'), acymailing_completeLink('dashboard'));
     }
     $db = JFactory::getDBO();
     $app = JFactory::getApplication();
     $where = array();
     $groupby = array();
     $groupingtype = array();
     $groupby[] = 'groupingdate';
     $groupby[] = 'groupingtype';
     $selectfield = 'sub.created';
     $listsneeded = false;
     $listClass = acymailing_get('class.list');
     $allLists = $listClass->getLists('listid');
     $this->assignRef('lists', $allLists);
     $display = JRequest::getVar('display', array());
     $this->assignRef('display', $display);
     foreach ($display as $var => $val) {
         $var = acymailing_securefield($var);
         $this->{$var} = acymailing_securefield($val);
     }
     if (empty($display)) {
         return;
     }
     $compares = JRequest::getVar('compares', array());
     $this->assignRef('compares', $compares);
     if (!empty($compares['lists'])) {
         $groupingtype[] = 'list.name';
         $listsneeded = true;
         $selectfield = 'listsub.subdate';
         $where[] = "list.type = 'list'";
         $filterLists = JRequest::getVar('filterlists', array());
         JArrayHelper::toInteger($filterLists);
         if (!empty($filterLists)) {
             $where[] = "listsub.listid IN (" . implode(',', $filterLists) . ")";
         }
         $this->assignRef('filterlists', $filterLists);
     }
     if ($this->interval == 'day') {
         $groupingdate = "DATE_FORMAT(FROM_UNIXTIME(" . $selectfield . "),'%Y-%m-%d')";
         $this->dateformat = '%d %B %Y';
     } elseif ($this->interval == 'month') {
         $groupingdate = "DATE_FORMAT(FROM_UNIXTIME(" . $selectfield . "),'%Y-%m-01')";
         $this->dateformat = '%B %Y';
     } elseif ($this->interval == 'year') {
         $groupingdate = "DATE_FORMAT(FROM_UNIXTIME(" . $selectfield . "),'%Y-01-01')";
         $this->dateformat = '%Y';
     } else {
         return;
     }
     if (!empty($compares['years'])) {
         $groupingtype[] = "DATE_FORMAT(FROM_UNIXTIME(" . $selectfield . "),'%Y')";
         $this->dateformat = str_replace('%Y', '', $this->dateformat);
         $groupingdate = str_replace('%Y', '2000', $groupingdate);
     }
     $fieldtotal = 'COUNT(sub.subid)';
     $fieldtype = empty($groupingtype) ? "'Total'" : "CONCAT('Total - '," . implode(", ' - ' ,", $groupingtype) . ")";
     if (!empty($this->sumup)) {
         $min = empty($this->datemin) ? 0 : acymailing_getTime($this->datemin);
         $max = empty($this->datemax) ? time() : acymailing_getTime($this->datemax);
         if (empty($min)) {
             $db->setQuery('SELECT min(created) FROM #__acymailing_subscriber WHERE created > 0 LIMIT 1');
             $min = $db->loadResult();
         }
         $this->results = array();
         $maxInter = $min;
         $nbqueries = 0;
         while ($maxInter < $max) {
             $nbqueries++;
             if ($nbqueries > 100) {
                 if ($nbqueries == 101) {
                     acymailing_display('There are too many requests, please reduce the date range or change the interval');
                 }
                 continue;
             }
             $previous = $maxInter;
             if ($this->interval == 'day') {
                 $maxInter = mktime(0, 0, 0, date("n", $maxInter), date("j", $maxInter) + 1, date("Y", $maxInter));
             } elseif ($this->interval == 'month') {
                 $maxInter = mktime(0, 0, 0, date("n", $maxInter) + 1, 1, date("Y", $maxInter));
             } elseif ($this->interval == 'year') {
                 $maxInter = mktime(0, 0, 0, 1, 1, date("Y", $maxInter) + 1);
             }
             $whereCond = array();
             if ($listsneeded) {
                 $whereCond[] = 'listsub.status != 2';
                 $whereCond[] = 'listsub.subdate > 0';
                 $whereCond[] = 'listsub.subdate < ' . $maxInter;
                 $whereCond[] = '(listsub.status = 1 OR listsub.unsubdate >' . $maxInter . ')';
//.........这里部分代码省略.........
开发者ID:utopszkij,项目名称:lmp,代码行数:101,代码来源:view.html.php

示例11: display

 function display($tpl = null)
 {
     $doc =& JFactory::getDocument();
     $config = acymailing_config();
     $buttons = array();
     $desc = array();
     $desc['subscriber'] = '<ul><li>' . JText::_('USERS_DESC_CREATE') . '</li><li>' . JText::_('USERS_DESC_MANAGE') . '</li><li>' . JText::_('USERS_DESC_IMPORT') . '</li></ul>';
     $desc['list'] = '<ul><li>' . JText::_('LISTS_DESC_CREATE') . '</li><li>' . JText::_('LISTS_DESC_SUBSCRIPTION') . '</li></ul>';
     $desc['newsletter'] = '<ul><li>' . JText::_('NEWSLETTERS_DESC_CREATE') . '</li><li>' . JText::_('NEWSLETTERS_DESC_TEST') . '</li><li>' . JText::_('NEWSLETTERS_DESC_SEND') . '</li></ul>';
     $desc['template'] = '<ul><li>' . JText::_('TEMPLATES_DESC_CREATE') . '</li></ul>';
     $desc['queue'] = '<ul><li>' . JText::_('QUEUE_DESC_CONTROL') . '</li></ul>';
     $desc['cpanel'] = '<ul><li>' . JText::_('CONFIG_DESC_CONFIG') . '</li><li>' . JText::_('CONFIG_DESC_MODIFY') . '</li><li>' . JText::_('CONFIG_DESC_PLUGIN') . '</li><li>' . JText::_('QUEUE_DESC_BOUNCE');
     if (!acymailing_level(3)) {
         $desc['cpanel'] .= acymailing_getUpgradeLink('enterprise');
     }
     $desc['cpanel'] .= '</li></ul>';
     $desc['stats'] = '<ul><li>' . JText::_('STATS_DESC_VIEW') . '</li><li>' . JText::_('STATS_DESC_CLICK');
     if (!acymailing_level(1)) {
         $desc['stats'] .= acymailing_getUpgradeLink('essential');
     }
     $desc['stats'] .= '</li><li>' . JText::_('STATS_DESC_CHARTS');
     if (!acymailing_level(1)) {
         $desc['stats'] .= acymailing_getUpgradeLink('essential');
     }
     $desc['stats'] .= '</li></ul>';
     $desc['autonews'] = '<ul><li>' . JText::_('AUTONEWS_DESC');
     if (!acymailing_level(2)) {
         $desc['autonews'] .= acymailing_getUpgradeLink('business');
     }
     $desc['autonews'] .= '</li></ul>';
     $desc['campaign'] = '<ul><li>' . JText::_('CAMPAIGN_DESC_CREATE');
     if (!acymailing_level(3)) {
         $desc['campaign'] .= acymailing_getUpgradeLink('enterprise');
     }
     $desc['campaign'] .= '</li><li>' . JText::_('CAMPAIGN_DESC_AFFECT');
     if (!acymailing_level(3)) {
         $desc['campaign'] .= acymailing_getUpgradeLink('enterprise');
     }
     $desc['campaign'] .= '</li></ul>';
     $desc['update'] = '<ul><li>' . JText::_('UPDATE_DESC') . '</li><li>' . JText::_('CHANGELOG_DESC') . '</li><li>' . JText::_('ABOUT_DESC') . '</li></ul>';
     $buttons[] = array('link' => 'subscriber', 'level' => 0, 'image' => 'acyusers', 'text' => JText::_('USERS'), 'acl' => 'acl_subscriber_manage');
     $buttons[] = array('link' => 'list', 'level' => 0, 'image' => 'acylist', 'text' => JText::_('LISTS'), 'acl' => 'acl_lists_manage');
     $buttons[] = array('link' => 'newsletter', 'level' => 0, 'image' => 'newsletter', 'text' => JText::_('NEWSLETTERS'), 'acl' => 'acl_newsletters_manage');
     $buttons[] = array('link' => 'autonews', 'level' => 2, 'image' => 'autonewsletter', 'text' => JText::_('AUTONEWSLETTERS'), 'acl' => 'acl_autonewsletters_manage');
     $buttons[] = array('link' => 'campaign', 'level' => 3, 'image' => 'campaign', 'text' => JText::_('CAMPAIGN'), 'acl' => 'acl_campaign_manage');
     $buttons[] = array('link' => 'template', 'level' => 0, 'image' => 'acytemplate', 'text' => JText::_('ACY_TEMPLATES'), 'acl' => 'acl_templates_manage');
     $buttons[] = array('link' => 'queue', 'level' => 0, 'image' => 'process', 'text' => JText::_('QUEUE'), 'acl' => 'acl_queue_manage');
     $buttons[] = array('link' => 'stats', 'level' => 0, 'image' => 'stats', 'text' => JText::_('STATISTICS'), 'acl' => 'acl_statistics_manage');
     $buttons[] = array('link' => 'cpanel', 'level' => 0, 'image' => 'acyconfig', 'text' => JText::_('CONFIGURATION'), 'acl' => 'acl_configuration_manage');
     $buttons[] = array('link' => 'update', 'level' => 0, 'image' => 'acyupdate', 'text' => JText::_('UPDATE_ABOUT'), 'acl' => 'acl_configuration_manage');
     $htmlbuttons = array();
     foreach ($buttons as $oneButton) {
         if (acymailing_isAllowed($config->get($oneButton['acl'], 'all'))) {
             $htmlbuttons[] = $this->_quickiconButton($oneButton['link'], $oneButton['image'], $oneButton['text'], $desc[$oneButton['link']], $oneButton['level']);
         }
     }
     acymailing_setTitle(ACYMAILING_NAME, 'acymailing', 'dashboard');
     $bar =& JToolBar::getInstance('toolbar');
     $bar->appendButton('Pophelp', 'dashboard');
     $this->assignRef('buttons', $htmlbuttons);
     $toggleClass = acymailing_get('helper.toggle');
     $this->assignRef('toggleClass', $toggleClass);
     $db = JFactory::getDBO();
     $db->setQuery('SELECT name,email,html,confirmed,subid,created FROM ' . acymailing_table('subscriber') . ' ORDER BY created DESC LIMIT 15');
     $users10 = $db->loadObjectList();
     $this->assignRef('users', $users10);
     $db->setQuery('SELECT a.*, b.subject FROM ' . acymailing_table('stats') . ' as a LEFT JOIN ' . acymailing_table('mail') . ' as b on a.mailid = b.mailid ORDER BY a.senddate DESC LIMIT 15');
     $newsletters10 = $db->loadObjectList();
     $this->assignRef('stats', $newsletters10);
     $doc->addScript(((empty($_SERVER['HTTPS']) or strtolower($_SERVER['HTTPS']) != "on") ? 'http://' : 'https://') . "www.google.com/jsapi");
     $today = acymailing_getTime(date('Y-m-d'));
     $joomConfig =& JFactory::getConfig();
     $diff = date('Z') + intval($joomConfig->getValue('config.offset') * 60 * 60);
     $db->setQuery("SELECT count(`subid`) as total, DATE_FORMAT(FROM_UNIXTIME(`created` - {$diff}),'%Y-%m-%d') as subday FROM " . acymailing_table('subscriber') . " GROUP BY subday ORDER BY subday DESC LIMIT 15");
     $statsusers = $db->loadObjectList();
     $this->assignRef('statsusers', $statsusers);
     jimport('joomla.html.pane');
     $tabs =& JPane::getInstance('tabs');
     $this->assignRef('tabs', $tabs);
     $this->assignRef('config', $config);
     parent::display($tpl);
 }
开发者ID:andreassetiawanhartanto,项目名称:PDKKI,代码行数:82,代码来源:view.html.php

示例12: replaceSubTag

 function replaceSubTag(&$allresults, $i, &$user)
 {
     $arguments = explode('|', strip_tags($allresults[1][$i]));
     $field = $arguments[0];
     unset($arguments[0]);
     $mytag = null;
     $mytag->default = '';
     if (!empty($arguments)) {
         foreach ($arguments as $onearg) {
             $args = explode(':', $onearg);
             if (isset($args[1])) {
                 $mytag->{$args}[0] = $args[1];
             } else {
                 $mytag->{$args}[0] = 1;
             }
         }
     }
     $replaceme = isset($user->{$field}) && strlen($user->{$field}) > 0 ? $user->{$field} : $mytag->default;
     if (!empty($mytag->part)) {
         $parts = explode(' ', $replaceme);
         if ($mytag->part == 'last') {
             $replaceme = count($parts) > 1 ? end($parts) : '';
         } else {
             $replaceme = reset($parts);
         }
     }
     if (!empty($mytag->type)) {
         if (empty($mytag->format)) {
             $mytag->format = JText::_('DATE_FORMAT_LC3');
         }
         if ($mytag->type == 'date') {
             $replaceme = acymailing_getDate(acymailing_getTime($replaceme), $mytag->format);
         } elseif ($mytag->type == 'time') {
             $replaceme = acymailing_getDate($replaceme, $mytag->format);
         }
     }
     $replaceme = nl2br($replaceme);
     if (!empty($mytag->lower)) {
         $replaceme = strtolower($replaceme);
     }
     if (!empty($mytag->ucwords)) {
         $replaceme = ucwords($replaceme);
     }
     if (!empty($mytag->ucfirst)) {
         $replaceme = ucfirst($replaceme);
     }
     if (!empty($mytag->urlencode)) {
         $replaceme = urlencode($replaceme);
     }
     return $replaceme;
 }
开发者ID:andreassetiawanhartanto,项目名称:PDKKI,代码行数:51,代码来源:tagsubscriber.php

示例13: acymailing_replaceusertags

 function acymailing_replaceusertags(&$email, &$user, $send = true)
 {
     $match = '#(?:{|%7B)cbtag:(.*)(?:}|%7D)#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;
     }
     $values = null;
     if (!empty($user->userid)) {
         $db = JFactory::getDBO();
         $db->setQuery('SELECT * FROM ' . acymailing_table('comprofiler', false) . ' WHERE user_id = ' . $user->userid . ' LIMIT 1');
         $values = $db->loadObject();
     }
     include_once ACYMAILING_ROOT . 'administrator' . DS . 'components' . DS . 'com_comprofiler' . DS . 'plugin.foundation.php';
     cbimport('cb.database');
     $currentCBUser = null;
     $tags = array();
     foreach ($results as $var => $allresults) {
         foreach ($allresults[0] as $i => $oneTag) {
             if (isset($tags[$oneTag])) {
                 continue;
             }
             $arguments = explode('|', $allresults[1][$i]);
             $field = $arguments[0];
             unset($arguments[0]);
             $mytag = null;
             $mytag->default = $this->params->get('default_' . $field, '');
             if (!empty($arguments)) {
                 foreach ($arguments as $onearg) {
                     $args = explode(':', $onearg);
                     if (isset($args[1])) {
                         $mytag->{$args}[0] = $args[1];
                     } else {
                         $mytag->{$args}[0] = 1;
                     }
                 }
             }
             if (substr($field, 0, 6) == 'cbapi_' and !empty($user->userid)) {
                 if (empty($currentCBUser)) {
                     $currentCBUser =& CBuser::getInstance($user->userid);
                 }
                 if (!empty($currentCBUser)) {
                     $values->{$field} = $currentCBUser->getField(substr($field, 6), $mytag->default, 'html', 'none', 'profile', 0, true);
                 }
             }
             $replaceme = isset($values->{$field}) ? $values->{$field} : $mytag->default;
             if (!empty($mytag->type)) {
                 if ($mytag->type == 'date') {
                     if (empty($mytag->format)) {
                         $mytag->format = JText::_('DATE_FORMAT_LC3');
                     }
                     $replaceme = acymailing_getDate(acymailing_getTime($replaceme), $mytag->format);
                 }
                 if ($mytag->type == 'image' and !empty($replaceme)) {
                     $replaceme = '<img src="' . ACYMAILING_LIVE . 'images/comprofiler/' . $replaceme . '"/>';
                 }
             }
             if ($field == 'thumb') {
                 $replaceme = '<img src="' . ACYMAILING_LIVE . 'images/comprofiler/tn' . $values->avatar . '"/>';
             } elseif ($field == 'avatar') {
                 $replaceme = '<img src="' . ACYMAILING_LIVE . 'images/comprofiler/' . $values->avatar . '"/>';
             }
             if (!empty($mytag->lower)) {
                 $replaceme = strtolower($replaceme);
             }
             if (!empty($mytag->ucwords)) {
                 $replaceme = ucwords($replaceme);
             }
             if (!empty($mytag->ucfirst)) {
                 $replaceme = ucfirst($replaceme);
             }
             if (!empty($mytag->urlencode)) {
                 $replaceme = urlencode($replaceme);
             }
             if (!empty($mytag->maxheight) || !empty($mytag->maxwidth)) {
                 $pictureHelper = acymailing_get('helper.acypict');
                 $pictureHelper->maxHeight = empty($mytag->maxheight) ? 999 : $mytag->maxheight;
                 $pictureHelper->maxWidth = empty($mytag->maxwidth) ? 999 : $mytag->maxwidth;
                 $replaceme = $pictureHelper->resizePictures($replaceme);
             }
             $tags[$oneTag] = $replaceme;
         }
     }
     foreach ($results as $var => $allresults) {
         $email->{$var} = str_replace(array_keys($tags), $tags, $email->{$var});
     }
 }
开发者ID:andreassetiawanhartanto,项目名称:PDKKI,代码行数:97,代码来源:tagcbuser.php

示例14: save

 function save($mail)
 {
     if (isset($mail->alias) or empty($mail->mailid)) {
         if (empty($mail->alias)) {
             $mail->alias = $mail->subject;
         }
         $mail->alias = JFilterOutput::stringURLSafe(trim($mail->alias));
     }
     if (empty($mail->mailid)) {
         if (empty($mail->created)) {
             $mail->created = time();
         }
         if (empty($mail->userid)) {
             $user =& JFactory::getUser();
             $mail->userid = $user->id;
         }
         if (empty($mail->key)) {
             $mail->key = md5($mail->alias . time());
         }
     } else {
         if (!empty($mail->attach)) {
             $oldMailObject = $this->get($mail->mailid);
             if (!empty($oldMailObject)) {
                 $mail->attach = array_merge($oldMailObject->attach, $mail->attach);
             }
         }
     }
     if (!empty($mail->attach) and !is_string($mail->attach)) {
         $mail->attach = serialize($mail->attach);
     }
     if (isset($mail->filter) and !is_string($mail->filter)) {
         $mail->filter = serialize($mail->filter);
     }
     if (!empty($mail->params)) {
         if (!empty($mail->params['lastgenerateddate']) && !is_numeric($mail->params['lastgenerateddate'])) {
             $mail->params['lastgenerateddate'] = acymailing_getTime($mail->params['lastgenerateddate']);
         }
         $mail->params = serialize($mail->params);
     }
     if (!empty($mail->senddate) && !is_numeric($mail->senddate)) {
         $mail->senddate = acymailing_getTime($mail->senddate);
     }
     if (empty($mail->mailid)) {
         $status = $this->database->insertObject(acymailing_table('mail'), $mail);
     } else {
         $status = $this->database->updateObject(acymailing_table('mail'), $mail, 'mailid');
     }
     if (!empty($mail->params) and is_string($mail->params)) {
         $mail->params = unserialize($mail->params);
     }
     if (!empty($mail->attach) and is_string($mail->attach)) {
         $mail->attach = unserialize($mail->attach);
     }
     if ($status) {
         return empty($mail->mailid) ? $this->database->insertid() : $mail->mailid;
     }
     return false;
 }
开发者ID:andreassetiawanhartanto,项目名称:PDKKI,代码行数:58,代码来源:mail.php

示例15: acymailing_replaceusertags

 function acymailing_replaceusertags(&$email, &$user, $send = true)
 {
     $match = '#(?:{|%7B)usertag:(.*)(?:}|%7D)#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;
     }
     $db = JFactory::getDBO();
     $receivervalues = null;
     $tags = array();
     foreach ($results as $var => $allresults) {
         foreach ($allresults[0] as $i => $oneTag) {
             if (isset($tags[$oneTag])) {
                 continue;
             }
             $arguments = explode('|', $allresults[1][$i]);
             $field = $arguments[0];
             unset($arguments[0]);
             $mytag = null;
             $mytag->default = $this->params->get('default_' . $field, '');
             if (!empty($arguments)) {
                 foreach ($arguments as $onearg) {
                     $args = explode(':', $onearg);
                     if (isset($args[1])) {
                         $mytag->{$args}[0] = $args[1];
                     } else {
                         $mytag->{$args}[0] = 1;
                     }
                 }
             }
             $values = null;
             if (!empty($mytag->info) and $mytag->info == 'sender') {
                 if (empty($this->sendervalues[$email->mailid]) and !empty($email->userid)) {
                     $db->setQuery('SELECT * FROM ' . acymailing_table('users', false) . ' WHERE id = ' . $email->userid . ' LIMIT 1');
                     $this->sendervalues[$email->mailid] = $db->loadObject();
                 }
                 if (!empty($this->sendervalues[$email->mailid])) {
                     $values = $this->sendervalues[$email->mailid];
                 }
             } else {
                 if (empty($receivervalues) and !empty($user->userid)) {
                     $db->setQuery('SELECT * FROM ' . acymailing_table('users', false) . ' WHERE id = ' . $user->userid . ' LIMIT 1');
                     $receivervalues = $db->loadObject();
                 }
                 if (!empty($receivervalues)) {
                     $values = $receivervalues;
                 }
             }
             $replaceme = isset($values->{$field}) ? $values->{$field} : $mytag->default;
             if (!empty($mytag->type)) {
                 if ($mytag->type == 'date') {
                     if (empty($mytag->format)) {
                         $mytag->format = JText::_('DATE_FORMAT_LC3');
                     }
                     $replaceme = acymailing_getDate(acymailing_getTime($replaceme), $mytag->format);
                 }
             }
             if (!empty($mytag->part)) {
                 $parts = explode(' ', $replaceme);
                 if ($mytag->part == 'last') {
                     $replaceme = count($parts) > 1 ? end($parts) : '';
                 } else {
                     $replaceme = reset($parts);
                 }
             }
             if (!empty($mytag->lower)) {
                 $replaceme = strtolower($replaceme);
             }
             if (!empty($mytag->ucwords)) {
                 $replaceme = ucwords($replaceme);
             }
             if (!empty($mytag->ucfirst)) {
                 $replaceme = ucfirst($replaceme);
             }
             if (!empty($mytag->urlencode)) {
                 $replaceme = urlencode($replaceme);
             }
             $tags[$oneTag] = $replaceme;
         }
     }
     foreach ($results as $var => $allresults) {
         $email->{$var} = str_replace(array_keys($tags), $tags, $email->{$var});
     }
 }
开发者ID:andreassetiawanhartanto,项目名称:PDKKI,代码行数:94,代码来源:taguser.php


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