本文整理汇总了PHP中CriteriaCompo::setStart方法的典型用法代码示例。如果您正苦于以下问题:PHP CriteriaCompo::setStart方法的具体用法?PHP CriteriaCompo::setStart怎么用?PHP CriteriaCompo::setStart使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CriteriaCompo
的用法示例。
在下文中一共展示了CriteriaCompo::setStart方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: xoopsfaq_search
/**
* xoopsfaq_search()
*
* @param mixed $queryarray
* @param mixed $andor
* @param mixed $limit
* @param mixed $offset
* @param mixed $userid
* @return
*/
function xoopsfaq_search($queryarray, $andor, $limit, $offset, $userid)
{
global $xoopsDB;
$ret = array();
if ($userid != 0) {
return $ret;
}
$xfDir = basename(dirname(dirname(__FILE__)));
$xfContentsHandler =& xoops_getmodulehandler('contents', $xfDir);
$contentFields = array('contents_id', 'contents_cid', 'contents_title', 'contents_contents', 'contents_publish');
$criteria = new CriteriaCompo();
$criteria->add(new Criteria('contents_active', 1, '='));
$criteria->setSort('contents_id');
$criteria->setOrder('DESC');
$criteria->setLimit(intval($limit));
$criteria->setStart(intval($offset));
if (is_array($queryarray) && !empty($queryarray)) {
$criteria->add(new Criteria('contents_title', "%{$queryarray[0]}%", 'LIKE'));
$criteria->add(new Criteria('contents_contents', "%{$queryarray[0]}%", 'LIKE'), 'OR');
array_shift($queryarray);
//get rid of first element
foreach ($queryarray as $query) {
$criteria->add(new Criteria('contents_title', "%{$query}%", 'LIKE'), $andor);
$criteria->add(new Criteria('contents_contents', "%{$query}%", 'LIKE'), 'OR');
}
}
$contentArray = $xfContentsHandler->getAll($criteria, $contentFields, false);
foreach ($contentArray as $content) {
$ret[] = array('image' => 'images/question2.gif', 'link' => "index.php?cat_id=" . $content['contents_cid'] . "#" . $content['contents_id'], 'title' => $content['contents_title'], 'time' => $content['contents_publish']);
}
unset($contentArray);
return $ret;
}
示例2: CriteriaCompo
/**
* @得到列表
* @method:
* @license http://www.blags.org/
* @created:2010年05月23日 14时59分
* @copyright 1997-2010 The Martin Group
* @author Martin <china.codehome@gmail.com>
* */
function &getHotelServiceTypes($limit = 0, $start = 0, $sort = 'service_type_id', $order = 'ASC', $id_as_key = true)
{
$criteria = new CriteriaCompo();
$criteria->setSort($sort);
$criteria->setOrder($order);
$criteria->setStart($start);
$criteria->setLimit($limit);
return $this->getObjects($criteria, $id_as_key);
}
示例3: countRelated
public function countRelated($start = 0, $limit = 0, $sort = 'related_name', $order = 'ASC')
{
$criteria = new CriteriaCompo();
$criteria->setSort($sort);
$criteria->setOrder($order);
$criteria->setStart($start);
$criteria->setLimit($limit);
return parent::getCount();
}
示例4: setContent
function setContent($isreturn = false)
{
global $jieqiTpl;
global $jieqiConfigs;
jieqi_getconfigs('article', 'configs');
$article_static_url = empty($jieqiConfigs['article']['staticurl']) ? $GLOBALS['jieqiModules']['article']['url'] : $jieqiConfigs['article']['staticurl'];
$article_dynamic_url = empty($jieqiConfigs['article']['dynamicurl']) ? $GLOBALS['jieqiModules']['article']['url'] : $jieqiConfigs['article']['dynamicurl'];
$jieqiTpl->assign('article_static_url', $article_static_url);
$jieqiTpl->assign('article_dynamic_url', $article_dynamic_url);
jieqi_includedb();
$query = JieqiQueryHandler::getInstance('JieqiQueryHandler');
$criteria = new CriteriaCompo();
$criteria->setFields("r.*,a.articlename");
$criteria->setTables(jieqi_dbprefix('article_reviews') . " AS r LEFT JOIN " . jieqi_dbprefix('article_article') . " AS a ON r.ownerid=a.articleid");
if ($this->exevars['istop'] == 1) {
$criteria->add(new Criteria('r.istop', '1'));
} elseif ($this->exevars['istop'] == 2) {
$criteria->add(new Criteria('r.istop', '0'));
}
if ($this->exevars['isgood'] == 1) {
$criteria->add(new Criteria('r.isgood', '1'));
} elseif ($this->exevars['isgood'] == 2) {
$criteria->add(new Criteria('r.isgood', '0'));
}
$criteria->setSort('r.topicid');
$criteria->setOrder('DESC');
$criteria->setLimit($this->exevars['listnum']);
$criteria->setStart(0);
$query->queryObjects($criteria);
$reviewrows = array();
$i = 0;
while ($v = $query->getObject()) {
$reviewrows[$i]['reviewtitle'] = jieqi_htmlstr(str_replace(array("\r", "\n"), array('', ' '), $v->getVar('title', 'n')));
$reviewrows[$i]['ownerid'] = $v->getVar('ownerid');
$reviewrows[$i]['articlename'] = $v->getVar('articlename');
$reviewrows[$i]['topicid'] = $v->getVar('topicid');
$reviewrows[$i]['url_review'] = $article_dynamic_url . '/reviews.php?aid=' . $v->getVar('ownerid');
$reviewrows[$i]['poster'] = $v->getVar('poster');
$reviewrows[$i]['posterid'] = $v->getVar('posterid');
$reviewrows[$i]['postdate'] = date('m-d H:i', $v->getVar('posttime'));
$reviewrows[$i]['posttime'] = $v->getVar('posttime');
$reviewrows[$i]['replytime'] = $v->getVar('replytime');
$reviewrows[$i]['views'] = $v->getVar('views');
$reviewrows[$i]['replies'] = $v->getVar('replies');
$reviewrows[$i]['islock'] = $v->getVar('islock');
$reviewrows[$i]['istop'] = $v->getVar('istop');
$reviewrows[$i]['isgood'] = $v->getVar('isgood');
$reviewrows[$i]['topictype'] = $v->getVar('topictype');
$reviewrows[$i]['url_articleinfo'] = jieqi_geturl('article', 'article', $v->getVar('ownerid'), 'info');
$reviewrows[$i]['url_articleindex'] = jieqi_geturl('article', 'article', $v->getVar('ownerid'), 'index');
$reviewrows[$i]['url_articleread'] = $reviewrows[$i]['url_articleindex'];
$i++;
}
$jieqiTpl->assign_by_ref('reviewrows', $reviewrows);
$jieqiTpl->assign('url_more', $article_dynamic_url . '/reviewslist.php');
}
示例5: search
public function search($queries, $andor, $limit, $start, $userid)
{
$xoops = Xoops::getInstance();
$alumni = Alumni::getInstance();
$myts = MyTextSanitizer::getInstance();
$by_cat = Request::getInt('by_cat', '');
$andor = Request::getWord('andor', 'AND');
$queries = array();
$query = Request::getString('query', '');
$start = Request::getInt('start', '0');
$helper = $xoops->getModuleHelper('alumni');
$module_id = $helper->getModule()->getVar('mid');
$listingHandler = $helper->getHandler('listing');
$groups = $xoops->getUserGroups();
$alumni_ids = $xoops->getHandlerGroupperm()->getItemIds('alumni_view', $groups, $module_id);
$all_ids = implode(', ', $alumni_ids);
$criteria = new CriteriaCompo();
$criteria->add(new Criteria('valid', 1, '='));
// $criteria->add(new Criteria('date', time(), '<='));
$criteria->add(new Criteria('cid', '(' . $all_ids . ')', 'IN'));
if ($userid != 0) {
$criteria->add(new Criteria('usid', $userid, '='));
}
if ($by_cat) {
$criteria->add(new Criteria('cid', $by_cat, '='));
}
$queries = array($query);
$queries = implode('+', $queries);
$count = 0;
$i = 0;
$criteria->add(new Criteria('name', '%' . $queries . '%', 'LIKE'), 'AND');
$criteria->add(new Criteria('mname', '%' . $queries . '%', 'LIKE'), 'OR');
$criteria->add(new Criteria('lname', '%' . $queries . '%', 'LIKE'), 'OR');
$criteria->add(new Criteria('school', '%' . $queries . '%', 'LIKE'), 'OR');
$criteria->add(new Criteria('year', '%' . $queries . '%', 'LIKE'), 'OR');
$criteria->setLimit($limit);
$criteria->setSort('date');
$criteria->setOrder('DESC');
$criteria->setStart($start);
$numrows = $listingHandler->getCount();
$this_search = $listingHandler->getall($criteria);
$ret = array();
$k = 0;
foreach ($this_search as $obj) {
$ret[$k]['image'] = 'images/cat/default.gif';
$ret[$k]['link'] = 'listing.php?lid=' . $obj->getVar('lid') . '';
$ret[$k]['title'] = $obj->getVar('name') . ' ' . $obj->getVar('mname') . ' ' . $obj->getVar('lname') . ' --- ' . $obj->getVar('school') . '
--- ' . $obj->getVar('year');
$ret[$k]['time'] = $obj->getVar('date');
$ret[$k]['uid'] = $obj->getVar('usid');
$k++;
}
return $ret;
}
示例6: pruneShouts
function pruneShouts($limit)
{
$criteria = new CriteriaCompo();
$criteria->setSort('id');
$criteria->setOrder('DESC');
$criteria->setStart(0);
$criteria->setLimit($limit);
$objs = $this->getList($criteria, true);
unset($criteria);
$criteria = new Criteria('id', '(' . implode(',', array_keys($objs)) . ')', 'NOT IN');
return $this->deleteAll($criteria);
}
示例7: getAllPid
public function getAllPid(oledrion_parameters $parameters)
{
$parameters = $parameters->extend(new oledrion_parameters(array('start' => 0, 'limit' => 0, 'sort' => 'location_id', 'order' => 'ASC')));
$critere = new CriteriaCompo();
$critere->add(new Criteria('location_type', 'parent'));
$critere->setLimit($parameters['limit']);
$critere->setStart($parameters['start']);
$critere->setSort($parameters['sort']);
$critere->setOrder($parameters['order']);
$pid = array();
$pid = $this->getObjects($critere);
return $pid;
}
示例8: billboard_slides_show
function billboard_slides_show()
{
include_once ICMS_ROOT_PATH . '/modules/billboard/include/common.php';
$billboard_slide_handler = icms_getModuleHandler('slide', 'billboard');
$billboard_config = icms_getModuleConfig('billboard');
$criteria = new CriteriaCompo();
$criteria->setStart(0);
$criteria->setLimit(10);
$criteria->setSort('slide_order');
$criteria->setOrder('ASC');
$block = array();
$block['slides'] = $billboard_slide_handler->getObjects($criteria, true, false);
$block['config'] = $billboard_config;
return $block;
}
示例9: user_index
function user_index($start = 0)
{
global $xoopsTpl, $xoopsUser, $xoopsConfig, $limit;
$myts =& MyTextSanitizer::getInstance();
include_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
$this_handler =& xoops_getModuleHandler('user', 'subscribers');
$module_handler =& xoops_getHandler('module');
$query = isset($_POST['query']) ? $_POST['query'] : null;
$xoopsTpl->assign('query', $query);
$criteria = null;
if (!is_null($query)) {
$criteria = new Criteria('user_email', $myts->addSlashes($query) . '%', 'LIKE');
}
$count = $this_handler->getCount($criteria);
$xoopsTpl->assign('count', $count);
$mHandler =& xoops_getHandler('member');
$users_count = $mHandler->getUserCount(new Criteria('level', 0, '>'));
$xoopsTpl->assign('users_count', $users_count);
$xoopsTpl->assign('total_count', $users_count + $count);
$criteria = new CriteriaCompo($criteria);
$criteria->setSort('user_id');
$criteria->setOrder('DESC');
$criteria->setStart($start);
$criteria->setLimit($limit);
$objs = $this_handler->getObjects($criteria);
unset($criteria);
if ($count > 0) {
if ($count > $limit) {
include_once XOOPS_ROOT_PATH . '/class/pagenav.php';
$nav = new XoopsPageNav($count, $limit, $start, 'start', 'op=list');
$xoopsTpl->assign('pag', '<div style="float:left; padding-top:2px;" align="center">' . $nav->renderNav() . '</div>');
} else {
$xoopsTpl->assign('pag', '');
}
} else {
$xoopsTpl->assign('pag', '');
}
include_once XOOPS_ROOT_PATH . '/class/xoopslists.php';
$countries = XoopsLists::getCountryList();
foreach ($objs as $obj) {
$objArray = $obj->toArray();
$objArray['user_country'] = $countries[$objArray['user_country']];
$xoopsTpl->append('objs', $objArray);
unset($objArray);
}
$xoopsTpl->assign('add_form', user_form());
return $xoopsTpl->fetch(XOOPS_ROOT_PATH . '/modules/subscribers/templates/static/subscribers_admin_user.html');
}
示例10: getByItemId
function getByItemId($module_id, $item_id, $order = null, $status = null, $limit = null, $start = 0)
{
$criteria = new CriteriaCompo(new Criteria('com_modid', $module_id));
$criteria->add(new Criteria('com_itemid', $item_id));
if (isset($status)) {
$criteria->add(new Criteria('com_status', $status));
}
if (isset($order)) {
$criteria->setOrder($order);
}
if (isset($limit)) {
$criteria->setLimit($limit);
$criteria->setStart($start);
}
return $this->getObjects($criteria);
}
示例11: defacer_index
function defacer_index($start = 0, $limit = 0)
{
global $xoopsTpl;
$defacer =& DefacerDefacer::getInstance();
$grouplist_handler =& xoops_gethandler('group');
$grouplist = $grouplist_handler->getObjects(null, true);
foreach (array_keys($grouplist) as $i) {
$groups[$i] = $grouplist[$i]->getVar('name');
}
$xoopsTpl->assign('groups', $groups);
$count = $defacer->getHandler('permission')->getCount();
$xoopsTpl->assign('count', $count);
$criteria = new CriteriaCompo();
$criteria->setStart($start);
$criteria->setLimit($limit);
$objs = $defacer->getHandler('permission')->getObjects($criteria);
if ($count > $limit) {
include_once XOOPS_ROOT_PATH . '/class/pagenav.php';
$nav = new XoopsPageNav($count, $limit, $start, 'start', 'op=list');
$xoopsTpl->assign('pagenav', '<div style="float:left; padding-top:2px;" align="center">' . $nav->renderNav() . '</div>');
}
foreach ($objs as $obj) {
$item = $obj->getValues();
$page = $defacer->getHandler('page')->get($obj->getVar('permission_id'));
$item['module'] = $page->getVar('name');
$item['permission_title'] = $page->getVar('page_title');
$item['permission_url'] = $page->getVar('page_url');
$item['permission_status'] = $page->getVar('page_status');
if (substr($page->getVar('page_url'), -1) == '*') {
$item['permission_vurl'] = 0;
} else {
if ($page->getVar('page_moduleid') == 1) {
$item['permission_vurl'] = XOOPS_URL . '/' . $page->getVar('page_url');
} else {
$item['permission_vurl'] = XOOPS_URL . '/modules/' . $page->getVar('dirname') . '/' . $page->getVar('page_url');
}
}
$xoopsTpl->append('items', $item);
}
$xoopsTpl->assign('form', defacer_form());
return $xoopsTpl->fetch('db:defacer_admin_permission.html');
}
示例12: setContent
function setContent($isreturn = false)
{
global $jieqiTpl;
include_once JIEQI_ROOT_PATH . '/class/userlink.php';
$userlink_handler =& JieqiUserlinkHandler::getInstance('JieqiUserlinkHandler');
$criteria = new CriteriaCompo();
$criteria->add(new Criteria('userid', $this->blockvars['cacheid']));
if ($this->exevars['istop'] == 1) {
$criteria->add(new Criteria('toptime', 0, '>'));
} elseif ($this->exevars['istop'] == 2) {
$criteria->add(new Criteria('toptime', 0));
}
$criteria->setSort($this->exevars['field']);
if ($this->exevars['asc'] == 1) {
$criteria->setOrder('ASC');
} else {
$criteria->setOrder('DESC');
}
$criteria->setLimit($this->exevars['listnum']);
$criteria->setStart(0);
$userlink_handler->queryObjects($criteria);
$linkrows = array();
$k = 0;
while ($v = $userlink_handler->getObject()) {
$linkrows[$k]['ulid'] = $v->getVar('ulid');
$linkrows[$k]['ultitle'] = $v->getVar('ultitle');
$linkrows[$k]['ulurl'] = $v->getVar('ulurl');
$linkrows[$k]['ulinfo'] = $v->getVar('ulinfo');
$linkrows[$k]['userid'] = $v->getVar('userid');
$linkrows[$k]['username'] = $v->getVar('username');
$linkrows[$k]['score'] = $v->getVar('score');
$linkrows[$k]['weight'] = $v->getVar('weight');
$linkrows[$k]['toptime'] = $v->getVar('toptime');
$linkrows[$k]['addtime'] = $v->getVar('addtime');
$linkrows[$k]['allvisit'] = $v->getVar('allvisit');
$k++;
}
$jieqiTpl->assign_by_ref('linkrows', $linkrows);
$jieqiTpl->assign('ownerid', $this->blockvars['cacheid']);
$jieqiTpl->assign('url_more', JIEQI_URL . '/userlink.php?uid=' . $this->blockvars['cacheid']);
}
示例13: waiting_index
function waiting_index($start = 0)
{
global $xoopsTpl, $xoopsUser, $xoopsConfig, $limit;
include_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
include_once XOOPS_ROOT_PATH . '/modules/subscribers/include/functions.php';
subscribers_sendEmails();
$this_handler =& xoops_getModuleHandler('waiting', 'subscribers');
$count = $this_handler->getCount();
$xoopsTpl->assign('count', $count);
$criteria = new CriteriaCompo();
$criteria->setSort('wt_priority DESC, wt_created');
$criteria->setOrder('ASC');
$criteria->setStart($start);
$criteria->setLimit($limit);
$objs = $this_handler->getObjects($criteria);
if ($count > 0) {
if ($count > $limit) {
include_once XOOPS_ROOT_PATH . '/class/pagenav.php';
$nav = new XoopsPageNav($count, $limit, $start, 'start', 'op=list');
$xoopsTpl->assign('pag', '<div style="float:left; padding-top:2px;" align="center">' . $nav->renderNav() . '</div>');
} else {
$xoopsTpl->assign('pag', '');
}
} else {
$xoopsTpl->assign('pag', '');
}
include_once XOOPS_ROOT_PATH . '/class/xoopslists.php';
$countries = XoopsLists::getCountryList();
foreach ($objs as $obj) {
$objArray = $obj->toArray();
$objArray['wt_created'] = formatTimestamp($objArray['wt_created']);
$xoopsTpl->append('objs', $objArray);
unset($objArray);
}
return $xoopsTpl->fetch(XOOPS_ROOT_PATH . '/modules/subscribers/templates/static/subscribers_admin_waiting.html');
}
示例14: countPage
public function countPage($start = 0, $limit = 0, $sort = 'content_weight ASC, content_title', $order = 'ASC')
{
$criteria = new CriteriaCompo();
$criteria->setSort($sort);
$criteria->setOrder($order);
$criteria->setStart($start);
$criteria->setLimit($limit);
return parent::getCount($criteria);
}
示例15: CriteriaCompo
/**
* @得到列表
* @method:
* @license http://www.blags.org/
* @created :2010年05月23日 14时59分
* @copyright 1997-2010 The Martin Group
* @author Martin <china.codehome@gmail.com>
* @param int $limit
* @param int $start
* @param string $sort
* @param string $order
* @param bool $id_as_key
* @return array
*/
public function &getRooms($limit = 0, $start = 0, $sort = 'room_id', $order = 'ASC', $id_as_key = true)
{
$criteria = new CriteriaCompo();
$criteria->setSort($sort);
$criteria->setOrder($order);
$criteria->setStart($start);
$criteria->setLimit($limit);
return $this->getObjects($criteria, $id_as_key);
}