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


PHP acymailing::search方法代码示例

本文整理汇总了PHP中acymailing::search方法的典型用法代码示例。如果您正苦于以下问题:PHP acymailing::search方法的具体用法?PHP acymailing::search怎么用?PHP acymailing::search使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在acymailing的用法示例。


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

示例1: listing

 function listing()
 {
     $app =& JFactory::getApplication();
     $pageInfo = null;
     $paramBase = ACYMAILING_COMPONENT . '.' . $this->getName();
     $pageInfo->filter->order->value = $app->getUserStateFromRequest($paramBase . ".filter_order", 'filter_order', 'a.listid', '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);
     $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();
     $filters = array();
     if (!empty($pageInfo->search)) {
         $searchVal = '\'%' . $database->getEscaped($pageInfo->search) . '%\'';
         $filters[] = "a.name LIKE {$searchVal} OR a.description LIKE {$searchVal} OR a.listid LIKE {$searchVal}";
     }
     $filters[] = 'a.type = \'campaign\'';
     if (!empty($selectedCreator)) {
         $filters[] = 'a.userid = ' . $selectedCreator;
     }
     $query = 'SELECT SQL_CALC_FOUND_ROWS a.*, d.name as creatorname, d.username, d.email';
     $query .= ' FROM ' . acymailing::table('list') . ' as a';
     $query .= ' LEFT JOIN ' . acymailing::table('users', false) . ' as d on a.userid = d.id';
     $query .= ' WHERE (' . implode(') AND (', $filters) . ') ';
     $query .= ' GROUP BY a.listid';
     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();
     if (!empty($pageInfo->search)) {
         $rows = acymailing::search($pageInfo->search, $rows);
     }
     $pageInfo->elements->page = count($rows);
     $followupClass = acymailing::get('class.listmail');
     if (!empty($rows)) {
         foreach ($rows as $id => $onerow) {
             $rows[$id]->followup = $followupClass->getFollowup($onerow->listid);
         }
     }
     jimport('joomla.html.pagination');
     $pagination = new JPagination($pageInfo->elements->total, $pageInfo->limit->start, $pageInfo->limit->value);
     acymailing::setTitle(JText::_('CAMPAIGN'), 'campaign', 'campaign');
     JToolBarHelper::addNew();
     JToolBarHelper::editList();
     JToolBarHelper::deleteList(JText::_('VALIDDELETEITEMS', true));
     JToolBarHelper::divider();
     $bar =& JToolBar::getInstance('toolbar');
     $bar->appendButton('Pophelp', 'campaign-listing');
     $bar->appendButton('Link', 'acymailing', JText::_('JOOMEXT_CPANEL'), acymailing::completeLink('dashboard'));
     $this->assignRef('rows', $rows);
     $this->assignRef('pageInfo', $pageInfo);
     $this->assignRef('pagination', $pagination);
     $this->assignRef('toggleClass', acymailing::get('helper.toggle'));
     $this->assignRef('delay', acymailing::get('type.delaydisp'));
 }
开发者ID:rlee1962,项目名称:diylegalcenter,代码行数:60,代码来源:view.html.php

示例2: search

 function search($searchString, $object)
 {
     if (empty($object) or is_numeric($object)) {
         return $object;
     }
     if (is_string($object) or is_numeric($object)) {
         return preg_replace('#(' . str_replace('#', '\\#', $searchString) . ')#i', '<span class="searchtext">$1</span>', $object);
     }
     if (is_array($object)) {
         foreach ($object as $key => $element) {
             $object[$key] = acymailing::search($searchString, $element);
         }
     } elseif (is_object($object)) {
         foreach ($object as $key => $element) {
             $object->{$key} = acymailing::search($searchString, $element);
         }
     }
     return $object;
 }
开发者ID:rlee1962,项目名称:diylegalcenter,代码行数:19,代码来源:helper.php

示例3: acymailinghikaserial_show

    function acymailinghikaserial_show()
    {
        if (!$this->init()) {
            return 'Please install HikaSerial before using the HikaSerial tag plugin';
        }
        $app = JFactory::getApplication();
        $contentType = array();
        $pageInfo = new stdClass();
        $paramBase = ACYMAILING_COMPONENT . '.hikaserial';
        $pageInfo->filter->order->value = $app->getUserStateFromRequest($paramBase . ".filter_order", 'filter_order', 'a.pack_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->lang = $app->getUserStateFromRequest($paramBase . ".lang", 'lang', '', 'string');
        $pageInfo->contenttype = $app->getUserStateFromRequest($paramBase . ".contenttype", 'contenttype', '|type: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');
        $db = JFactory::getDBO();
        if (!empty($pageInfo->search)) {
            $searchVal = '\'%' . $db->getEscaped($pageInfo->search) . '%\'';
            $filters[] = 'a.pack_id LIKE ' . $searchVal . ' OR a.pack_name LIKE ' . $searchVal . ' OR a.pack_description LIKE ' . $searchVal;
        }
        $whereQuery = '';
        if (!empty($filters)) {
            $whereQuery = ' WHERE (' . implode(') AND (', $filters) . ')';
        }
        $query = 'SELECT SQL_CALC_FOUND_ROWS a.* FROM ' . acymailing::table('hikaserial_pack', 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;
        }
        $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);
        ?>
	<script language="javascript" type="text/javascript">
	<!--
	function updateTagProd(packid){
		tag = '{hikaserial_genpack:'+packid;
		for(var i=0; i < document.adminForm.contenttype.length; i++){
			 if (document.adminForm.contenttype[i].checked){ tag += document.adminForm.contenttype[i].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');
        ?>
</button>
				<button class="btn" onclick="document.getElementById('acymailingsearch').value='';this.form.submit();"><?php 
        echo JText::_('JOOMEXT_RESET');
        ?>
</button>
			</td>
		</tr>
	</table>
<?php 
        ?>
	<table class="adminlist table table-striped" cellpadding="1" width="100%">
		<thead>
			<tr>
				<th class="title"><?php 
        echo JHTML::_('grid.sort', JText::_('HIKA_NAME'), 'a.pack_name', $pageInfo->filter->order->dir, $pageInfo->filter->order->value);
        ?>
</th>
				<th class="title titleid"><?php 
        echo JHTML::_('grid.sort', JText::_('ID'), 'a.pack_id', $pageInfo->filter->order->dir, $pageInfo->filter->order->value);
        ?>
</th>
			</tr>
		</thead>
		<tfoot>
			<tr>
				<td colspan="3">
					<?php 
        echo $pagination->getListFooter();
        ?>
//.........这里部分代码省略.........
开发者ID:q0821,项目名称:esportshop,代码行数:101,代码来源:hikaserial.php

示例4: choose

 function choose()
 {
     $pageInfo = null;
     $app =& JFactory::getApplication();
     $paramBase = ACYMAILING_COMPONENT . '.' . $this->getName() . '_' . $this->getLayout();
     $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');
     $db =& JFactory::getDBO();
     $filters = array();
     if (!empty($pageInfo->search)) {
         $searchVal = '\'%' . $db->getEscaped($pageInfo->search, true) . '%\'';
         $filters[] = implode(" LIKE {$searchVal} OR ", $this->searchFieldsChoose) . " LIKE {$searchVal}";
     }
     $query = 'SELECT SQL_CALC_FOUND_ROWS ' . implode(',', $this->selectedFieldsChoose) . ' FROM #__users as a';
     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);
     $db->setQuery($query, $pageInfo->limit->start, $pageInfo->limit->value);
     $rows = $db->loadObjectList();
     $db->setQuery('SELECT FOUND_ROWS()');
     $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:rlee1962,项目名称:diylegalcenter,代码行数:39,代码来源:view.html.php

示例5: acymailingtagvmproduct_show

    function acymailingtagvmproduct_show()
    {
        $app =& JFactory::getApplication();
        $contentType = array();
        $contentType[] = JHTML::_('select.option', "|type:title", JText::_('TITLE_ONLY'));
        $contentType[] = JHTML::_('select.option', "|type:intro", JText::_('INTRO_ONLY'));
        $contentType[] = JHTML::_('select.option', "|type:full", JText::_('FULL_TEXT'));
        $pageInfo = null;
        $paramBase = ACYMAILING_COMPONENT . '.tagvmproduct';
        $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');
        $pageInfo->search = $app->getUserStateFromRequest($paramBase . ".search", 'search', '', 'string');
        $pageInfo->search = JString::strtolower($pageInfo->search);
        $pageInfo->lang = $app->getUserStateFromRequest($paramBase . ".lang", 'lang', '', 'string');
        $pageInfo->contenttype = $app->getUserStateFromRequest($paramBase . ".contenttype", 'contenttype', '|type: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');
        $db =& JFactory::getDBO();
        if (!empty($pageInfo->search)) {
            $searchVal = '\'%' . $db->getEscaped($pageInfo->search) . '%\'';
            $filters[] = "a.product_id LIKE {$searchVal} OR a.product_s_desc LIKE {$searchVal} OR a.product_name LIKE {$searchVal} OR a.product_sku LIKE {$searchVal}";
        }
        $whereQuery = '';
        if (!empty($filters)) {
            $whereQuery = ' WHERE (' . implode(') AND (', $filters) . ')';
        }
        $query = 'SELECT SQL_CALC_FOUND_ROWS a.product_id,a.product_s_desc,a.product_sku,a.product_name FROM ' . acymailing::table('vm_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;
        }
        $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);
        jimport('joomla.html.pane');
        $tabs =& JPane::getInstance('tabs');
        echo $tabs->startPane('vmproduct_tab');
        echo $tabs->startPanel(JText::_('VM_PRODUCT'), 'vm_product');
        ?>

			<script language="javascript" type="text/javascript">
		<!--
			function updateTag(productid){
				tag = '{vmproduct:'+productid;
				for(var i=0; i < document.adminForm.contenttype.length; i++){
				   if (document.adminForm.contenttype[i].checked){ tag += document.adminForm.contenttype[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 onclick="this.form.submit();"><?php 
        echo JText::_('JOOMEXT_GO');
        ?>
</button>
					<button onclick="document.getElementById('acymailingsearch').value='';this.form.submit();"><?php 
        echo JText::_('JOOMEXT_RESET');
        ?>
</button>
				</td>
			</tr>
		</table>
		<table width="100%" class="adminform">
			<tr>
				<td>
					<?php 
        echo JText::_('DISPLAY');
        ?>

				</td>
				<td colspan="2">
				<?php 
        echo JHTML::_('select.radiolist', $contentType, 'contenttype', 'size="1"', 'value', 'text', $pageInfo->contenttype);
        ?>
//.........这里部分代码省略.........
开发者ID:rlee1962,项目名称:diylegalcenter,代码行数:101,代码来源:tagvmproduct.php

示例6: listing

    function listing()
    {
        global $Itemid;
        $app =& JFactory::getApplication();
        $my =& JFactory::getUser();
        $pathway =& $app->getPathway();
        $values = null;
        $menus =& JSite::getMenu();
        $menu = $menus->getActive();
        if (empty($menu) and !empty($Itemid)) {
            $menus->setActive($Itemid);
            $menu = $menus->getItem($Itemid);
        }
        if (is_object($menu)) {
            $menuparams = new JParameter($menu->params);
        }
        $pageInfo = null;
        $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', '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 = JRequest::getInt('limitstart', 0);
        $listClass = acymailing::get('class.list');
        $listid = acymailing::getCID('listid');
        if (empty($listid) and !empty($menuparams)) {
            $listid = $menuparams->get('listid');
        }
        if (empty($listid)) {
            return JError::raiseError(404, 'Mailing List not found');
        }
        $oneList = $listClass->get($listid);
        if (empty($oneList->listid)) {
            return JError::raiseError(404, 'Mailing List not found : ' . $listid);
        }
        $access = null;
        $access->frontEndManament = false;
        $access->frontEndAccess = true;
        if (acymailing::level(3)) {
            if (!empty($my->id) and (int) $my->id == (int) $oneList->userid) {
                $access->frontEndManament = true;
            }
            if (!empty($my->gid) and !empty($my->id)) {
                if ($oneList->access_manage == 'all' or in_array($my->gid, explode(',', $oneList->access_manage))) {
                    $access->frontEndManament = true;
                }
            }
            if ($oneList->access_sub != 'all' and ($oneList->access_sub == 'none' or empty($my->gid) or empty($my->id) or !in_array($my->gid, explode(',', $oneList->access_sub)))) {
                $access->frontEndAccess = false;
            }
            if ($access->frontEndManament) {
                JHTML::_('behavior.modal', 'a.modal');
            }
        }
        if (!$access->frontEndManament and (!$oneList->published or !$oneList->visible or !$access->frontEndAccess)) {
            return JError::raiseError(404, 'Mailing List not accessible : ' . $listid);
        }
        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;
        }
        $config = acymailing::config();
        $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);
        $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.visible', 'a.published', 'a.fromname', 'a.fromemail', 'a.replyname', 'a.replyemail', 'a.userid'));
        $query = 'SELECT SQL_CALC_FOUND_ROWS ' . 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) . ')';
//.........这里部分代码省略.........
开发者ID:rlee1962,项目名称:diylegalcenter,代码行数:101,代码来源:view.html.php

示例7: 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', '|type:intro', 'string');
        $pageInfo->author = $app->getUserStateFromRequest($paramBase . ".author", 'author', '', 'string');
        $pageInfo->titlelink = $app->getUserStateFromRequest($paramBase . ".titlelink", 'titlelink', '|link', 'string');
        $pageInfo->lang = $app->getUserStateFromRequest($paramBase . ".lang", 'lang', '', 'string');
        $pageInfo->pict = $app->getUserStateFromRequest($paramBase . ".pict", '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 (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');
        $pagination = new JPagination($pageInfo->elements->total, $pageInfo->limit->start, $pageInfo->limit->value);
        jimport('joomla.html.pane');
//.........这里部分代码省略.........
开发者ID:bizanto,项目名称:Hooked,代码行数:101,代码来源:tagcontent.php

示例8: 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:bizanto,项目名称:Hooked,代码行数:78,代码来源:view.html.php

示例9: implode

}
$query = 'SELECT SQL_CALC_FOUND_ROWS ' . implode(' , ', $this->detailSelectFields);
$query .= ' FROM ' . acymailing::table('urlclick') . ' as a';
$query .= ' LEFT JOIN ' . acymailing::table('mail') . ' as b on a.mailid = b.mailid';
$query .= ' LEFT JOIN ' . acymailing::table('url') . ' as c on a.urlid = c.urlid';
$query .= ' LEFT JOIN ' . acymailing::table('subscriber') . ' as d on a.subid = d.subid';
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();
$database->setQuery('SELECT FOUND_ROWS()');
$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);
$filtersType = null;
$mailType = acymailing::get('type.urlmail');
$urlType = acymailing::get('type.url');
$filtersType->mail = $mailType->display('filter_mail', $selectedMail);
$filtersType->url = $urlType->display('filter_url', $selectedUrl);
$this->assignRef('filters', $filtersType);
$this->assignRef('rows', $rows);
$this->assignRef('pageInfo', $pageInfo);
$this->assignRef('pagination', $pagination);
开发者ID:rlee1962,项目名称:diylegalcenter,代码行数:31,代码来源:view.detaillisting.php


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