本文整理汇总了PHP中acymailing_getEscaped函数的典型用法代码示例。如果您正苦于以下问题:PHP acymailing_getEscaped函数的具体用法?PHP acymailing_getEscaped怎么用?PHP acymailing_getEscaped使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了acymailing_getEscaped函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: remove
function remove()
{
if (!$this->isAllowed($this->aclCat, 'delete')) {
return;
}
JRequest::checkToken() or die('Invalid Token');
$mailid = JRequest::getVar('filter_mail', 0, 'post', 'int');
$queueClass = acymailing_get('class.queue');
$search = JRequest::getString('search');
$filters = array();
if (!empty($search)) {
$db = JFactory::getDBO();
$searchVal = '\'%' . acymailing_getEscaped($search, true) . '%\'';
$searchFields = array('b.name', 'b.email', 'c.subject', 'a.mailid', 'a.subid');
$filters[] = implode(" LIKE {$searchVal} OR ", $searchFields) . " LIKE {$searchVal}";
}
if (!empty($mailid)) {
$filters[] = 'a.mailid = ' . intval($mailid);
}
$total = $queueClass->delete($filters);
$app = JFactory::getApplication();
$app->enqueueMessage(JText::sprintf('SUCC_DELETE_ELEMENTS', $total), 'message');
JRequest::setVar('filter_mail', 0, 'post');
JRequest::setVar('search', '', 'post');
return $this->listing();
}
示例2: trigger
function trigger($triggerName)
{
if (!acymailing_level(3)) {
return;
}
$config = acymailing_config();
if (!$config->get('triggerfilter_' . $triggerName)) {
return;
}
$this->database->setQuery("SELECT * FROM `#__acymailing_filter` WHERE `trigger` LIKE '%" . acymailing_getEscaped($triggerName, true) . "%' ORDER BY filid ASC");
$filters = $this->database->loadObjectList();
if (empty($filters)) {
$newconfig = new stdClass();
$name = 'triggerfilter_' . $triggerName;
$newconfig->{$name} = 0;
$config->save($newconfig);
return;
}
foreach ($filters as $oneFilter) {
if (empty($oneFilter->published)) {
continue;
}
if (!empty($oneFilter->filter)) {
$oneFilter->filter = unserialize($oneFilter->filter);
}
if (!empty($oneFilter->action)) {
$oneFilter->action = unserialize($oneFilter->action);
}
$this->execute($oneFilter->filter, $oneFilter->action);
}
}
示例3: delete
function delete($elements)
{
if (!is_array($elements)) {
$elements = array($elements);
}
foreach ($elements as $key => $val) {
$elements[$key] = acymailing_getEscaped($val);
}
if (empty($elements)) {
return 0;
}
$this->database->setQuery('DELETE FROM #__acymailing_listcampaign WHERE `campaignid` IN (' . implode(',', $elements) . ')');
$this->database->query();
return parent::delete($elements);
}
示例4: acymailing_generateautonews
//.........这里部分代码省略.........
if (strpos($parameter->maxcreated, '[time]') !== false) {
$date = acymailing_replaceDate(str_replace('[time]', '{time}', $parameter->maxcreated));
}
if (!is_numeric($date)) {
$date = strtotime($parameter->maxcreated);
}
if (empty($date)) {
acymailing_display('Wrong date format (' . $parameter->maxcreated . ' in ' . $oneTag . '), please use YYYY-MM-DD', 'warning');
}
$where[] = '`created` < ' . $this->db->Quote(date('Y-m-d H:i:s', $date)) . ' OR `publish_up` < ' . $this->db->Quote(date('Y-m-d H:i:s', $date));
} else {
$where[] = '`publish_up` < \'' . date('Y-m-d H:i:s', $time - date('Z')) . '\'';
}
if (!empty($parameter->mincreated)) {
$date = $parameter->mincreated;
if (strpos($parameter->mincreated, '[time]') !== false) {
$date = acymailing_replaceDate(str_replace('[time]', '{time}', $parameter->mincreated));
}
if (!is_numeric($date)) {
$date = strtotime($parameter->mincreated);
}
if (empty($date)) {
acymailing_display('Wrong date format (' . $parameter->mincreated . ' in ' . $oneTag . '), please use YYYY-MM-DD', 'warning');
}
$where[] = '`created` > ' . $this->db->Quote(date('Y-m-d H:i:s', $date)) . ' OR `publish_up` > ' . $this->db->Quote(date('Y-m-d H:i:s', $date));
}
if (!empty($parameter->meta)) {
$allMetaTags = explode(',', $parameter->meta);
$metaWhere = array();
foreach ($allMetaTags as $oneMeta) {
if (empty($oneMeta)) {
continue;
}
$metaWhere[] = "`metakey` LIKE '%" . acymailing_getEscaped($oneMeta, true) . "%'";
}
if (!empty($metaWhere)) {
$where[] = implode(' OR ', $metaWhere);
}
}
$where[] = '`publish_down` > \'' . date('Y-m-d H:i:s', $time - date('Z')) . '\' OR `publish_down` = 0';
if (empty($parameter->unpublished)) {
$where[] = 'state = 1';
} else {
$where[] = 'state = 0';
}
if (!ACYMAILING_J16) {
if (isset($parameter->access)) {
$where[] = 'access <= ' . intval($parameter->access);
} else {
if ($this->params->get('contentaccess', 'registered') == 'registered') {
$where[] = 'access <= 1';
} elseif ($this->params->get('contentaccess', 'registered') == 'public') {
$where[] = 'access = 0';
}
}
} elseif (isset($parameter->access)) {
if (strpos($parameter->access, ',')) {
$allAccess = explode(',', $parameter->access);
JArrayHelper::toInteger($allAccess);
$where[] = 'access IN (' . implode(',', $allAccess) . ')';
} else {
$where[] = 'access = ' . intval($parameter->access);
}
}
if (ACYMAILING_J16 && !empty($parameter->language)) {
$allLanguages = explode(',', $parameter->language);
示例5: listing
function listing()
{
JHTML::_('behavior.modal', 'a.modal');
$app = JFactory::getApplication();
$pageInfo = new stdClass();
$pageInfo->filter = new stdClass();
$pageInfo->filter->order = new stdClass();
$pageInfo->limit = new stdClass();
$pageInfo->elements = new stdClass();
$config = acymailing_config();
$paramBase = ACYMAILING_COMPONENT . '.' . $this->getName();
$pageInfo->filter->order->value = $app->getUserStateFromRequest($paramBase . ".filter_order", 'filter_order', 'a.mailid', 'cmd');
$pageInfo->filter->order->dir = $app->getUserStateFromRequest($paramBase . ".filter_order_Dir", 'filter_order_Dir', 'desc', 'word');
if (strtolower($pageInfo->filter->order->dir) !== 'desc') {
$pageInfo->filter->order->dir = 'asc';
}
$pageInfo->search = $app->getUserStateFromRequest($paramBase . ".search", 'search', '', 'string');
$pageInfo->search = JString::strtolower(trim($pageInfo->search));
$selectedList = $app->getUserStateFromRequest($paramBase . "filter_list", 'filter_list', 0, 'int');
$selectedCreator = $app->getUserStateFromRequest($paramBase . "filter_creator", 'filter_creator', 0, 'int');
$pageInfo->limit->value = $app->getUserStateFromRequest($paramBase . '.list_limit', 'limit', $app->getCfg('list_limit'), 'int');
$pageInfo->limit->start = $app->getUserStateFromRequest($paramBase . '.limitstart', 'limitstart', 0, 'int');
$database = JFactory::getDBO();
$searchMap = array('a.mailid', 'a.alias', 'a.subject', 'a.fromname', 'a.fromemail', 'a.replyname', 'a.replyemail', 'a.userid', 'b.name', 'b.username', 'b.email');
$filters = array();
if (!empty($pageInfo->search)) {
$searchVal = '\'%' . acymailing_getEscaped($pageInfo->search, true) . '%\'';
$filters[] = implode(" LIKE {$searchVal} OR ", $searchMap) . " LIKE {$searchVal}";
}
$filters[] = 'a.type = \'' . $this->type . '\'';
if (!empty($selectedList)) {
$filters[] = 'c.listid = ' . $selectedList;
}
if (!empty($selectedCreator)) {
$filters[] = 'a.userid = ' . $selectedCreator;
}
if ($this->type == 'news') {
$selectedDate = $app->getUserStateFromRequest($paramBase . "filter_date", 'filter_date', 0, 'string');
if (!empty($selectedDate)) {
if (strlen($selectedDate) > 4) {
$filters[] = 'DATE_FORMAT(FROM_UNIXTIME(senddate),"%Y-%m") = ' . $database->Quote($selectedDate);
} else {
$filters[] = 'DATE_FORMAT(FROM_UNIXTIME(senddate),"%Y") = ' . $database->Quote($selectedDate);
}
}
}
$selection = array_merge($searchMap, array('a.created', 'a.frequency', 'a.senddate', 'a.published', 'a.type', 'a.visible', 'a.abtesting'));
if (empty($selectedList)) {
if ($app->isAdmin()) {
$query = 'SELECT ' . implode(',', $selection) . ' FROM ' . acymailing_table('mail') . ' as a';
$queryCount = 'SELECT COUNT(a.mailid) FROM ' . acymailing_table('mail') . ' as a';
} else {
$query = 'SELECT ' . implode(',', $selection) . ' FROM ' . acymailing_table('listmail') . ' as c';
$query .= ' JOIN ' . acymailing_table('mail') . ' as a on a.mailid = c.mailid ';
$queryCount = 'SELECT COUNT(DISTINCT c.mailid) FROM ' . acymailing_table('listmail') . ' as c';
$queryCount .= ' JOIN ' . acymailing_table('mail') . ' as a on a.mailid = c.mailid ';
}
} else {
$query = 'SELECT ' . implode(',', $selection) . ' FROM ' . acymailing_table('listmail') . ' as c';
$query .= ' JOIN ' . acymailing_table('mail') . ' as a on a.mailid = c.mailid ';
$queryCount = 'SELECT COUNT(c.mailid) FROM ' . acymailing_table('listmail') . ' as c';
$queryCount .= ' JOIN ' . acymailing_table('mail') . ' as a on a.mailid = c.mailid ';
}
$query .= ' LEFT JOIN ' . acymailing_table('users', false) . ' as b on a.userid = b.id ';
$query .= ' WHERE (' . implode(') AND (', $filters) . ')';
if (count($filters) > 1) {
$queryCount .= ' LEFT JOIN ' . acymailing_table('users', false) . ' as b on a.userid = b.id ';
}
$queryCount .= ' WHERE (' . implode(') AND (', $filters) . ')';
if (!$app->isAdmin()) {
$listClass = acymailing_get('class.list');
$lists = $listClass->getFrontendLists();
if (!empty($lists)) {
$frontListsIds = array();
if (empty($selectedList)) {
foreach ($lists as $oneList) {
$frontListsIds[] = $oneList->listid;
}
$query .= ' AND c.listid IN (' . implode(',', $frontListsIds) . ')';
$queryCount .= ' AND c.listid IN (' . implode(',', $frontListsIds) . ')';
}
}
$query .= ' GROUP BY a.mailid ';
}
if (!empty($pageInfo->filter->order->value)) {
$query .= ' ORDER BY ' . $pageInfo->filter->order->value . ' ' . $pageInfo->filter->order->dir;
}
$database->setQuery($query, $pageInfo->limit->start, $pageInfo->limit->value);
$rows = $database->loadObjectList('mailid');
if (!empty($rows)) {
$database->setQuery('SELECT COUNT(*) AS countqueued, mailid FROM ' . acymailing_table('queue') . ' WHERE mailid IN (' . implode(',', array_keys($rows)) . ') GROUP BY mailid');
$queueCount = $database->loadObjectList();
if (!empty($queueCount)) {
foreach ($queueCount as $oneQueueCount) {
$rows[$oneQueueCount->mailid]->countqueued = $oneQueueCount->countqueued;
}
}
}
$database->setQuery($queryCount);
$pageInfo->elements->total = $database->loadResult();
//.........这里部分代码省略.........
示例6: listing
//.........这里部分代码省略.........
}
$values->show_description = $config->get('show_description', 1);
$values->show_headings = $config->get('show_headings', 1);
$values->show_senddate = $config->get('show_senddate', 1);
$values->show_colnumber = $config->get('show_colnumber', 1);
$values->show_receiveemail = $config->get('show_receiveemail', 0) && acymailing_level(1);
$values->filter = $config->get('show_filter', 1);
if (empty($values->page_title)) {
$values->page_title = $oneList->name;
}
if (empty($values->page_heading)) {
$values->page_heading = $oneList->name;
}
if (empty($menuparams)) {
$pathway->addItem(JText::_('MAILING_LISTS'), acymailing_completeLink('lists'));
$pathway->addItem($values->page_title);
} elseif (!$menuparams->get('listid')) {
$pathway->addItem($values->page_title);
}
$document = JFactory::getDocument();
$document->setTitle($values->page_title);
$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);
}
$db = JFactory::getDBO();
$searchMap = array('a.mailid', 'a.subject', 'a.alias');
$filters = array();
if (!empty($pageInfo->search)) {
$searchVal = '\'%' . acymailing_getEscaped($pageInfo->search, true) . '%\'';
$filters[] = implode(" LIKE {$searchVal} OR ", $searchMap) . " LIKE {$searchVal}";
}
$filters[] = 'a.type = \'news\'';
if (!$access->frontEndManament) {
$filters[] = 'a.published = 1';
$filters[] = 'a.visible = 1';
}
$filters[] = 'c.listid = ' . $oneList->listid;
$selection = array_merge($searchMap, array('a.senddate', 'a.created', 'a.visible', 'a.published', 'a.fromname', 'a.fromemail', 'a.replyname', 'a.replyemail', 'a.userid'));
$query = 'SELECT ' . implode(',', $selection);
$query .= ' FROM ' . acymailing_table('listmail') . ' as c';
$query .= ' JOIN ' . acymailing_table('mail') . ' as a on a.mailid = c.mailid ';
$query .= ' WHERE (' . implode(') AND (', $filters) . ')';
$query .= ' ORDER BY ' . acymailing_secureField($pageInfo->filter->order->value) . ' ' . acymailing_secureField($pageInfo->filter->order->dir) . ', c.mailid DESC';
$db->setQuery($query, $pageInfo->limit->start, $pageInfo->limit->value);
$rows = $db->loadObjectList();
$pageInfo->elements->page = count($rows);
if (!empty($pageInfo->search)) {
$rows = acymailing_search($pageInfo->search, $rows);
}
if ($pageInfo->limit->value > $pageInfo->elements->page) {
$pageInfo->elements->total = $pageInfo->limit->start + $pageInfo->elements->page;
} else {
$queryCount = 'SELECT COUNT(c.mailid) FROM ' . acymailing_table('listmail') . ' as c';
$queryCount .= ' JOIN ' . acymailing_table('mail') . ' as a on a.mailid = c.mailid ';
$queryCount .= ' WHERE (' . implode(') AND (', $filters) . ')';
$db->setQuery($queryCount);
$pageInfo->elements->total = $db->loadResult();
}
jimport('joomla.html.pagination');
$pagination = new JPagination($pageInfo->elements->total, $pageInfo->limit->start, $pageInfo->limit->value);
$js = 'function tableOrdering( order, dir, task ){
var form = document.adminForm;
form.filter_order.value = order;
form.filter_order_Dir.value = dir;
document.adminForm.submit( task );
}
function changeReceiveEmail(checkedbox){
var form = document.adminForm;
if(checkedbox){
form.nbreceiveemail.value++;
}else{
form.nbreceiveemail.value--;
}
if(form.nbreceiveemail.value > 0 ){
document.getElementById(\'receiveemailbox\').className = \'receiveemailbox receiveemailbox_visible\';
}else{
document.getElementById(\'receiveemailbox\').className = \'receiveemailbox receiveemailbox_hidden\';
}
}
';
$doc = JFactory::getDocument();
$doc->addScriptDeclaration($js);
$this->assignRef('access', $access);
$this->assignRef('rows', $rows);
$this->assignRef('values', $values);
$this->assignRef('list', $oneList);
$this->assignRef('pagination', $pagination);
$this->assignRef('pageInfo', $pageInfo);
$this->assignRef('config', $config);
$this->assignRef('my', $my);
}
示例7: choose
function choose()
{
$pageInfo = new stdClass();
$app = JFactory::getApplication();
$paramBase = ACYMAILING_COMPONENT . '.' . $this->getName() . '_' . $this->getLayout() . JRequest::getInt('onlyreg', 0);
$pageInfo->filter = new stdClass();
$pageInfo->filter->order = new stdClass();
$pageInfo->limit = new stdClass();
$pageInfo->elements = new stdClass();
$pageInfo->filter->order->value = $app->getUserStateFromRequest($paramBase . ".filter_order", 'filter_order', 'a.name', 'cmd');
$pageInfo->filter->order->dir = $app->getUserStateFromRequest($paramBase . ".filter_order_Dir", 'filter_order_Dir', 'asc', 'word');
$pageInfo->search = $app->getUserStateFromRequest($paramBase . ".search", 'search', '', 'string');
$pageInfo->search = JString::strtolower(trim($pageInfo->search));
$pageInfo->limit->value = $app->getUserStateFromRequest($paramBase . '.list_limit', 'limit', $app->getCfg('list_limit'), 'int');
$pageInfo->limit->start = $app->getUserStateFromRequest($paramBase . '.limitstart', 'limitstart', 0, 'int');
if (empty($pageInfo->limit->value)) {
$pageInfo->limit->value = 100;
}
$db = JFactory::getDBO();
$filters = array();
if (!empty($pageInfo->search)) {
$searchVal = '\'%' . acymailing_getEscaped($pageInfo->search, true) . '%\'';
$filters[] = implode(" LIKE {$searchVal} OR ", $this->searchFields) . " LIKE {$searchVal}";
}
if (JRequest::getInt('onlyreg')) {
$filters[] = 'a.userid > 0';
}
$query = 'SELECT ' . implode(',', $this->selectedFields) . ' FROM #__acymailing_subscriber as a';
$query .= ' LEFT JOIN #__users as b on a.userid = b.id';
if (!empty($filters)) {
$query .= ' WHERE (' . implode(') AND (', $filters) . ')';
}
if (!empty($pageInfo->filter->order->value)) {
$query .= ' ORDER BY ' . $pageInfo->filter->order->value . ' ' . $pageInfo->filter->order->dir;
}
$db->setQuery($query, $pageInfo->limit->start, $pageInfo->limit->value);
$rows = $db->loadObjectList();
$queryWhere = 'SELECT COUNT(a.subid) FROM #__acymailing_subscriber as a';
if (!empty($filters)) {
$queryWhere .= ' LEFT JOIN #__users as b on a.userid = b.id';
$queryWhere .= ' WHERE (' . implode(') AND (', $filters) . ')';
}
$db->setQuery($queryWhere);
$pageInfo->elements->total = $db->loadResult();
$pageInfo->elements->page = count($rows);
jimport('joomla.html.pagination');
$pagination = new JPagination($pageInfo->elements->total, $pageInfo->limit->start, $pageInfo->limit->value);
$this->assignRef('rows', $rows);
$this->assignRef('pageInfo', $pageInfo);
$this->assignRef('pagination', $pagination);
}
示例8: listing
function listing()
{
$app = JFactory::getApplication();
$pageInfo = new stdClass();
$pageInfo->filter = new stdClass();
$pageInfo->filter->order = new stdClass();
$pageInfo->limit = new stdClass();
$pageInfo->elements = new stdClass();
$config = acymailing_config();
$paramBase = ACYMAILING_COMPONENT . '.' . $this->getName();
$pageInfo->filter->order->value = $app->getUserStateFromRequest($paramBase . ".filter_order", 'filter_order', 'a.mailid', 'cmd');
$pageInfo->filter->order->dir = $app->getUserStateFromRequest($paramBase . ".filter_order_Dir", 'filter_order_Dir', 'desc', 'word');
$pageInfo->search = $app->getUserStateFromRequest($paramBase . ".search", 'search', '', 'string');
$pageInfo->search = JString::strtolower($pageInfo->search);
$selectedList = $app->getUserStateFromRequest($paramBase . "filter_list", 'filter_list', 0, 'int');
$selectedCreator = $app->getUserStateFromRequest($paramBase . "filter_creator", 'filter_creator', 0, 'int');
$pageInfo->limit->value = $app->getUserStateFromRequest($paramBase . '.list_limit', 'limit', $app->getCfg('list_limit'), 'int');
$pageInfo->limit->start = $app->getUserStateFromRequest($paramBase . '.limitstart', 'limitstart', 0, 'int');
$database = JFactory::getDBO();
$searchMap = array('a.mailid', 'a.alias', 'a.subject', 'a.fromname', 'a.fromemail', 'a.replyname', 'a.replyemail', 'a.userid', 'b.name', 'b.username', 'b.email');
$filters = array();
if (!empty($pageInfo->search)) {
$searchVal = '\'%' . acymailing_getEscaped($pageInfo->search, true) . '%\'';
$filters[] = implode(" LIKE {$searchVal} OR ", $searchMap) . " LIKE {$searchVal}";
}
$filters[] = 'a.type = \'' . $this->type . '\'';
if (!empty($selectedList)) {
$filters[] = 'c.listid = ' . $selectedList;
}
if (!empty($selectedCreator)) {
$filters[] = 'a.userid = ' . $selectedCreator;
}
$selection = array_merge($searchMap, array('a.created', 'a.frequency', 'a.senddate', 'a.published', 'a.type', 'a.visible'));
if (empty($selectedList)) {
$query = 'SELECT ' . implode(',', $selection) . ' FROM ' . acymailing_table('mail') . ' as a';
$queryCount = 'SELECT COUNT(a.mailid) FROM ' . acymailing_table('mail') . ' as a';
} else {
$query = 'SELECT ' . implode(',', $selection) . ' FROM ' . acymailing_table('listmail') . ' as c';
$query .= ' JOIN ' . acymailing_table('mail') . ' as a on a.mailid = c.mailid ';
$queryCount = 'SELECT COUNT(c.mailid) FROM ' . acymailing_table('listmail') . ' as c';
$queryCount .= ' JOIN ' . acymailing_table('mail') . ' as a on a.mailid = c.mailid ';
}
$query .= ' LEFT JOIN ' . acymailing_table('users', false) . ' as b on a.userid = b.id ';
$query .= ' WHERE (' . implode(') AND (', $filters) . ')';
if (!empty($pageInfo->filter->order->value)) {
$query .= ' ORDER BY ' . $pageInfo->filter->order->value . ' ' . $pageInfo->filter->order->dir;
}
if (count($filters) > 1) {
$queryCount .= ' LEFT JOIN ' . acymailing_table('users', false) . ' as b on a.userid = b.id ';
}
$queryCount .= ' WHERE (' . implode(') AND (', $filters) . ')';
$database->setQuery($query, $pageInfo->limit->start, $pageInfo->limit->value);
$rows = $database->loadObjectList();
if (!empty($pageInfo->search)) {
$rows = acymailing_search($pageInfo->search, $rows);
}
$database->setQuery($queryCount);
$pageInfo->elements->total = $database->loadResult();
$pageInfo->elements->page = count($rows);
jimport('joomla.html.pagination');
$pagination = new JPagination($pageInfo->elements->total, $pageInfo->limit->start, $pageInfo->limit->value);
acymailing_setTitle(JText::_($this->nameListing), $this->icon, $this->ctrl);
$bar = JToolBar::getInstance('toolbar');
$buttonPreview = JText::_('ACY_PREVIEW');
if ($this->type == 'autonews') {
JToolBarHelper::custom('generate', 'process', '', JText::_('GENERATE'), false);
} elseif ($this->type == 'news') {
$buttonPreview .= ' / ' . JText::_('SEND');
}
JToolBarHelper::custom('preview', 'acypreview', '', $buttonPreview, true);
JToolBarHelper::divider();
JToolBarHelper::addNew();
JToolBarHelper::editList();
if (acymailing_isAllowed($config->get('acl_' . $this->aclCat . '_delete', 'all'))) {
JToolBarHelper::deleteList(JText::_('ACY_VALIDDELETEITEMS'));
}
JToolBarHelper::spacer();
JToolBarHelper::custom('copy', 'copy.png', 'copy.png', JText::_('ACY_COPY'));
JToolBarHelper::divider();
$bar->appendButton('Pophelp', $this->doc);
if (acymailing_isAllowed($config->get('acl_cpanel_manage', 'all'))) {
$bar->appendButton('Link', 'acymailing', JText::_('ACY_CPANEL'), acymailing_completeLink('dashboard'));
}
$filters = new stdClass();
$listmailType = acymailing_get('type.listsmail');
$listmailType->type = $this->type;
$mailcreatorType = acymailing_get('type.mailcreator');
$mailcreatorType->type = $this->type;
$filters->list = $listmailType->display('filter_list', $selectedList);
$filters->creator = $mailcreatorType->display('filter_creator', $selectedCreator);
$this->assignRef('filters', $filters);
$toggleClass = acymailing_get('helper.toggle');
$this->assignRef('toggleClass', $toggleClass);
$this->assignRef('rows', $rows);
$this->assignRef('pageInfo', $pageInfo);
$this->assignRef('pagination', $pagination);
$delay = acymailing_get('type.delaydisp');
$this->assignRef('delay', $delay);
$this->assignRef('config', $config);
}
示例9: listing
function listing(){
$app = JFactory::getApplication();
$config = acymailing_config();
JHTML::_('behavior.modal','a.modal');
$pageInfo = new stdClass();
$pageInfo->filter = new stdClass();
$pageInfo->filter->order = new stdClass();
$pageInfo->limit = new stdClass();
$pageInfo->elements = new stdClass();
$paramBase = ACYMAILING_COMPONENT.'.'.$this->getName().$this->getLayout();
$pageInfo->filter->order->value = $app->getUserStateFromRequest( $paramBase.".filter_order", 'filter_order', '','cmd' );
$pageInfo->filter->order->dir = $app->getUserStateFromRequest( $paramBase.".filter_order_Dir", 'filter_order_Dir', 'desc', 'word' );
if(strtolower($pageInfo->filter->order->dir) !== 'desc') $pageInfo->filter->order->dir = 'asc';
$pageInfo->search = $app->getUserStateFromRequest( $paramBase.".search", 'search', '', 'string' );
$pageInfo->search = JString::strtolower(trim($pageInfo->search));
$selectedMail = $app->getUserStateFromRequest( $paramBase."filter_mail",'filter_mail',0,'int');
$selectedUrl = $app->getUserStateFromRequest( $paramBase."filter_url",'filter_url',0,'int');
$pageInfo->limit->value = $app->getUserStateFromRequest( $paramBase.'.list_limit', 'limit', $app->getCfg('list_limit'), 'int' );
$pageInfo->limit->start = $app->getUserStateFromRequest( $paramBase.'.limitstart', 'limitstart', 0, 'int' );
$database = JFactory::getDBO();
$filters = array();
if(!empty($pageInfo->search)){
$searchVal = '\'%'.acymailing_getEscaped($pageInfo->search,true).'%\'';
$filters[] = implode(" LIKE $searchVal OR ",$this->searchFields)." LIKE $searchVal";
}
if(!empty($selectedMail)) $filters[] = 'a.mailid = '.$selectedMail;
if(!empty($selectedUrl)) $filters[] = 'a.urlid = '.$selectedUrl;
$query = 'SELECT SQL_CALC_FOUND_ROWS '.implode(' , ',$this->selectFields);
$query .= ' FROM '.acymailing_table('urlclick').' as a';
$query .= ' JOIN '.acymailing_table('mail').' as b on a.mailid = b.mailid';
$query .= ' JOIN '.acymailing_table('url').' as c on a.urlid = c.urlid';
if(!empty($filters)) $query .= ' WHERE ('.implode(') AND (',$filters).')';
$query .= ' GROUP BY a.mailid,a.urlid';
if(!empty($pageInfo->filter->order->value)){
$query .= ' ORDER BY '.$pageInfo->filter->order->value.' '.$pageInfo->filter->order->dir;
}
$database->setQuery($query,$pageInfo->limit->start,$pageInfo->limit->value);
$rows = $database->loadObjectList();
$database->setQuery('SELECT FOUND_ROWS()');
$pageInfo->elements->total = $database->loadResult();
$pageInfo->elements->page = count($rows);
jimport('joomla.html.pagination');
$pagination = new JPagination( $pageInfo->elements->total, $pageInfo->limit->start, $pageInfo->limit->value );
$filtersType = new stdClass();
$mailType = acymailing_get('type.urlmail');
$urlType = acymailing_get('type.url');
$filtersType->mail = $mailType->display('filter_mail',$selectedMail);
$filtersType->url = $urlType->display('filter_url',$selectedUrl);
acymailing_setTitle(JText::_('CLICK_STATISTICS'),'stats','statsurl');
$bar = JToolBar::getInstance('toolbar');
$bar->appendButton( 'Link', 'cancel', JText::_('GLOBAL_STATISTICS'), acymailing_completeLink('stats') );
JToolBarHelper::divider();
$bar->appendButton( 'Pophelp','statsurl-listing');
if(acymailing_isAllowed($config->get('acl_cpanel_manage','all'))) $bar->appendButton( 'Link', 'acymailing', JText::_('ACY_CPANEL'), acymailing_completeLink('dashboard') );
$this->assignRef('filters',$filtersType);
$this->assignRef('rows',$rows);
$this->assignRef('pageInfo',$pageInfo);
$this->assignRef('pagination',$pagination);
}
示例10: doexport
//.........这里部分代码省略.........
if (empty($exportLists) && empty($exportUnsubLists) && empty($exportWaitLists)) {
$querySelect = 'SELECT s.`subid`, ' . $selectFields . ' FROM ' . acymailing_table('subscriber') . ' as s';
} else {
$querySelect = 'SELECT DISTINCT s.`subid`, ' . $selectFields . ' FROM ' . acymailing_table('listsub') . ' as a JOIN ' . acymailing_table('subscriber') . ' as s on a.subid = s.subid';
if (!empty($exportLists)) {
$conditions[] = 'a.status = 1 AND a.listid IN (' . implode(',', $exportLists) . ')';
}
if (!empty($exportUnsubLists)) {
$conditions[] = 'a.status = -1 AND a.listid IN (' . implode(',', $exportUnsubLists) . ')';
}
if (!empty($exportWaitLists)) {
$conditions[] = 'a.status = 2 AND a.listid IN (' . implode(',', $exportWaitLists) . ')';
}
if (count($conditions) == 1) {
$where[] = $conditions[0];
} else {
$where[] = '(' . implode(') OR (', $conditions) . ')';
}
}
if (!empty($filtersExport['confirmed'])) {
$where[] = 's.confirmed = 1';
}
if (!empty($filtersExport['registered'])) {
$where[] = 's.userid > 0';
}
if (!empty($filtersExport['enabled'])) {
$where[] = 's.enabled = 1';
}
if (JRequest::getInt('sessionvalues') and !empty($_SESSION['acymailing']['exportusers'])) {
$where[] = 's.subid IN (' . implode(',', $_SESSION['acymailing']['exportusers']) . ')';
}
if (JRequest::getInt('fieldfilters')) {
foreach ($_SESSION['acymailing']['fieldfilter'] as $field => $value) {
$where[] = 's.' . acymailing_secureField($field) . ' LIKE "%' . acymailing_getEscaped($value, true) . '%"';
}
}
$query = $querySelect;
if (!empty($where)) {
$query .= ' WHERE (' . implode(') AND (', $where) . ')';
}
if (JRequest::getInt('sessionquery')) {
$currentSession = JFactory::getSession();
$selectOthers = '';
if (!empty($exportFieldsOthers)) {
foreach ($exportFieldsOthers as $oneField) {
$selectOthers .= ' , ' . $oneField . ' AS ' . str_replace('.', '_', $oneField);
}
}
$query = 'SELECT DISTINCT s.`subid`, ' . $selectFields . $selectOthers . ' ' . $currentSession->get('acyexportquery');
}
$query .= ' ORDER BY s.subid';
$db = JFactory::getDBO();
$encodingClass = acymailing_get('helper.encoding');
$exportHelper = acymailing_get('helper.export');
$fileName = 'export_' . date('Y-m-d');
if (!empty($exportLists)) {
$fileName = '';
$db->setQuery('SELECT name FROM #__acymailing_list WHERE listid IN (' . implode(',', $exportLists) . ')');
$allExportedLists = $db->loadObjectList();
foreach ($allExportedLists as $oneList) {
$fileName .= '__' . $oneList->name;
}
$fileName = trim($fileName, '__');
}
$exportHelper->addHeaders($fileName);
acymailing_displayErrors();
示例11: array
$paramBase = ACYMAILING_COMPONENT . '.' . $this->getName() . $this->getLayout();
$pageInfo->filter->order->value = $app->getUserStateFromRequest($paramBase . ".filter_order", 'filter_order', '', 'cmd');
$pageInfo->filter->order->dir = $app->getUserStateFromRequest($paramBase . ".filter_order_Dir", 'filter_order_Dir', 'desc', 'word');
if (strtolower($pageInfo->filter->order->dir) !== 'desc') {
$pageInfo->filter->order->dir = 'asc';
}
$pageInfo->search = $app->getUserStateFromRequest($paramBase . ".search", 'search', '', 'string');
$pageInfo->search = JString::strtolower(trim($pageInfo->search));
$selectedMail = $app->getUserStateFromRequest($paramBase . "filter_mail", 'filter_mail', 0, 'int');
$selectedUrl = $app->getUserStateFromRequest($paramBase . "filter_url", 'filter_url', 0, 'int');
$pageInfo->limit->value = $app->getUserStateFromRequest($paramBase . '.list_limit', 'limit', $app->getCfg('list_limit'), 'int');
$pageInfo->limit->start = $app->getUserStateFromRequest($paramBase . '.limitstart', 'limitstart', 0, 'int');
$database = JFactory::getDBO();
$filters = array();
if (!empty($pageInfo->search)) {
$searchVal = '\'%' . acymailing_getEscaped($pageInfo->search, true) . '%\'';
$filters[] = implode(" LIKE {$searchVal} OR ", $this->detailSearchFields) . " LIKE {$searchVal}";
}
if (!empty($selectedMail)) {
$filters[] = 'a.mailid = ' . $selectedMail;
}
if (!empty($selectedUrl)) {
$filters[] = 'a.urlid = ' . $selectedUrl;
}
$query = 'SELECT ' . implode(' , ', $this->detailSelectFields);
$query .= ' FROM ' . acymailing_table('urlclick') . ' as a';
$query .= ' JOIN ' . acymailing_table('mail') . ' as b on a.mailid = b.mailid';
$query .= ' JOIN ' . acymailing_table('url') . ' as c on a.urlid = c.urlid';
$query .= ' JOIN ' . acymailing_table('subscriber') . ' as d on a.subid = d.subid';
if (!empty($filters)) {
$query .= ' WHERE (' . implode(') AND (', $filters) . ')';
示例12: listing
function listing()
{
$app = JFactory::getApplication();
$pageInfo = new stdClass();
$pageInfo->filter = new stdClass();
$pageInfo->filter->order = new stdClass();
$pageInfo->limit = new stdClass();
$pageInfo->elements = new stdClass();
$config = acymailing_config();
$paramBase = ACYMAILING_COMPONENT . '.' . $this->getName() . $this->getLayout();
$pageInfo->filter->order->value = $app->getUserStateFromRequest($paramBase . ".filter_order", 'filter_order', 'a.ordering', 'cmd');
$pageInfo->filter->order->dir = $app->getUserStateFromRequest($paramBase . ".filter_order_Dir", 'filter_order_Dir', 'asc', 'word');
if (strtolower($pageInfo->filter->order->dir) !== 'desc') {
$pageInfo->filter->order->dir = 'asc';
}
$pageInfo->search = $app->getUserStateFromRequest($paramBase . ".search", 'search', '', 'string');
$pageInfo->search = JString::strtolower(trim($pageInfo->search));
$pageInfo->category = $app->getUserStateFromRequest($paramBase . ".category", 'category', '0', 'string');
$pageInfo->limit->value = $app->getUserStateFromRequest($paramBase . '.list_limit', 'limit', $app->getCfg('list_limit'), 'int');
$pageInfo->limit->start = $app->getUserStateFromRequest($paramBase . '.limitstart', 'limitstart', 0, 'int');
$database = JFactory::getDBO();
if (!empty($pageInfo->search)) {
$searchVal = '\'%' . acymailing_getEscaped($pageInfo->search, true) . '%\'';
$this->filters[] = "a.name LIKE {$searchVal} OR a.description LIKE {$searchVal} OR a.tempid LIKE {$searchVal}";
}
if (!empty($pageInfo->category)) {
$this->filters[] = 'a.category LIKE ' . $database->Quote($pageInfo->category);
}
$query = 'SELECT ' . implode(',', $this->selection) . ' FROM ' . acymailing_table('template') . ' as a';
if (!empty($this->filters)) {
$query .= ' WHERE (' . implode(') AND (', $this->filters) . ')';
}
if (!empty($pageInfo->filter->order->value)) {
$query .= ' ORDER BY ' . $pageInfo->filter->order->value . ' ' . $pageInfo->filter->order->dir;
}
$database->setQuery($query, $pageInfo->limit->start, $pageInfo->limit->value);
try {
$this->rows = $database->loadObjectList();
} catch (Exception $e) {
$this->rows = null;
}
if ($this->rows === null) {
acymailing_display(isset($e) ? $e->getMessage() : substr(strip_tags($database->getErrorMsg()), 0, 200) . '...', 'error');
if (file_exists(ACYMAILING_BACK . 'install.acymailing.php')) {
include_once ACYMAILING_BACK . 'install.acymailing.php';
$installClass = new acymailingInstall();
$installClass->fromVersion = '4.1.0';
$installClass->update = true;
$installClass->updateSQL();
}
}
$queryCount = 'SELECT COUNT(a.tempid) FROM ' . acymailing_table('template') . ' as a';
if (!empty($this->filters)) {
$queryCount .= ' WHERE (' . implode(') AND (', $this->filters) . ')';
}
$database->setQuery($queryCount);
$pageInfo->elements->total = $database->loadResult();
$pageInfo->elements->page = count($this->rows);
jimport('joomla.html.pagination');
$pagination = new JPagination($pageInfo->elements->total, $pageInfo->limit->start, $pageInfo->limit->value);
if ($this->button) {
acymailing_setTitle(JText::_('ACY_TEMPLATES'), 'acytemplate', 'template');
$bar = JToolBar::getInstance('toolbar');
$bar->appendButton('Acypopup', 'import', JText::_('IMPORT'), "index.php?option=com_acymailing&ctrl=template&task=upload&tmpl=component");
JToolBarHelper::custom('export', 'acyexport', 'acyexport', JText::_('ACY_EXPORT'));
JToolBarHelper::divider();
JToolBarHelper::addNew();
JToolBarHelper::editList();
if (acymailing_isAllowed($config->get('acl_templates_delete', 'all'))) {
JToolBarHelper::deleteList(JText::_('ACY_VALIDDELETEITEMS', true));
}
if (acymailing_isAllowed($config->get('acl_templates_copy', 'all'))) {
JToolBarHelper::spacer();
JToolBarHelper::custom('copy', 'copy.png', 'copy.png', JText::_('ACY_COPY'));
}
JToolBarHelper::divider();
$bar->appendButton('Pophelp', 'template-listing');
if (acymailing_isAllowed($config->get('acl_cpanel_manage', 'all'))) {
$bar->appendButton('Link', 'acymailing', JText::_('ACY_CPANEL'), acymailing_completeLink('dashboard'));
}
}
$toggleClass = acymailing_get('helper.toggle');
$order = new stdClass();
$order->ordering = false;
$order->orderUp = 'orderup';
$order->orderDown = 'orderdown';
$order->reverse = false;
if ($pageInfo->filter->order->value == 'a.ordering') {
$order->ordering = true;
if ($pageInfo->filter->order->dir == 'desc') {
$order->orderUp = 'orderdown';
$order->orderDown = 'orderup';
$order->reverse = true;
}
}
$this->assignRef('order', $order);
$this->assignRef('toggleClass', $toggleClass);
$this->assignRef('rows', $this->rows);
$this->assignRef('pageInfo', $pageInfo);
$this->assignRef('pagination', $pagination);
//.........这里部分代码省略.........
示例13: listing
function listing()
{
$app = JFactory::getApplication();
$pageInfo = new stdClass();
$pageInfo->filter = new stdClass();
$pageInfo->filter->order = new stdClass();
$pageInfo->limit = new stdClass();
$pageInfo->elements = new stdClass();
$config = acymailing_config();
JHTML::_('behavior.modal', 'a.modal');
$paramBase = ACYMAILING_COMPONENT . '.' . $this->getName() . $this->getLayout();
$pageInfo->filter->order->value = $app->getUserStateFromRequest($paramBase . ".filter_order", 'filter_order', 'a.senddate', 'cmd');
$pageInfo->filter->order->dir = $app->getUserStateFromRequest($paramBase . ".filter_order_Dir", 'filter_order_Dir', 'desc', 'word');
if (strtolower($pageInfo->filter->order->dir) !== 'desc') {
$pageInfo->filter->order->dir = 'asc';
}
$pageInfo->search = $app->getUserStateFromRequest($paramBase . ".search", 'search', '', 'string');
$pageInfo->search = JString::strtolower(trim($pageInfo->search));
$pageInfo->limit->value = $app->getUserStateFromRequest($paramBase . '.list_limit', 'limit', $app->getCfg('list_limit'), 'int');
$pageInfo->limit->start = $app->getUserStateFromRequest($paramBase . '.limitstart', 'limitstart', 0, 'int');
$database = JFactory::getDBO();
$filters = array();
if (!empty($pageInfo->search)) {
$searchVal = '\'%' . acymailing_getEscaped($pageInfo->search, true) . '%\'';
$filters[] = implode(" LIKE {$searchVal} OR ", $this->searchFields) . " LIKE {$searchVal}";
}
$listClass = acymailing_get('class.list');
$lists = $listClass->getLists();
$msgType = array();
$msgType[] = JHTML::_('select.option', '0', JText::_('ALL_EMAILS'));
$msgType[] = JHTML::_('select.option', '<OPTGROUP>', JText::_('NEWSLETTER'));
$msgType[] = JHTML::_('select.option', 'news', JText::_('ALL_LISTS'));
foreach ($lists as $oneList) {
$msgType[] = JHTML::_('select.option', 'list_' . $oneList->listid, $oneList->name);
}
$msgType[] = JHTML::_('select.option', '</OPTGROUP>');
$msgType[] = JHTML::_('select.option', 'notification', JText::_('NOTIFICATIONS'));
if (acymailing_level(1)) {
$msgType[] = JHTML::_('select.option', 'autonews', JText::_('AUTONEW'));
$msgType[] = JHTML::_('select.option', 'joomlanotification', JText::_('JOOMLA_NOTIFICATIONS'));
}
if (acymailing_level(3)) {
$listCampaign = acymailing_get('class.list');
$listCampaign->type = 'campaign';
$campaigns = $listCampaign->getLists();
$msgType[] = JHTML::_('select.option', '<OPTGROUP>', JText::_('FOLLOWUP'));
$msgType[] = JHTML::_('select.option', 'followup', JText::_('ACY_ALL_CAMPAIGNS'));
foreach ($campaigns as $oneCamp) {
$msgType[] = JHTML::_('select.option', 'camp_' . $oneCamp->listid, $oneCamp->name);
}
$msgType[] = JHTML::_('select.option', '</OPTGROUP>');
}
$msgType[] = JHTML::_('select.option', 'welcome', JText::_('MSG_WELCOME'));
$msgType[] = JHTML::_('select.option', 'unsub', JText::_('MSG_UNSUB'));
$selectedMsgType = $app->getUserStateFromRequest($paramBase . "filter_msg", 'filter_msg', 0, 'string');
$msgTypeChoice = JHTML::_('select.genericlist', $msgType, "filter_msg", 'class="inputbox" style="max-width: 200px;" onchange="document.adminForm.limitstart.value=0;document.adminForm.submit( );"', 'value', 'text', $selectedMsgType);
$extraJoin = '';
if (!empty($selectedMsgType)) {
$subfilter = substr($selectedMsgType, 0, 5);
if ($subfilter == 'camp_' || $subfilter == 'list_') {
$filters[] = " b.type = '" . ($subfilter == 'camp_' ? 'followup' : 'news') . "'";
$filters[] = " lm.listid = " . substr($selectedMsgType, 5);
$extraJoin = " JOIN #__acymailing_listmail AS lm ON a.mailid = lm.mailid";
} else {
$filters[] = " b.type = '" . $selectedMsgType . "'";
}
}
$query = 'SELECT ' . implode(' , ', $this->selectFields);
$query .= ', CASE WHEN (a.senthtml+a.senttext) <= a.bounceunique THEN 0 ELSE (a.openunique/(a.senthtml+a.senttext-a.bounceunique)) END AS openprct';
$query .= ', CASE WHEN (a.senthtml+a.senttext) <= a.bounceunique THEN 0 ELSE (a.clickunique/(a.senthtml+a.senttext-a.bounceunique)) END AS clickprct';
$query .= ', CASE WHEN a.openunique = 0 THEN 0 ELSE (a.clickunique/a.openunique) END AS efficiencyprct';
$query .= ', CASE WHEN (a.senthtml+a.senttext) <= a.bounceunique THEN 0 ELSE (a.unsub/(a.senthtml+a.senttext-a.bounceunique)) END AS unsubprct';
$query .= ', (a.senthtml+a.senttext) as totalsent';
$query .= ', CASE WHEN (a.senthtml+a.senttext) = 0 THEN 0 ELSE (a.bounceunique/(a.senthtml+a.senttext)) END AS bounceprct';
$query .= ' FROM ' . acymailing_table('stats') . ' as a';
$query .= ' JOIN ' . acymailing_table('mail') . ' as b on a.mailid = b.mailid';
if (!empty($extraJoin)) {
$query .= $extraJoin;
}
if (!empty($filters)) {
$query .= ' WHERE (' . implode(') AND (', $filters) . ')';
}
if (!empty($pageInfo->filter->order->value)) {
$query .= ' ORDER BY ' . $pageInfo->filter->order->value . ' ' . $pageInfo->filter->order->dir;
}
$database->setQuery($query, $pageInfo->limit->start, $pageInfo->limit->value);
$rows = $database->loadObjectList();
if ($rows === null) {
acymailing_display(substr(strip_tags($database->getErrorMsg()), 0, 200) . '...', 'error');
if (file_exists(ACYMAILING_BACK . 'install.acymailing.php')) {
include_once ACYMAILING_BACK . 'install.acymailing.php';
$installClass = new acymailingInstall();
$installClass->fromVersion = '3.6.0';
$installClass->update = true;
$installClass->updateSQL();
}
}
$queryCount = 'SELECT COUNT(a.mailid) FROM ' . acymailing_table('stats') . ' as a';
if (!empty($pageInfo->search) || !empty($filters)) {
$queryCount .= ' JOIN ' . acymailing_table('mail') . ' as b on a.mailid = b.mailid';
//.........这里部分代码省略.........
示例14: acymailinghikashop_show
function acymailinghikashop_show()
{
$config = acymailing_config();
if ($config->get('version') < '4.9.4') {
acymailing_display('Please download and install the latest AcyMailing version otherwise this plugin will NOT work', 'error');
return;
}
if (!$this->loadAcymailing()) {
return 'Please install HikaShop before using the HikaShop tag plugin';
}
$app = JFactory::getApplication();
$contentType = array();
$contentType[] = JHTML::_('select.option', "title", JText::_('TITLE_ONLY'));
$contentType[] = JHTML::_('select.option', "intro", JText::_('INTRO_ONLY'));
$contentType[] = JHTML::_('select.option', "full", JText::_('FULL_TEXT'));
$priceDisplay = array();
$priceDisplay[] = JHTML::_('select.option', "full", JText::_('APPLY_DISCOUNTS'));
$priceDisplay[] = JHTML::_('select.option', "no_discount", JText::_('NO_DISCOUNT'));
$priceDisplay[] = JHTML::_('select.option', "none", JText::_('HIKASHOP_NO'));
$pageInfo = new stdClass();
$pageInfo->filter = new stdClass();
$pageInfo->filter->order = new stdClass();
$pageInfo->limit = new stdClass();
$paramBase = ACYMAILING_COMPONENT . '.hikashop';
$pageInfo->filter->order->value = $app->getUserStateFromRequest($paramBase . ".filter_order", 'filter_order', 'a.product_id', 'cmd');
$pageInfo->filter->order->dir = $app->getUserStateFromRequest($paramBase . ".filter_order_Dir", 'filter_order_Dir', 'desc', 'word');
if (strtolower($pageInfo->filter->order->dir) !== 'desc') {
$pageInfo->filter->order->dir = 'asc';
}
$pageInfo->search = $app->getUserStateFromRequest($paramBase . ".search", 'search', '', 'string');
$pageInfo->search = JString::strtolower(trim($pageInfo->search));
$pageInfo->lang = $app->getUserStateFromRequest($paramBase . ".lang", 'lang', '', 'string');
$pageInfo->contenttype = $app->getUserStateFromRequest($paramBase . ".contenttype", 'contenttype', 'full', 'string');
$pageInfo->pricedisplay = $app->getUserStateFromRequest($paramBase . ".pricedisplay", 'pricedisplay', 'full', 'string');
$pageInfo->limit->value = $app->getUserStateFromRequest($paramBase . '.list_limit', 'limit', $app->getCfg('list_limit'), 'int');
$pageInfo->limit->start = $app->getUserStateFromRequest($paramBase . '.limitstart', 'limitstart', 0, 'int');
if (!empty($pageInfo->search)) {
$searchVal = '\'%' . acymailing_getEscaped($pageInfo->search) . '%\'';
$filters[] = "a.product_id LIKE {$searchVal} OR a.product_description LIKE {$searchVal} OR a.product_name LIKE {$searchVal} OR a.product_code LIKE {$searchVal}";
}
$whereQuery = '';
if (!empty($filters)) {
$whereQuery = ' WHERE (' . implode(') AND (', $filters) . ')';
}
$query = 'SELECT SQL_CALC_FOUND_ROWS a.* FROM ' . acymailing_table('hikashop_product', false) . ' as a';
if (!empty($whereQuery)) {
$query .= $whereQuery;
}
if (!empty($pageInfo->filter->order->value)) {
$query .= ' ORDER BY ' . $pageInfo->filter->order->value . ' ' . $pageInfo->filter->order->dir;
}
$this->db->setQuery($query, $pageInfo->limit->start, $pageInfo->limit->value);
$rows = $this->db->loadObjectList();
if (!empty($pageInfo->search)) {
$rows = acymailing_search($pageInfo->search, $rows);
}
$this->db->setQuery('SELECT FOUND_ROWS()');
$pageInfo->elements = new stdClass();
$pageInfo->elements->total = $this->db->loadResult();
$pageInfo->elements->page = count($rows);
jimport('joomla.html.pagination');
$pagination = new JPagination($pageInfo->elements->total, $pageInfo->limit->start, $pageInfo->limit->value);
$tabs = acymailing_get('helper.acytabs');
echo $tabs->startPane('hikashop_tab');
echo $tabs->startPanel(JText::_('PRODUCTS'), 'hikashop_product');
?>
<script language="javascript" type="text/javascript">
<!--
function updateTagProd(productid){
var tag = '{hikashop_product:'+productid;
for(var i=0; i < document.adminForm.contenttype.length; i++){
if (document.adminForm.contenttype[i].checked){ tag += '|type:'+document.adminForm.contenttype[i].value; }
}
for(i=0; i < document.adminForm.pricedisplay.length; i++){
if (document.adminForm.pricedisplay[i].checked){ tag += '|price:'+document.adminForm.pricedisplay[i].value; }
}
if(window.document.getElementById('jflang') && window.document.getElementById('jflang').value != ''){
tag += '|lang:';
tag += window.document.getElementById('jflang').value;
}
tag += '}';
setTag(tag);
insertTag();
}
//-->
</script>
<table>
<tr>
<td width="100%">
<?php
echo JText::_('JOOMEXT_FILTER');
?>
:
<input type="text" name="search" id="acymailingsearch" value="<?php
echo $pageInfo->search;
?>
" class="text_area" onchange="document.adminForm.submit();" />
<button class="btn" onclick="this.form.submit();"><?php
echo JText::_('JOOMEXT_GO');
?>
//.........这里部分代码省略.........
示例15: delete
function delete($elements)
{
if (!is_array($elements)) {
$elements = array($elements);
}
if (empty($elements)) {
return 0;
}
foreach ($elements as $key => $val) {
$elements[$key] = acymailing_getEscaped($val);
}
$column = is_numeric(reset($elements)) ? $this->pkey : $this->namekey;
if (empty($column) or empty($this->pkey) or empty($this->tables) or empty($elements)) {
return false;
}
$whereIn = ' WHERE ' . $column . ' IN (' . implode(',', $elements) . ')';
$result = true;
foreach ($this->tables as $oneTable) {
$query = 'DELETE FROM ' . acymailing_table($oneTable) . $whereIn;
$this->database->setQuery($query);
$result = $this->database->query() && $result;
}
if (!$result) {
return false;
}
return $this->database->getAffectedRows();
}