本文整理汇总了PHP中acymailing_setPageTitle函数的典型用法代码示例。如果您正苦于以下问题:PHP acymailing_setPageTitle函数的具体用法?PHP acymailing_setPageTitle怎么用?PHP acymailing_setPageTitle使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了acymailing_setPageTitle函数的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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);
}
示例2: view
function view()
{
$mailid = acymailing_getCID('mailid');
if (empty($mailid)) {
$db =& JFactory::getDBO();
$query = 'SELECT m.`mailid` FROM `#__acymailing_list` as l LEFT JOIN `#__acymailing_listmail` as lm ON l.listid=lm.listid LEFT JOIN `#__acymailing_mail` as m on lm.mailid = m.mailid';
$query .= ' WHERE l.`visible` = 1 AND l.`published` = 1 AND m.`visible`= 1 AND m.`published` = 1';
if (!empty($listid)) {
$query .= ' AND l.`listid` = ' . (int) $listid;
}
$query .= ' ORDER BY m.`mailid` DESC LIMIT 1';
$db->setQuery($query);
$mailid = $db->loadResult();
if (empty($mailid)) {
return JError::raiseError(404, 'Newsletter not found');
}
}
$access_sub = true;
$mailClass = acymailing_get('helper.mailer');
$mailClass->loadedToSend = false;
$oneMail = $mailClass->load($mailid);
if (empty($oneMail->mailid)) {
return JError::raiseError(404, 'Newsletter not found : ' . $mailid);
}
if (!$access_sub or !$oneMail->published or !$oneMail->visible) {
$key = JRequest::getString('key');
if (empty($key) or $key !== $oneMail->key) {
$app = JFactory::getApplication();
$app->enqueueMessage('You can not have access to this e-mail', 'error');
$app->redirect(acymailing_completeLink('lists', false, true));
return false;
}
}
$user = JFactory::getUser();
if (!empty($user->email)) {
$userClass = acymailing_get('class.subscriber');
$receiver = $userClass->get($user->email);
} else {
$receiver = new stdClass();
$receiver->name = JText::_('VISITOR');
}
$oneMail->sendHTML = true;
$mailClass->dispatcher->trigger('acymailing_replaceusertags', array(&$oneMail, &$receiver, false));
acymailing_setPageTitle($oneMail->subject);
if (!empty($oneMail->text)) {
echo nl2br($mailClass->textVersion($oneMail->text, false));
} else {
echo nl2br($mailClass->textVersion($oneMail->body, true));
}
}
示例3: view
function view(){
global $Itemid;
$app = JFactory::getApplication();
$document = JFactory::getDocument();
$this->addFeed();
$pathway = $app->getPathway();
$my = JFactory::getUser();
$frontEndManagement = false;
$listid = acymailing_getCID('listid');
$values = new stdClass();
$values->suffix = '';
$jsite = JFactory::getApplication('site');
$menus = $jsite->getMenu();
$menu = $menus->getActive();
if(empty($menu) AND !empty($Itemid)){
$menus->setActive($Itemid);
$menu = $menus->getItem($Itemid);
}
if (is_object( $menu )) {
jimport('joomla.html.parameter');
$menuparams = new acyParameter( $menu->params );
}
if(!empty($menuparams)){
$values->suffix = $menuparams->get('pageclass_sfx','');
}
if(empty($listid) && !empty($menuparams)){
$listid = $menuparams->get('listid');
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'));
}
$config = acymailing_config();
$indexFollow = $config->get('indexFollow', '');
$tagIndFol = array();
if(strpos($indexFollow, 'noindex') !== false) $tagIndFol[] = 'noindex';
if(strpos($indexFollow, 'nofollow') !== false) $tagIndFol[] = 'nofollow';
if(!empty($tagIndFol)) $document->setMetadata('robots',implode(',',$tagIndFol));
if(!empty($listid)){
$listClass = acymailing_get('class.list');
$oneList = $listClass->get($listid);
if(!empty($oneList->visible) AND $oneList->published AND (empty($menuparams) || !$menuparams->get('listid'))){
$pathway->addItem($oneList->name,acymailing_completeLink('archive&listid='.$oneList->listid.':'.$oneList->alias));
}
if(!empty($oneList->listid) AND acymailing_level(3)){
if(!empty($my->id) AND (int)$my->id == (int)$oneList->userid){
$frontEndManagement = true;
}
if(!empty($my->id)){
if($oneList->access_manage == 'all' OR acymailing_isAllowed($oneList->access_manage)){
$frontEndManagement = true;
}
}
}
}
$mailid = JRequest::getString('mailid','nomailid');
if(empty($mailid)){
die('This is a Newsletter-template... and you can not access the online version of a Newsletter-template!<br />Please <a href="administrator/index.php?option=com_acymailing&ctrl=newsletter&task=edit" >create a Newsletter</a> using your template and then try again your "view it online" link!');
exit;
}
if($mailid == 'nomailid'){
$db = JFactory::getDBO();
$query = 'SELECT m.`mailid` FROM `#__acymailing_list` as l JOIN `#__acymailing_listmail` as lm ON l.listid=lm.listid JOIN `#__acymailing_mail` as m on lm.mailid = m.mailid';
$query .= ' WHERE l.`visible` = 1 AND l.`published` = 1 AND m.`visible`= 1 AND m.`published` = 1 AND m.`type` = "news" AND l.`type` = "list"';
if(!empty($listid)) $query .= ' AND l.`listid` = '.(int) $listid;
$query .= ' ORDER BY m.`senddate` DESC, m.`mailid` DESC LIMIT 1';
$db->setQuery($query);
$mailid = $db->loadResult();
}
$mailid = intval($mailid);
if(empty($mailid)) return JError::raiseError( 404, 'Newsletter not found');
$access_sub = true;
if(acymailing_level(3)){
$listmail = acymailing_get('class.listmail');
$allLists = $listmail->getLists($mailid);
$access_sub = false;
if(!empty($allLists)){
foreach($allLists as $alist){
if(empty($alist->mailid)) continue;
if(!$alist->published OR !$alist->visible OR $alist->access_sub == 'none') continue;
if(acymailing_isAllowed($alist->access_sub)){
//.........这里部分代码省略.........
示例4: form
//.........这里部分代码省略.........
}
$js .= "while(!document.getElementById('" . $datatype . "type{$num}')){" . $jsFunction . "();}\r\n\t\t\t\t\t\tdocument.getElementById('" . $datatype . "type{$num}').value= '{$oneType}';\r\n\t\t\t\t\t\tupdate" . ucfirst($datatype) . "({$num});";
if (empty($filter->{$datatype}[$num][$oneType])) {
continue;
}
foreach ($filter->{$datatype}[$num][$oneType] as $key => $value) {
if (is_array($value)) {
$js .= "try{";
foreach ($value as $subkey => $subval) {
$js .= "document.adminForm.elements['" . $datatype . "[{$num}][{$oneType}][{$key}][{$subkey}]'].value = '" . addslashes(str_replace(array("\n", "\r"), ' ', $subval)) . "';";
$js .= "if(document.adminForm.elements['" . $datatype . "[{$num}][{$oneType}][{$key}][{$subkey}]'].type && document.adminForm.elements['" . $datatype . "[{$num}][{$oneType}][{$key}][{$subkey}]'].type == 'checkbox'){ document.adminForm.elements['" . $datatype . "[{$num}][{$oneType}][{$key}][{$subkey}]'].checked = 'checked'; }";
}
$js .= "}catch(e){}";
}
$myVal = is_array($value) ? implode(',', $value) : $value;
$js .= "try{";
$js .= "document.adminForm.elements['" . $datatype . "[{$num}][{$oneType}][{$key}]'].value = '" . addslashes(str_replace(array("\n", "\r"), ' ', $myVal)) . "';";
$js .= "if(document.adminForm.elements['" . $datatype . "[{$num}][{$oneType}][{$key}]'].type && document.adminForm.elements['" . $datatype . "[{$num}][{$oneType}][{$key}]'].type == 'checkbox'){ document.adminForm.elements['" . $datatype . "[{$num}][{$oneType}][{$key}]'].checked = 'checked'; }";
$js .= "}catch(e){}";
}
$js .= "\n" . " if(typeof(onAcyDisplay" . ucfirst($datatype) . "_" . $oneType . ") == 'function'){\r\n\t\t\t\t\ttry{ onAcyDisplay" . ucfirst($datatype) . "_" . $oneType . "({$num}); }catch(e){alert('Error in the onAcyDisplay" . ucfirst($datatype) . "_" . $oneType . " function : '+e); }\r\n\t\t\t\t}";
if ($datatype == 'filter') {
$js .= " countresults({$num});";
}
}
}
$listid = JRequest::getInt('listid');
if (!empty($listid)) {
$js .= "document.getElementById('actiontype0').value = 'list'; updateAction(0); document.adminForm.elements['action[0][list][selectedlist]'].value = '" . $listid . "';";
}
$doc->addScriptDeclaration("window.addEvent('domready', function(){ {$js} });");
$triggers = array();
$triggers['daycron'] = JText::_('AUTO_CRON_FILTER');
$nextDate = $config->get('cron_plugins_next');
$listHours = array();
$listMinutess = array();
for ($i = 0; $i < 24; $i++) {
$listHours[] = JHTML::_('select.option', $i, $i < 10 ? '0' . $i : $i);
}
$hours = JHTML::_('select.genericlist', $listHours, 'triggerhours', 'class="inputbox" size="1" style="width:60px;"', 'value', 'text', acymailing_getDate($nextDate, 'H'));
for ($i = 0; $i < 60; $i += 5) {
$listMinutess[] = JHTML::_('select.option', $i, $i < 10 ? '0' . $i : $i);
}
$defaultMin = floor(acymailing_getDate($nextDate, 'i') / 5) * 5;
$minutes = JHTML::_('select.genericlist', $listMinutess, 'triggerminutes', 'class="inputbox" size="1" style="width:60px;"', 'value', 'text', $defaultMin);
$this->assign('hours', $hours);
$this->assign('minutes', $minutes);
$this->assign('nextDate', !empty($nextDate) ? ' (' . JText::_('NEXT_RUN') . ' : ' . acymailing_getDate($nextDate, '%d %B %Y %H:%M') . ')' : '');
$triggers['allcron'] = JText::_('ACY_EACH_TIME');
$triggers['subcreate'] = JText::_('ON_USER_CREATE');
$triggers['subchange'] = JText::_('ON_USER_CHANGE');
$this->dispatcher->trigger('onAcyDisplayTriggers', array(&$triggers));
$name = empty($filter->name) ? '' : ' : ' . $filter->name;
if (JRequest::getCmd('tmpl', '') != 'component') {
$acyToolbar = acymailing::get('helper.toolbar');
$acyToolbar->custom('filterDisplayUsers', JText::_('FILTER_VIEW_USERS'), 'user', false, '');
$acyToolbar->custom('process', JText::_('PROCESS'), 'process', false, '');
$acyToolbar->divider();
if (acymailing_level(3)) {
$acyToolbar->save();
if (!empty($filter->filid)) {
$acyToolbar->link(acymailing_completeLink('filter&task=edit&filid=0'), JText::_('ACY_NEW'), 'new');
}
}
$acyToolbar->link(acymailing_completeLink('dashboard'), JText::_('ACY_CLOSE'), 'cancel');
$acyToolbar->divider();
$acyToolbar->help('filter');
$acyToolbar->setTitle(JText::_('ACY_MASS_ACTIONS') . $name, 'filter&task=edit&filid=' . $filid);
$acyToolbar->display();
} else {
acymailing_setPageTitle(JText::_('ACY_MASS_ACTIONS') . $name);
}
$subid = JRequest::getString('subid');
if (!empty($subid)) {
$subArray = explode(',', trim($subid, ','));
JArrayHelper::toInteger($subArray);
$db->setQuery('SELECT `name`,`email` FROM `#__acymailing_subscriber` WHERE `subid` IN (' . implode(',', $subArray) . ')');
$users = $db->loadObjectList();
if (!empty($users)) {
$this->assignRef('users', $users);
$this->assignRef('subid', $subid);
}
}
$this->assignRef('typevaluesFilters', $typevaluesFilters);
$this->assignRef('typevaluesActions', $typevaluesActions);
$this->assignRef('outputFilters', $outputFilters);
$this->assignRef('outputActions', $outputActions);
$this->assignRef('filter', $filter);
$this->assignRef('triggers', $triggers);
if (JRequest::getCmd('tmpl') == 'component') {
$doc->addStyleSheet(ACYMAILING_CSS . 'frontendedition.css?v=' . filemtime(ACYMAILING_MEDIA . 'css' . DS . 'frontendedition.css'));
}
if (acymailing_level(3) and JRequest::getCmd('tmpl') != 'component') {
$db->setQuery('SELECT * FROM #__acymailing_filter ORDER BY `published` DESC, `filid` DESC');
$filters = $db->loadObjectList();
$toggleClass = acymailing_get('helper.toggle');
$this->assignRef('toggleClass', $toggleClass);
$this->assignRef('filters', $filters);
}
}
示例5: setTitle
function setTitle($name, $link = '')
{
$this->title = $name;
$this->titleLink = $link;
acymailing_setPageTitle($name);
}
示例6: acymailing_setTitle
function acymailing_setTitle($name, $picture, $link)
{
$extra = '';
$style = '';
$before = '';
$after = '';
if (!JRequest::getInt('hidemainmenu')) {
$config = acymailing_config();
if ($config->get('menu_position', 'under') == 'under') {
$app = JFactory::getApplication();
$currentTemplate = $app->getTemplate();
if (ACYMAILING_J30 || in_array($currentTemplate, array('rt_missioncontrol', 'aplite', 'adminpraise3'))) {
$newConfig = new stdClass();
$newConfig->menu_position = 'above';
$config->save($newConfig);
}
$menuHelper = acymailing_get('helper.acymenu');
$extra = $menuHelper->display($link);
$style = 'style="line-height:30px;"';
$before = '<div style="min-height:48px">';
$after = '</div>';
}
}
JToolBarHelper::title($before . '<a ' . $style . ' href="' . acymailing_completeLink($link) . '">' . htmlspecialchars($name, ENT_COMPAT, 'UTF-8') . '</a>' . $extra . $after, $picture . '.png');
acymailing_setPageTitle($name);
}
示例7: unsub
function unsub()
{
$subscriberClass = acymailing_get('class.subscriber');
$config = acymailing_config();
$this->assignRef('config', $config);
$subscriber = $subscriberClass->identify();
$this->assignRef('subscriber', $subscriber);
$mailid = JRequest::getInt('mailid');
$this->assignRef('mailid', $mailid);
$replace = array();
$replace['{list:name}'] = '';
foreach ($subscriber as $oneProp => $oneVal) {
$replace['{user:' . $oneProp . '}'] = $oneVal;
}
if (!empty($mailid)) {
$classListmail = acymailing_get('class.listmail');
$lists = $classListmail->getLists($mailid);
$this->assignRef('lists', $lists);
if (!empty($lists)) {
$oneList = reset($lists);
foreach ($oneList as $oneProp => $oneVal) {
$replace['{list:' . $oneProp . '}'] = $oneVal;
}
}
$mailClass = acymailing_get('class.mail');
$news = $mailClass->get($mailid);
if (!empty($news)) {
foreach ($news as $oneProp => $oneVal) {
if (!is_string($oneVal)) {
continue;
}
$replace['{mail:' . $oneProp . '}'] = $oneVal;
}
}
}
$intro = str_replace('UNSUB_INTRO', JText::_('UNSUB_INTRO'), $config->get('unsub_intro', 'UNSUB_INTRO'));
$intro = '<div class="unsubintro">' . nl2br(str_replace(array_keys($replace), $replace, $intro)) . '</div>';
$this->assignRef('intro', $intro);
$this->assignRef('replace', $replace);
$unsubtext = str_replace(array_keys($replace), $replace, JText::_('UNSUBSCRIBE'));
$app = JFactory::getApplication();
$pathway = $app->getPathway();
$pathway->addItem($unsubtext);
acymailing_setPageTitle($unsubtext);
}
示例8: abtesting
//.........这里部分代码省略.........
}
$this->assign('savedValues', true);
if ($abTestDetail['status'] == 'inProgress') {
$warningMsg[] = JText::_('ABTESTING_INPROGRESS');
}
}
if ($validationStatus == 'abTestAdd') {
$noMsg = true;
}
if (!empty($abTestDetail['status']) && $abTestDetail['status'] == 'abTestFinalSend' && !empty($abTestDetail['newMail'])) {
$mailInQueueErrorMsg = JText::_('ABTESTING_FINALMAILINQUEUE');
$mailTocheck = '=' . $abTestDetail['newMail'];
} else {
$mailInQueueErrorMsg = JText::_('ABTESTING_TESTMAILINQUEUE');
$mailTocheck = ' IN (' . implode(',', $mailsArray) . ')';
}
$query = "SELECT COUNT(*) FROM #__acymailing_queue WHERE mailid" . $mailTocheck;
$db->setQuery($query);
$queueCheck = $db->loadResult();
if (!empty($queueCheck) && $validationStatus != 'abTestAdd') {
acymailing_enqueueMessage($mailInQueueErrorMsg, 'error');
$noMsg = true;
}
if (!empty($resDetail) && empty($queueCheck) && in_array($abTestDetail['status'], array('inProgress', 'abTestFinalSend'))) {
if ($abTestDetail['status'] == 'inProgress') {
$abTestDetail['status'] = 'testSendOver';
} else {
$abTestDetail['status'] = 'completed';
}
$query = "UPDATE #__acymailing_mail SET abtesting=" . $db->quote(serialize($abTestDetail)) . " WHERE mailid IN (" . implode(',', $mailsArray) . ")";
$db->setQuery($query);
$db->query();
}
if (!empty($abTestDetail['status']) && $abTestDetail['status'] == 'testSendOver') {
acymailing_enqueueMessage(JText::_('ABTESTING_READYTOSEND'), 'info');
}
if (!empty($abTestDetail['status']) && $abTestDetail['status'] == 'completed') {
acymailing_enqueueMessage(JText::_('ABTESTING_COMPLETE'), 'info');
}
$this->assign('abTestDetail', $abTestDetail);
$nbMails = count($mailsArray);
$titleStr = "A/B/C/D/E/F/G/H/I/J/K/L/M/N/O/P/Q/R/S/T/U/V/W/X/Y/Z";
$titlePage = JText::sprintf('ABTESTING_TITLE', substr($titleStr, 0, min($nbMails, 26) * 2 - 1));
$mailClass = acymailing_get('class.mail');
$mailsDetails = array();
foreach ($mailsArray as $mailid) {
$mailsDetails[] = $mailClass->get($mailid);
}
$this->assign('mailsdetails', $mailsDetails);
$mailerHelper = acymailing_get('helper.mailer');
$mailerHelper->loadedToSend = false;
$mailReceiver = $mailerHelper->load($mailsArray[0]);
$listmailClass = acymailing_get('class.listmail');
$lists = $listmailClass->getReceivers($mailReceiver->mailid, true, false);
$this->assign('lists', $lists);
$this->assign('mailReceiver', $mailReceiver);
$filterClass = acymailing_get('class.filter');
$this->assign('filterClass', $filterClass);
$listids = array();
foreach ($lists as $oneList) {
$listids[] = $oneList->listid;
}
$nbTotalReceivers = $filterClass->countReceivers($listids, $this->mailReceiver->filter, $this->mailReceiver->mailid);
if ($nbTotalReceivers < 50) {
$warningMsg[] = JText::sprintf('ABTESTING_NOTENOUGHUSER', $nbTotalReceivers);
$noBtn = true;
}
$this->assign('nbTotalReceivers', $nbTotalReceivers);
$this->assign('nbTestReceivers', floor($nbTotalReceivers * $abTestDetail['prct'] / 100));
if ($noMsg || $noBtn) {
$noButton = true;
}
$queryStat = 'SELECT mailid, openunique, clickunique, senthtml, senttext, bounceunique FROM #__acymailing_stats WHERE mailid IN (' . $mailids . ')';
$db->setQuery($queryStat);
$resStat = $db->loadObjectList('mailid');
if (!empty($resStat)) {
$this->assign('statMail', $resStat);
$warningMsg[] = JText::_('ABTESTING_STAT_WARNING');
}
if (!empty($warningMsg) && $noMsg == false) {
acymailing_enqueueMessage(implode('<br />', $warningMsg), 'warning');
}
}
} else {
$titlePage = JText::_('ABTESTING');
}
$acyToolbar = acymailing::get('helper.toolbar');
if (empty($noButton)) {
$acyToolbar->custom('test', JText::_('ABTESTING_TEST'), 'test', false, "javascript:if(confirm('" . JText::_('PROCESS_CONFIRMATION', true) . "')){submitbutton('abtest');} return false;");
}
$acyToolbar->setTitle(JText::_('ABTESTING'));
$acyToolbar->topfixed = false;
$acyToolbar->display();
$this->assign('validationStatus', $validationStatus);
$this->assign('titlePage', $titlePage);
$this->assign('app', $app);
if ($app->isAdmin()) {
acymailing_setPageTitle(JText::_('ABTESTING'));
}
}
示例9: mailing
function mailing()
{
$doc = JFactory::getDocument();
$doc->addStyleSheet(ACYMAILING_CSS . 'frontendedition.css?v=' . filemtime(ACYMAILING_MEDIA . 'css' . DS . 'frontendedition.css'));
$doc->addStyleSheet(ACYMAILING_CSS . 'acyprint.css', 'text/css', 'print');
$mailid = JRequest::getInt('mailid');
if (empty($mailid)) {
return;
}
$db = JFactory::getDBO();
$db->setQuery('SELECT * FROM ' . acymailing_table('stats') . ' WHERE mailid = ' . intval($mailid));
$mailingstats = $db->loadObject();
if (empty($mailingstats->mailid)) {
return;
}
$db->setQuery('SELECT COUNT(browser) as nbBrowser, browser FROM ' . acymailing_table('userstats') . ' WHERE browser IS NOT NULL AND mailid = ' . intval($mailid) . ' GROUP BY browser ORDER BY nbBrowser DESC');
$browserstats = $db->loadObjectList('browser');
$db->setQuery('SELECT COUNT(*) as nbMobile, is_mobile FROM ' . acymailing_table('userstats') . ' WHERE is_mobile IS NOT NULL AND mailid = ' . intval($mailid) . ' GROUP BY is_mobile');
$ismobilestats = $db->loadObjectList('is_mobile');
$db->setQuery('SELECT COUNT(mobile_os) as nbOS, mobile_os FROM ' . acymailing_table('userstats') . ' WHERE mobile_os IS NOT NULL AND mobile_os <> \'\' AND mailid = ' . intval($mailid) . ' GROUP BY mobile_os ORDER BY nbOS DESC');
$mobileosstats = $db->loadObjectList('mobile_os');
$mailClass = acymailing_get('class.mail');
$mailing = $mailClass->get($mailid);
acymailing_setPageTitle($mailing->subject);
$db->setQuery('SELECT COUNT(*) FROM `#__acymailing_queue` WHERE `mailid` = ' . $mailingstats->mailid . ' GROUP BY `mailid`');
$mailingstats->queue = $db->loadResult();
$db->setQuery('SELECT min(opendate) as minval, max(opendate) as maxval FROM ' . acymailing_table('userstats') . ' WHERE opendate > 0 AND mailid = ' . intval($mailid));
$datesOpen = $db->loadObject();
$db->setQuery('SELECT min(`date`) as minval, max(`date`) as maxval FROM ' . acymailing_table('urlclick') . ' WHERE mailid = ' . intval($mailid));
$datesClick = $db->loadObject();
$spaces = array();
$intervals = 10;
$minDate = min($datesOpen->minval, $datesClick->minval);
if (empty($minDate)) {
$minDate = max($datesOpen->minval, $datesClick->minval);
}
$maxDate = max($datesOpen->maxval, $datesClick->maxval) + 1;
$delay = ($maxDate - $minDate) / $intervals;
for ($i = 0; $i < $intervals; $i++) {
$spaces[$i] = (int) ($minDate + $delay * $i);
}
$spaces[$intervals] = $maxDate;
$openclick = new stdClass();
$openclick->open = array();
$openclick->click = array();
$openclick->legend = array();
$dateFormat = '%d %B %Y';
if (date('Y', $maxDate) == date('Y', $minDate)) {
$dateFormat = '%d %B';
if (date('m', $maxDate) == date('m', $minDate)) {
$dateFormat = '%A %d';
if ($delay < 172800) {
$dateFormat = '%a %d %H:%M';
}
}
}
$openresults = array();
$legendX = array();
for ($i = 0; $i <= $intervals; $i++) {
if ($i % 2 == 0) {
$openclick->legend[$i] = acymailing_getDate($spaces[$i], $dateFormat);
}
$db->setQuery('SELECT count(subid) FROM ' . acymailing_table('userstats') . ' WHERE opendate < ' . $spaces[$i] . ' AND opendate > 0 AND mailid = ' . intval($mailid));
$openclick->open[$i] = (int) $db->loadResult();
$db->setQuery('SELECT count(subid) FROM ' . acymailing_table('urlclick') . ' WHERE date < ' . $spaces[$i] . ' AND mailid = ' . intval($mailid));
$openclick->click[$i] = (int) $db->loadResult();
}
$joomConfig = JFactory::getConfig();
$timeoffset = ACYMAILING_J30 ? $joomConfig->get('offset') : $joomConfig->getValue('config.offset');
$diffTime = $timeoffset - date('Z');
$groupingFormat = '%Y %j';
$phpformat = '%d %B';
$diff = 86400;
if ($delay < 3600) {
$groupingFormat = '%Y %j %H';
$phpformat = '%a %d %H';
$diff = 3600;
}
$query = "SELECT DATE_FORMAT(FROM_UNIXTIME(a.opendate + {$diffTime}),'{$groupingFormat}') AS openday, a.opendate, COUNT(a.subid) AS totalopen ";
$query .= 'FROM #__acymailing_userstats AS a WHERE opendate > 0 AND mailid = ' . intval($mailid);
$query .= ' GROUP BY openday ORDER BY openday DESC LIMIT 10';
$db->setQuery($query);
$datesOpen = $db->loadObjectList('openday');
$query = "SELECT DATE_FORMAT(FROM_UNIXTIME(a.date + {$diffTime}),'{$groupingFormat}') AS clickday, a.date, COUNT(a.subid) AS totalclick ";
$query .= 'FROM #__acymailing_urlclick AS a WHERE mailid = ' . intval($mailid);
$query .= ' GROUP BY clickday ORDER BY clickday DESC LIMIT 10';
$db->setQuery($query);
$datesClick = $db->loadObjectList('clickday');
$openclickday = array();
foreach ($datesOpen as $time => $oneDate) {
$openclickday[$time] = array();
$openclickday[$time]['date'] = acymailing_getDate($oneDate->opendate, $phpformat);
$openclickday[$time]['nextdate'] = acymailing_getDate($oneDate->opendate - $diff, $phpformat);
$openclickday[$time]['open'] = $oneDate;
}
foreach ($datesClick as $time => $oneDate) {
if (!isset($openclickday[$time])) {
$openclickday[$time] = array();
$openclickday[$time]['date'] = acymailing_getDate($oneDate->date, $phpformat);
$openclickday[$time]['nextdate'] = acymailing_getDate($oneDate->date - $diff, $phpformat);
//.........这里部分代码省略.........