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


PHP acymailing_search函数代码示例

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


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

示例1: listing

 function listing()
 {
     $app =& JFactory::getApplication();
     $pageInfo = null;
     $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');
     $pageInfo->search = $app->getUserStateFromRequest($paramBase . ".search", 'search', '', 'string');
     $pageInfo->search = JString::strtolower($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();
     if (!empty($pageInfo->search)) {
         $searchVal = '\'%' . $database->getEscaped($pageInfo->search, true) . '%\'';
         $this->filters[] = "a.name LIKE {$searchVal} OR a.description LIKE {$searchVal} OR a.tempid LIKE {$searchVal}";
     }
     $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);
     $this->rows = $database->loadObjectList();
     $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();
     if (!empty($pageInfo->search)) {
         $rows = acymailing_search($pageInfo->search, $this->rows);
     } else {
         $rows =& $this->rows;
     }
     $pageInfo->elements->page = count($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('Popup', 'upload', JText::_('IMPORT'), "index.php?option=com_acymailing&ctrl=template&task=upload&tmpl=component");
         JToolBarHelper::divider();
         JToolBarHelper::addNew();
         JToolBarHelper::editList();
         if (acymailing_isAllowed($config->get('acl_templates_delete', 'all'))) {
             JToolBarHelper::deleteList(JText::_('ACY_VALIDDELETEITEMS', true));
         }
         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 = null;
     $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', $rows);
     $this->assignRef('pageInfo', $pageInfo);
     $this->assignRef('pagination', $pagination);
 }
开发者ID:andreassetiawanhartanto,项目名称:PDKKI,代码行数:78,代码来源:view.html.php

示例2: 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);
 }
开发者ID:alesconti,项目名称:FF_2015,代码行数:100,代码来源:view.html.php

示例3: search

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

示例4: choose

 function choose()
 {
     $pageInfo = new stdClass();
     $app = JFactory::getApplication();
     $paramBase = ACYMAILING_COMPONENT . '.' . $this->getName() . '_' . $this->getLayout();
     $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($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::getString('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();
     if (!empty($pageInfo->search)) {
         $rows = acymailing_search($pageInfo->search, $rows);
     }
     $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);
 }
开发者ID:freaqzilla,项目名称:joomla-site,代码行数:54,代码来源:view.html.php

示例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.senddate', '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($pageInfo->search);
     $selectedMail = $app->getUserStateFromRequest($paramBase . "filter_mail", 'filter_mail', 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 = ' . intval($selectedMail);
     }
     $query = 'SELECT ' . implode(' , ', $this->selectFields);
     $query .= ' FROM ' . acymailing_table('queue') . ' as a';
     $query .= ' JOIN ' . acymailing_table('subscriber') . ' as b on a.subid = b.subid';
     $query .= ' JOIN ' . acymailing_table('mail') . ' as c on a.mailid = c.mailid';
     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 . ', a.`subid` ASC';
     }
     if (empty($pageInfo->limit->value)) {
         $pageInfo->limit->value = 100;
     }
     $database->setQuery($query, $pageInfo->limit->start, $pageInfo->limit->value);
     $rows = $database->loadObjectList();
     $pageInfo->elements->page = count($rows);
     if ($pageInfo->limit->value > $pageInfo->elements->page) {
         $pageInfo->elements->total = $pageInfo->limit->start + $pageInfo->elements->page;
     } else {
         $queryCount = 'SELECT COUNT(a.mailid) FROM ' . acymailing_table('queue') . ' as a';
         if (!empty($pageInfo->search)) {
             $queryCount .= ' JOIN ' . acymailing_table('subscriber') . ' as b on a.subid = b.subid';
             $queryCount .= ' JOIN ' . acymailing_table('mail') . ' as c on a.mailid = c.mailid';
         }
         if (!empty($filters)) {
             $queryCount .= ' WHERE (' . implode(') AND (', $filters) . ')';
         }
         $database->setQuery($queryCount);
         $pageInfo->elements->total = $database->loadResult();
     }
     if (!empty($pageInfo->search)) {
         $rows = acymailing_search($pageInfo->search, $rows);
     }
     jimport('joomla.html.pagination');
     $pagination = new JPagination($pageInfo->elements->total, $pageInfo->limit->start, $pageInfo->limit->value);
     $mailqueuetype = acymailing_get('type.queuemail');
     $filtersType = new stdClass();
     $filtersType->mail = $mailqueuetype->display('filter_mail', $selectedMail);
     acymailing_setTitle(JText::_('QUEUE'), 'process', 'queue');
     $bar = JToolBar::getInstance('toolbar');
     if (acymailing_isAllowed($config->get('acl_queue_process', 'all'))) {
         $bar->appendButton('Acypopup', 'process', JText::_('PROCESS'), "index.php?option=com_acymailing&ctrl=queue&task=process&tmpl=component&mailid=" . $selectedMail);
     }
     if (!empty($pageInfo->elements->total) and acymailing_isAllowed($config->get('acl_queue_delete', 'all'))) {
         JToolBarHelper::spacer();
         JToolBarHelper::spacer();
         $bar->appendButton('Confirm', JText::sprintf('CONFIRM_DELETE_QUEUE', $pageInfo->elements->total), 'delete', JText::_('ACY_DELETE'), 'remove', false, false);
     }
     JToolBarHelper::divider();
     $bar->appendButton('Pophelp', 'queue-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');
     $this->assignRef('toggleClass', $toggleClass);
     $this->assignRef('filters', $filtersType);
     $this->assignRef('rows', $rows);
     $this->assignRef('pageInfo', $pageInfo);
     $this->assignRef('pagination', $pagination);
 }
开发者ID:juanferden,项目名称:adoperp,代码行数:87,代码来源:view.html.php

示例6: acymailingtagcontent_show

    public function acymailingtagcontent_show()
    {
        $app = JFactory::getApplication();
        $pageInfo = new stdClass();
        $pageInfo->filter = new stdClass();
        $pageInfo->filter->order = new stdClass();
        $pageInfo->limit = new stdClass();
        $pageInfo->elements = new stdClass();
        $my = JFactory::getUser();
        $lang = JFactory::getLanguage();
        $lang->load('com_content', JPATH_SITE);
        $paramBase = ACYMAILING_COMPONENT . '.tagcontent';
        $pageInfo->filter->order->value = $app->getUserStateFromRequest($paramBase . ".filter_order", 'filter_order', 'a.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->filter_cat = $app->getUserStateFromRequest($paramBase . ".filter_cat", 'filter_cat', '', 'int');
        $pageInfo->contenttype = $app->getUserStateFromRequest($paramBase . ".contenttype", 'contenttype', $this->params->get('default_type', 'intro'), 'string');
        $pageInfo->author = $app->getUserStateFromRequest($paramBase . ".author", 'author', $this->params->get('default_author', '0'), 'string');
        $pageInfo->titlelink = $app->getUserStateFromRequest($paramBase . ".titlelink", 'titlelink', $this->params->get('default_titlelink', 'link'), 'string');
        $pageInfo->lang = $app->getUserStateFromRequest($paramBase . ".lang", 'lang', '', 'string');
        $pageInfo->pict = $app->getUserStateFromRequest($paramBase . ".pict", 'pict', $this->params->get('default_pict', 1), 'string');
        $pageInfo->pictheight = $app->getUserStateFromRequest($paramBase . ".pictheight", 'pictheight', $this->params->get('maxheight', 150), 'string');
        $pageInfo->pictwidth = $app->getUserStateFromRequest($paramBase . ".pictwidth", 'pictwidth', $this->params->get('maxwidth', 150), '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');
        $picts = array();
        $picts[] = JHTML::_('select.option', "1", JText::_('JOOMEXT_YES'));
        $pictureHelper = acymailing_get('helper.acypict');
        if ($pictureHelper->available()) {
            $picts[] = JHTML::_('select.option', "resized", JText::_('RESIZED'));
        }
        $picts[] = JHTML::_('select.option', "0", JText::_('JOOMEXT_NO'));
        $contenttype = array();
        $contenttype[] = JHTML::_('select.option', "title", JText::_('TITLE_ONLY'));
        $contenttype[] = JHTML::_('select.option', "intro", JText::_('INTRO_ONLY'));
        $contenttype[] = JHTML::_('select.option', "text", JText::_('FIELD_TEXT'));
        $contenttype[] = JHTML::_('select.option', "full", JText::_('FULL_TEXT'));
        $titlelink = array();
        $titlelink[] = JHTML::_('select.option', "link", JText::_('JOOMEXT_YES'));
        $titlelink[] = JHTML::_('select.option', "0", JText::_('JOOMEXT_NO'));
        $authorname = array();
        $authorname[] = JHTML::_('select.option', "author", JText::_('JOOMEXT_YES'));
        $authorname[] = JHTML::_('select.option', "0", JText::_('JOOMEXT_NO'));
        $searchFields = array('a.id', 'a.title', 'a.alias', 'a.created_by', 'b.name', 'b.username');
        if (!empty($pageInfo->search)) {
            $searchVal = '\'%' . acymailing_getEscaped($pageInfo->search, true) . '%\'';
            $filters[] = implode(" LIKE {$searchVal} OR ", $searchFields) . " LIKE {$searchVal}";
        }
        if (!empty($pageInfo->filter_cat)) {
            $filters[] = "a.catid = " . $pageInfo->filter_cat;
        }
        if ($this->params->get('displayart', 'all') == 'onlypub') {
            $filters[] = "a.state = 1";
        } else {
            $filters[] = "a.state != -2";
        }
        if (!$app->isAdmin()) {
            if (!ACYMAILING_J16) {
                $filters[] = 'a.`access` <= ' . (int) $my->get('aid');
            } else {
                $groups = implode(',', $my->getAuthorisedViewLevels());
                $filters[] = 'a.`access` IN (' . $groups . ')';
            }
        }
        if ($this->params->get('frontendaccess') == 'author' && !$app->isAdmin()) {
            $filters[] = "a.created_by = " . intval($my->id);
        }
        $whereQuery = '';
        if (!empty($filters)) {
            $whereQuery = ' WHERE (' . implode(') AND (', $filters) . ')';
        }
        $query = 'SELECT SQL_CALC_FOUND_ROWS a.*,b.name,b.username,a.created_by FROM ' . acymailing_table('content', false) . ' as a';
        $query .= ' LEFT JOIN `#__users` AS b ON b.id = a.created_by';
        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->total = $this->db->loadResult();
        $pageInfo->elements->page = count($rows);
        if (!ACYMAILING_J16) {
            $query = 'SELECT a.id, a.id as catid, a.title as category, b.title as section, b.id as secid from #__categories as a ';
            $query .= 'INNER JOIN #__sections as b on a.section = b.id ORDER BY b.ordering,a.ordering';
            $this->db->setQuery($query);
            $categories = $this->db->loadObjectList('id');
            $categoriesValues = array();
            $categoriesValues[] = JHTML::_('select.option', '', JText::_('ACY_ALL'));
            $currentSec = '';
            foreach ($categories as $catid => $oneCategorie) {
//.........这里部分代码省略.........
开发者ID:proyectoseb,项目名称:ShoppyStore,代码行数:101,代码来源:tagcontent.php

示例7: 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');
        ?>
//.........这里部分代码省略.........
开发者ID:q0821,项目名称:esportshop,代码行数:101,代码来源:hikashop.php

示例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();
     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');
     $pageInfo->search = $app->getUserStateFromRequest($paramBase . ".search", 'search', '', 'string');
     $pageInfo->search = JString::strtolower($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}";
     }
     $query = 'SELECT ' . implode(' , ', $this->selectFields);
     $query .= ' FROM ' . acymailing_table('stats') . ' as a';
     $query .= ' JOIN ' . acymailing_table('mail') . ' as b on a.mailid = b.mailid';
     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)) {
         $queryCount .= ' JOIN ' . acymailing_table('mail') . ' as b on a.mailid = b.mailid';
     }
     if (!empty($filters)) {
         $queryCount .= ' WHERE (' . implode(') AND (', $filters) . ')';
     }
     $database->setQuery($queryCount);
     $pageInfo->elements->total = $database->loadResult();
     if (!empty($pageInfo->search)) {
         $rows = acymailing_search($pageInfo->search, $rows);
     }
     $pageInfo->elements->page = count($rows);
     jimport('joomla.html.pagination');
     $pagination = new JPagination($pageInfo->elements->total, $pageInfo->limit->start, $pageInfo->limit->value);
     acymailing_setTitle(JText::_('GLOBAL_STATISTICS'), 'stats', 'stats');
     $bar = JToolBar::getInstance('toolbar');
     JToolBarHelper::custom('exportglobal', 'acyexport', '', JText::_('ACY_EXPORT'), false);
     JToolBarHelper::spacer();
     if (acymailing_isAllowed($config->get('acl_statistics_delete', 'all'))) {
         JToolBarHelper::deleteList(JText::_('ACY_VALIDDELETEITEMS'));
     }
     JToolBarHelper::divider();
     $bar->appendButton('Pophelp', 'stats-listing');
     if (acymailing_isAllowed($config->get('acl_cpanel_manage', 'all'))) {
         $bar->appendButton('Link', 'acymailing', JText::_('ACY_CPANEL'), acymailing_completeLink('dashboard'));
     }
     $this->assignRef('rows', $rows);
     $this->assignRef('pageInfo', $pageInfo);
     $this->assignRef('pagination', $pagination);
 }
开发者ID:freaqzilla,项目名称:joomla-site,代码行数:75,代码来源:view.html.php

示例9: listing


//.........这里部分代码省略.........
        }
        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);
        $this->addFeed();
        $db = JFactory::getDBO();
        $pageInfo->filter->order->value = $app->getUserStateFromRequest($paramBase . ".filter_order", 'filter_order', $access->frontEndManagement ? 'a.mailid' : 'a.senddate', 'cmd');
        $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->frontEndManagement) {
            $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 "" AS body, "" AS altbody, html AS sendHTML, ' . 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();
        }
        if (!empty($my->email)) {
            $userClass = acymailing_get('class.subscriber');
            $receiver = $userClass->get($my->email);
        }
        if (empty($receiver)) {
            $receiver = new stdClass();
            $receiver->name = JText::_('VISITOR');
        }
        JPluginHelper::importPlugin('acymailing');
        $dispatcher = JDispatcher::getInstance();
        foreach ($rows as $mail) {
            if (strpos($mail->subject, "{") !== false) {
                $dispatcher->trigger('acymailing_replacetags', array(&$mail, false));
                $dispatcher->trigger('acymailing_replaceusertags', array(&$mail, &$receiver, false));
            }
        }
        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);
    }
开发者ID:freaqzilla,项目名称:joomla-site,代码行数:101,代码来源:view.html.php

示例10: acymailingtagcontent_show

    function acymailingtagcontent_show()
    {
        $app =& JFactory::getApplication();
        $pageInfo = null;
        $my = JFactory::getUser();
        $paramBase = ACYMAILING_COMPONENT . '.tagcontent';
        $pageInfo->filter->order->value = $app->getUserStateFromRequest($paramBase . ".filter_order", 'filter_order', 'a.id', '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);
        $pageInfo->filter_cat = $app->getUserStateFromRequest($paramBase . ".filter_cat", 'filter_cat', '', 'int');
        $pageInfo->contenttype = $app->getUserStateFromRequest($paramBase . ".contenttype", 'contenttype', $this->params->get('default_type', '|type:intro'), 'string');
        $pageInfo->author = $app->getUserStateFromRequest($paramBase . ".author", 'author', $this->params->get('default_author', ''), 'string');
        $pageInfo->titlelink = $app->getUserStateFromRequest($paramBase . ".titlelink", 'titlelink', $this->params->get('default_titlelink', '|link'), 'string');
        $pageInfo->lang = $app->getUserStateFromRequest($paramBase . ".lang", 'lang', '', 'string');
        $pageInfo->pict = $app->getUserStateFromRequest($paramBase . ".pict", 'pict', $this->params->get('default_pict', 1), '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');
        $picts = array();
        $picts[] = JHTML::_('select.option', "1", JText::_('JOOMEXT_YES'));
        $pictureHelper = acymailing_get('helper.acypict');
        if ($pictureHelper->available()) {
            $picts[] = JHTML::_('select.option', "resized", JText::_('RESIZED'));
        }
        $picts[] = JHTML::_('select.option', "0", JText::_('JOOMEXT_NO'));
        $db =& JFactory::getDBO();
        $searchFields = array('a.id', 'a.title', 'a.alias', 'a.created_by', 'b.name', 'b.username');
        if (!empty($pageInfo->search)) {
            $searchVal = '\'%' . $db->getEscaped($pageInfo->search, true) . '%\'';
            $filters[] = implode(" LIKE {$searchVal} OR ", $searchFields) . " LIKE {$searchVal}";
        }
        if (!empty($pageInfo->filter_cat)) {
            $filters[] = "a.catid = " . $pageInfo->filter_cat;
        }
        if ($this->params->get('displayart', 'all') == 'onlypub') {
            $filters[] = "a.state = 1";
        } else {
            $filters[] = "a.state != -2";
        }
        if (!$app->isAdmin()) {
            if (version_compare(JVERSION, '1.6.0', '<')) {
                $filters[] = 'a.`access` <= ' . (int) $my->get('aid');
            } else {
                $groups = implode(',', $my->authorisedLevels());
                $filters[] = 'a.`access` IN (' . $groups . ')';
            }
        }
        if ($this->params->get('frontendaccess') == 'author' and !$app->isAdmin()) {
            $filters[] = "a.created_by = " . intval($my->id);
        }
        $whereQuery = '';
        if (!empty($filters)) {
            $whereQuery = ' WHERE (' . implode(') AND (', $filters) . ')';
        }
        $query = 'SELECT SQL_CALC_FOUND_ROWS a.id,a.created,a.title,a.alias,a.catid,a.sectionid,b.name,b.username,a.created_by FROM ' . acymailing_table('content', false) . ' as a';
        $query .= ' LEFT JOIN `#__users` AS b ON b.id = a.created_by';
        if (!empty($whereQuery)) {
            $query .= $whereQuery;
        }
        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();
        if (!empty($pageInfo->search)) {
            $rows = acymailing_search($pageInfo->search, $rows);
        }
        $db->setQuery('SELECT FOUND_ROWS()');
        $pageInfo->elements->total = $db->loadResult();
        $pageInfo->elements->page = count($rows);
        if (version_compare(JVERSION, '1.6.0', '<')) {
            $query = 'SELECT a.id, a.id as catid, a.title as category, b.title as section, b.id as secid from #__categories as a ';
            $query .= 'INNER JOIN #__sections as b on a.section = b.id ORDER BY b.ordering,a.ordering';
            $db->setQuery($query);
            $categories = $db->loadObjectList('id');
            $categoriesValues = array();
            $categoriesValues[] = JHTML::_('select.option', '', JText::_('ACY_ALL'));
            $currentSec = '';
            foreach ($categories as $catid => $oneCategorie) {
                if ($currentSec != $oneCategorie->section) {
                    if (!empty($currentSec)) {
                        $this->values[] = JHTML::_('select.option', '</OPTGROUP>');
                    }
                    $categoriesValues[] = JHTML::_('select.option', '<OPTGROUP>', $oneCategorie->section);
                    $currentSec = $oneCategorie->section;
                }
                $categoriesValues[] = JHTML::_('select.option', $catid, $oneCategorie->category);
            }
        } else {
            $query = "SELECT * from #__categories WHERE `extension` = 'com_content' ORDER BY lft ASC";
            $db->setQuery($query);
            $categories = $db->loadObjectList('id');
            $categoriesValues = array();
            $categoriesValues[] = JHTML::_('select.option', '', JText::_('ACY_ALL'));
            foreach ($categories as $catid => $oneCategorie) {
                $categories[$catid]->title = str_repeat('- - ', $categories[$catid]->level) . $categories[$catid]->title;
                $categoriesValues[] = JHTML::_('select.option', $catid, $categories[$catid]->title);
            }
        }
        jimport('joomla.html.pagination');
//.........这里部分代码省略.........
开发者ID:andreassetiawanhartanto,项目名称:PDKKI,代码行数:101,代码来源:tagcontent.php

示例11: acymailingzoomailing_show

    function acymailingzoomailing_show()
    {
        $app = JFactory::getApplication();
        $pageInfo = new stdClass();
        $pageInfo->filter = new stdClass();
        $pageInfo->filter->order = new stdClass();
        $pageInfo->limit = new stdClass();
        $pageInfo->elements = new stdClass();
        $paramBase = ACYMAILING_COMPONENT . '.zoomailing';
        $pageInfo->filter->order->value = $app->getUserStateFromRequest($paramBase . ".filter_order", 'filter_order', 'a.id', '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);
        $pageInfo->filter_app = $app->getUserStateFromRequest($paramBase . ".filter_app", 'filter_app', '', 'int');
        if (!$pageInfo->filter_app) {
            $pageInfo->filter_app = $this->app->zm->firstApplication();
        }
        $pageInfo->filter_reset = JRequest::getInt('filter_reset');
        if ($pageInfo->filter_reset != 1) {
            $pageInfo->filter_type = $app->getUserStateFromRequest($paramBase . ".filter_type", 'filter_type', '', 'array');
            $pageInfo->filter_cat = $app->getUserStateFromRequest($paramBase . ".filter_cat", 'filter_cat', '', 'array');
            $pageInfo->filter_tag = $app->getUserStateFromRequest($paramBase . ".filter_tag", 'filter_tag', '', 'array');
        } else {
            $app->setUserState($paramBase . ".filter_type", null);
            $app->setUserState($paramBase . ".filter_cat", null);
            $app->setUserState($paramBase . ".filter_tag", null);
            $pageInfo->filter_type = null;
            $pageInfo->filter_cat = null;
            $pageInfo->filter_tag = null;
        }
        $pageInfo->lang = $app->getUserStateFromRequest($paramBase . ".lang", 'lang', '', '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');
        $db = JFactory::getDBO();
        $filters[] = "a.application_id = " . $pageInfo->filter_app;
        $searchFields = array('a.id', 'a.name', 'a.alias', 'u.name', 'u.username');
        if (!empty($pageInfo->search)) {
            $searchVal = '\'%' . $db->getEscaped($pageInfo->search, true) . '%\'';
            $filters[] = implode(" LIKE {$searchVal} OR ", $searchFields) . " LIKE {$searchVal}";
        }
        if (!is_array($pageInfo->filter_type)) {
            $pageInfo->filter_type = array();
        }
        if (count($pageInfo->filter_type) > 0) {
            unset($pageInfo->filter_type[0]);
        }
        if (!empty($pageInfo->filter_type)) {
            $filters[] = "a.type IN('" . implode("','", $pageInfo->filter_type) . "')";
        }
        if (!is_array($pageInfo->filter_cat)) {
            $pageInfo->filter_cat = array();
        }
        if (count($pageInfo->filter_cat) > 0) {
            unset($pageInfo->filter_cat[0]);
        }
        if (!empty($pageInfo->filter_cat)) {
            $filters[] = "c.category_id IN(" . implode(',', $pageInfo->filter_cat) . ")";
        }
        if (!is_array($pageInfo->filter_tag)) {
            $pageInfo->filter_tag = array();
        }
        if (count($pageInfo->filter_tag) > 0) {
            unset($pageInfo->filter_tag[0]);
        }
        if (!empty($pageInfo->filter_tag)) {
            $filters[] = "t.name IN('" . implode("','", $pageInfo->filter_tag) . "')";
        }
        if ($this->params->get('displayzoo', 'all') == 'onlypub') {
            $filters[] = "a.state = 1";
        }
        $whereQuery = '';
        if (!empty($filters)) {
            $whereQuery = ' WHERE(' . implode(') AND(', $filters) . ')';
        }
        $query = 'SELECT SQL_CALC_FOUND_ROWS a.id, a.name, a.alias, a.created_by, u.name AS author, u.username
		FROM ' . acymailing_table('zoo_item', false) . ' as a';
        $query .= ' LEFT JOIN `' . acymailing_table('zoo_category_item', false) . '` AS c ON c.item_id = a.id';
        $query .= ' LEFT JOIN `' . acymailing_table('zoo_tag', false) . '` AS t ON t.item_id = a.id';
        $query .= ' LEFT JOIN `#__users` AS u ON u.id = a.created_by';
        if (!empty($whereQuery)) {
            $query .= $whereQuery;
        }
        $query .= ' GROUP BY a.id';
        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();
        if (!empty($pageInfo->search)) {
            $rows = acymailing_search($pageInfo->search, $rows);
        }
        $db->setQuery('SELECT FOUND_ROWS()');
        $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);
        ?>
		<table class="adminform" width="100%">
			<tr>
				<td>Application : <?php 
//.........这里部分代码省略.........
开发者ID:unrealprojects,项目名称:journal,代码行数:101,代码来源:zoomailing.php

示例12: listing


//.........这里部分代码省略.........
            if (empty($my->id)) {
                $uri = JFactory::getURI();
                $url = 'index.php?option=com_user&view=login';
                $url .= '&return=' . base64_encode($uri->toString());
                $app->redirect($url, JText::_('ACY_NOTALLOWED'));
                return false;
            } else {
                $app->enqueueMessage(JText::_('ACY_NOTALLOWED'), 'error');
                $app->redirect(acymailing_completeLink('lists', false, true));
                return false;
            }
        }
        if ($config->get('open_popup')) {
            JHTML::_('behavior.modal', 'a.modal');
        }
        if (!empty($menuparams)) {
            $values->suffix = $menuparams->get('pageclass_sfx', '');
            $values->page_title = $menuparams->get('page_title');
            $values->show_page_title = $menuparams->get('show_page_title', 1);
        } else {
            $values->suffix = '';
            $values->show_page_title = 1;
        }
        $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->filter = $config->get('show_filter', 1);
        if (empty($values->page_title)) {
            $values->page_title = $oneList->name;
        }
        if (empty($menuparams)) {
            $pathway->addItem(JText::_('MAILING_LISTS'), acymailing_completeLink('lists'));
            $pathway->addItem($values->page_title);
        } else {
            $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 = '\'%' . $db->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 .= ' LEFT 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 .= ' LEFT 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 );
	}';
        $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);
    }
开发者ID:andreassetiawanhartanto,项目名称:PDKKI,代码行数:101,代码来源:view.html.php


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