本文整理汇总了PHP中icms_db_criteria_Compo::setStart方法的典型用法代码示例。如果您正苦于以下问题:PHP icms_db_criteria_Compo::setStart方法的具体用法?PHP icms_db_criteria_Compo::setStart怎么用?PHP icms_db_criteria_Compo::setStart使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类icms_db_criteria_Compo
的用法示例。
在下文中一共展示了icms_db_criteria_Compo::setStart方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getTribesCriteria
/**
* Create the criteria that will be used by getTribes and getTribesCount
*
* @param int $start to which record to start
* @param int $limit limit of tribes to return
* @param int $uid_owner if specifid, only the tribes of this user will be returned
* @param int $tribes_id ID of a single tribe to retrieve, may also be an array of tribe IDs
* @param bool $sortByTitle true to sort by title ascending
* @return icms_db_criteria_Compo $criteria
*/
private function getTribesCriteria($start = 0, $limit = 0, $uid_owner = false, $tribes_id = false, $sortByTitle = false)
{
$criteria = new icms_db_criteria_Compo();
if ($start) {
$criteria->setStart((int) $start);
}
if ($limit) {
$criteria->setLimit((int) $limit);
}
if ($sortByTitle) {
$criteria->setSort('title');
} else {
$criteria->setSort('creation_time');
$criteria->setOrder('DESC');
}
if ($uid_owner) {
$criteria->add(new icms_db_criteria_Item('uid_owner', (int) $uid_owner));
}
if ($tribes_id) {
if (!is_array($tribes_id)) {
$tribes_id = array((int) $tribes_id);
}
$tribes_id = '(' . implode(',', $tribes_id) . ')';
$criteria->add(new icms_db_criteria_Item('tribes_id', $tribes_id, 'IN'));
}
return $criteria;
}
示例2: getFriendshipsCriteria
/**
* Create the criteria that will be used by getFriendships
*
* @param int $start to which record to start
* @param int $limit max friendships to display
* @param int $friend1_uid only the friendship of this user will be returned
* @param int $friend2_uid if specifid, the friendship of these two users will be returned.
* @param int $status only get friendships with the specified status
* @return icms_db_criteria_Compo $criteria
*/
private function getFriendshipsCriteria($start = 0, $limit = 0, $friend1_uid = 0, $friend2_uid = 0, $status = 0)
{
$criteria = new icms_db_criteria_Compo();
if ($start) {
$criteria->setStart((int) $start);
}
if ($limit) {
$criteria->setLimit((int) $limit);
}
$criteria->setSort('creation_time');
$criteria->setOrder('DESC');
if ($status == PROFILE_FRIENDSHIP_STATUS_PENDING && $friend2_uid) {
$criteria->add(new icms_db_criteria_Item('status', (int) $status));
$criteria->add(new icms_db_criteria_Item('friend2_uid', (int) $friend2_uid));
} else {
if ($status) {
$criteria->add(new icms_db_criteria_Item('status', (int) $status));
}
if ($friend2_uid > 0) {
$criteria->add(new icms_db_criteria_Item('friend1_uid', (int) $friend1_uid));
$criteria->add(new icms_db_criteria_Item('friend2_uid', (int) $friend2_uid));
$criteria->add(new icms_db_criteria_Item('friend1_uid', (int) $friend2_uid), 'OR');
$criteria->add(new icms_db_criteria_Item('friend2_uid', (int) $friend1_uid));
} elseif ($friend1_uid > 0) {
$criteria->add(new icms_db_criteria_Item('friend1_uid', (int) $friend1_uid));
$criteria->add(new icms_db_criteria_Item('friend2_uid', (int) $friend1_uid), 'OR');
}
if ($status) {
$criteria->add(new icms_db_criteria_Item('status', (int) $status));
}
}
return $criteria;
}
示例3: getTribeusersCriteria
/**
* Create the criteria that will be used by getTribeusers and getTribeusersCount
*
* @param int $start to which record to start
* @param int $limit limit of tribeusers to return
* @param int $user_id if specifid, only the tribeusers of this user will be returned
* @param int $tribeuser_id ID of a single tribeuser to retrieve
* @param int $tribe_id id of tribe
* @param str $condition
* @param bool $approved
* @param bool $accepted
* @return icms_db_criteria_Compo $criteria
*/
private function getTribeusersCriteria($start = 0, $limit = 0, $user_id = false, $tribeuser_id = false, $tribe_id = false, $condition = '=', $approved = false, $accepted = false)
{
$criteria = new icms_db_criteria_Compo();
if ($start) {
$criteria->setStart((int) $start);
}
if ($limit) {
$criteria->setLimit((int) $limit);
}
if ($tribeuser_id) {
$criteria->add(new icms_db_criteria_Item('tribeusers_id', (int) $tribeuser_id));
}
if ($tribe_id) {
if (!is_array($tribe_id)) {
$tribe_id = array($tribe_id);
}
$tribe_id = '(' . implode(',', $tribe_id) . ')';
$criteria->add(new icms_db_criteria_Item('tribe_id', $tribe_id, 'IN'));
}
if ($user_id) {
$criteria->add(new icms_db_criteria_Item('user_id', (int) $user_id, $condition));
}
if ($approved !== false) {
$criteria->add(new icms_db_criteria_Item('approved', (int) $approved));
}
if ($accepted !== false) {
$criteria->add(new icms_db_criteria_Item('accepted', (int) $accepted));
}
return $criteria;
}
示例4: getPicturesCriteria
/**
* Create the criteria that will be used by getPictures and getPicturesCount
*
* @param int $start to which record to start
* @param int $limit limit of pictures to return
* @param int $uid_owner if specifid, only the pictures of this user will be returned
* @param int $picture_id ID of a single picture to retrieve
* @return icms_db_criteria_Compo $criteria
*/
private function getPicturesCriteria($start = 0, $limit = 0, $uid_owner = false, $picture_id = false)
{
$module = icms::handler("icms_module")->getByDirname(basename(dirname(dirname(__FILE__))), TRUE);
$criteria = new icms_db_criteria_Compo();
if ($start) {
$criteria->setStart((int) $start);
}
if ($limit) {
$criteria->setLimit((int) $limit);
}
$criteria->setSort('creation_time');
if ($module->config['images_order']) {
$criteria->setOrder('DESC');
}
if (is_object(icms::$user)) {
if (icms::$user->getVar('uid') != $uid_owner && !icms::$user->isAdmin()) {
$criteria->add(new icms_db_criteria_Item('private', 0));
}
} else {
$criteria->add(new icms_db_criteria_Item('private', 0));
}
if ($uid_owner) {
$criteria->add(new icms_db_criteria_Item('uid_owner', (int) $uid_owner));
}
if ($picture_id) {
$criteria->add(new icms_db_criteria_Item('pictures_id', (int) $picture_id));
}
return $criteria;
}
示例5: getConfigsCriteria
/**
* Create the criteria that will be used by getConfigs and getConfigsCount
*
* @param int $start to which record to start
* @param int $limit limit of configs to return
* @param int $uid_owner if specifid, only the configs of this user will be returned
* @param int $configs_id ID of a single config to retrieve
* @return icms_db_criteria_Compo $criteria
*/
private function getConfigsCriteria($start = 0, $limit = 0, $uid_owner = false, $configs_id = false)
{
$criteria = new icms_db_criteria_Compo();
if ($start) {
$criteria->setStart((int) $start);
}
if ($limit) {
$criteria->setLimit((int) $limit);
}
if ($uid_owner) {
$criteria->add(new icms_db_criteria_Item('config_uid', (int) $uid_owner));
}
if ($configs_id) {
$criteria->add(new icms_db_criteria_Item('configs_id', (int) $configs_id));
}
return $criteria;
}
示例6: getTopicCriteria
/**
* Create the criteria that will be used by getTopics
*
* @param int $start to which record to start
* @param int $limit limit of topics to return
* @param int $topic_id id of the topic
* @param int $tribes_id id of the tribe the topic belongs to
* @return icms_db_criteria_Compo $criteria
*/
private function getTopicCriteria($start = 0, $limit = 0, $topic_id = false, $tribes_id = false)
{
$criteria = new icms_db_criteria_Compo();
if ($start) {
$criteria->setStart((int) $start);
}
if ($limit) {
$criteria->setLimit((int) $limit);
}
$criteria->setSort('last_post_time');
$criteria->setOrder('DESC');
if ($topic_id) {
$criteria->add(new icms_db_criteria_Item('topic_id', (int) $topic_id));
}
if ($tribes_id) {
$criteria->add(new icms_db_criteria_Item('tribes_id', (int) $tribes_id));
}
return $criteria;
}
示例7: getAudioCriteria
/**
* Create the criteria that will be used by getAudios and getAudioCount
*
* @param int $start to which record to start
* @param int $limit limit of audio to return
* @param int $uid_owner if specifid, only the audio of this user will be returned
* @param int $audio_id ID of a single audio to retrieve
* @return icms_db_criteria_Compo $criteria
*/
private function getAudioCriteria($start = 0, $limit = 0, $uid_owner = false, $audio_id = false)
{
$criteria = new icms_db_criteria_Compo();
if ($start) {
$criteria->setStart((int) $start);
}
if ($limit) {
$criteria->setLimit((int) $limit);
}
if ($uid_owner) {
$criteria->add(new icms_db_criteria_Item('uid_owner', (int) $uid_owner));
}
if ($audio_id) {
$criteria->add(new icms_db_criteria_Item('audio_id', (int) $audio_id));
}
$criteria->setSort('creation_time');
$criteria->setOrder('DESC');
return $criteria;
}
示例8: getPostCriteria
/**
* Create the criteria that will be used by getPosts
*
* @param int $start to which record to start
* @param int $limit limit of posts to return
* @param int $post_id id of the post
* @param int $topic_id id of the topic the post belongs to
* @param int $tribes_id id of the tribe the topic / post belongs to
* @param string $order sort order for the result list
* @return icms_db_criteria_Compo $criteria
*/
private function getPostCriteria($start = 0, $limit = 0, $post_id = false, $topic_id = false, $tribes_id = false, $order = 'ASC')
{
$criteria = new icms_db_criteria_Compo();
if ($start) {
$criteria->setStart((int) $start);
}
if ($limit) {
$criteria->setLimit((int) $limit);
}
$criteria->setSort('post_id');
$criteria->setOrder($order);
if ($post_id) {
$criteria->add(new icms_db_criteria_Item('post_id', (int) $post_id));
}
if ($topic_id) {
$criteria->add(new icms_db_criteria_Item('topic_id', (int) $topic_id));
}
if ($tribes_id) {
$criteria->add(new icms_db_criteria_Item('tribes_id', (int) $tribes_id));
}
return $criteria;
}
示例9: getVisitorsCriteria
/**
* Create the criteria that will be used by getVisitors
*
* @param int $start to which record to start
* @param int $limit limit of tribes to return
* @param int $uid_owner if specifid, only the tribes of this user will be returned
* @param int $uid_visitor if specified, only the records with the specified user as a visitor will be returned
* @param int $visit_time if specified, only records with a visit time greater than the specified on will be returned
* @return icms_db_criteria_Compo $criteria
*/
private function getVisitorsCriteria($start = 0, $limit = 0, $uid_owner = false, $uid_visitor = false, $visit_time = false)
{
$criteria = new icms_db_criteria_Compo();
if ($start) {
$criteria->setStart((int) $start);
}
if ($limit) {
$criteria->setLimit((int) $limit);
}
$criteria->setSort('visit_time');
$criteria->setOrder('DESC');
if ($uid_owner) {
$criteria->add(new icms_db_criteria_Item('uid_owner', (int) $uid_owner));
}
if ($uid_visitor) {
$criteria->add(new icms_db_criteria_Item('uid_visitor', (int) $uid_visitor));
}
if ($visit_time) {
$criteria->add(new icms_db_criteria_Item('visit_time', $visit_time, '>='));
}
return $criteria;
}
示例10: trim
if ($time > 0) {
$criteria[] = "user_regdate > $time";
}
}
if (!empty($_POST['mail_regd_max'])) {
$f_mail_regd_max = trim($_POST['mail_regd_max']);
$time = mktime(0, 0, 0, substr($f_mail_regd_max, 5, 2), substr($f_mail_regd_max, 8, 2), substr($f_mail_regd_max, 0, 4));
if ($time > 0) {
$criteria[] = "user_regdate < $time";
}
}
if (!empty($criteria) || !empty($_POST['mail_to_group'])) {
$criteria_object = new icms_db_criteria_Compo();
$criteria_object->setStart(@$_POST['mail_start']);
$criteria_object->setLimit($limit);
foreach ($criteria as $c) {
list ($field, $op, $value) = explode(' ', $c);
$crit = new icms_db_criteria_Item($field, $value, $op);
$crit->prefix = "u";
$criteria_object->add($crit, 'AND');
}
$member_handler = icms::handler('icms_member');
$groups = empty($_POST['mail_to_group']) ? array() : array_map('intval', $_POST['mail_to_group']);
$getusers = $member_handler->getUsersByGroupLink($groups, $criteria_object, TRUE);
$count_criteria = $member_handler->getUserCountByGroupLink($groups, $criteria_object);
foreach ($getusers as $getuser) {
if (!in_array($getuser->getVar("uid"), $added_id)) {
$added[] = $getuser;
$added_id[] = $getuser->getVar("uid");
示例11: getByItemId
/**
* Retrieves comments for an item
*
* @param int $module_id Module ID
* @param int $item_id Item ID
* @param string $order Sort order
* @param int $status Status of the comment
* @param int $limit Max num of comments to retrieve
* @param int $start Start offset
*
* @return array Array of {@link icms_data_comment_Object} objects
**/
public function getByItemId($module_id, $item_id, $order = null, $status = null, $limit = null, $start = 0)
{
$criteria = new icms_db_criteria_Compo(new icms_db_criteria_Item('com_modid', (int) $module_id));
$criteria->add(new icms_db_criteria_Item('com_itemid', (int) $item_id));
if (isset($status)) {
$criteria->add(new icms_db_criteria_Item('com_status', (int) $status));
}
if (isset($order)) {
$criteria->setOrder($order);
}
if (isset($limit)) {
$criteria->setLimit($limit);
$criteria->setStart($start);
}
return $this->getObjects($criteria);
}
示例12: displayUsers
/**
* Displays user information form
*
*/
function displayUsers() {
global $icmsConfig, $icmsModule, $icmsConfigUser;
$userstart = isset($_GET['userstart']) ? (int) $_GET['userstart'] : 0;
icms_cp_header();
echo '<div class="CPbigTitle" style="background-image: url(' . ICMS_MODULES_URL . '/system/admin/users/images/users_big.png)">' . _MD_AM_USER . '</div><br />';
$member_handler = icms::handler('icms_member');
$usercount = $member_handler->getUserCount(new icms_db_criteria_Item('level', '-1', '!='));
$nav = new icms_view_PageNav($usercount, 200, $userstart, 'userstart', 'fct=users');
$editform = new icms_form_Theme(_AM_EDEUSER, 'edituser', 'admin.php');
$user_select = new icms_form_elements_Select('', 'uid');
$criteria = new icms_db_criteria_Compo();
$criteria->add(new icms_db_criteria_Item('level', '-1', '!='));
$criteria->setSort('uname');
$criteria->setOrder('ASC');
$criteria->setLimit(200);
$criteria->setStart($userstart);
$user_select->addOptionArray($member_handler->getUserList($criteria));
$user_select_tray = new icms_form_elements_Tray(_AM_NICKNAME, '<br />');
$user_select_tray->addElement($user_select);
$user_select_nav = new icms_form_elements_Label('', $nav->renderNav(4));
$user_select_tray->addElement($user_select_nav);
$op_select = new icms_form_elements_Select('', 'op');
$op_select->addOptionArray(array('modifyUser'=>_AM_MODIFYUSER, 'delUser'=>_AM_DELUSER));
$submit_button = new icms_form_elements_Button('', 'submit', _AM_GO, 'submit');
$fct_hidden = new icms_form_elements_Hidden('fct', 'users');
$editform->addElement($user_select_tray);
$editform->addElement($op_select);
$editform->addElement($submit_button);
$editform->addElement($fct_hidden);
$editform->display();
echo "<br />\n";
$usercount = $member_handler->getUserCount(new icms_db_criteria_Item('level', '-1'));
$nav = new icms_view_PageNav($usercount, 200, $userstart, 'userstart', 'fct=users');
$editform = new icms_form_Theme(_AM_REMOVED_USERS, 'edituser', 'admin.php');
$user_select = new icms_form_elements_Select('', 'uid');
$criteria = new icms_db_criteria_Compo();
$criteria->add(new icms_db_criteria_Item('level', '-1'));
$criteria->setSort('uname');
$criteria->setOrder('ASC');
$criteria->setLimit(200);
$criteria->setStart($userstart);
$user_select->addOptionArray($member_handler->getUserList($criteria));
$user_select_tray = new icms_form_elements_Tray(_AM_NICKNAME, '<br />');
$user_select_tray->addElement($user_select);
$user_select_nav = new icms_form_elements_Label('', $nav->renderNav(4));
$user_select_tray->addElement($user_select_nav);
$op_select = new icms_form_elements_Select('', 'op');
$op_select->addOptionArray(array('modifyUser'=>_AM_MODIFYUSER));
$submit_button = new icms_form_elements_Button('', 'submit', _AM_GO, 'submit');
$fct_hidden = new icms_form_elements_Hidden('fct', 'users');
$editform->addElement($user_select_tray);
$editform->addElement($op_select);
$editform->addElement($submit_button);
$editform->addElement($fct_hidden);
$editform->display();
echo "<br />\n";
$uid_value = '';
$uname_value = '';
$login_name_value = '';
$name_value = '';
$email_value = '';
$email_cbox_value = 0;
$openid_value = '';
$openid_cbox_value = 0;
$url_value = '';
$timezone_value = $icmsConfig['default_TZ'];
$icq_value = '';
$aim_value = '';
$yim_value = '';
$msnm_value = '';
$location_value = '';
$occ_value = '';
$interest_value = '';
$sig_value = '';
$sig_cbox_value = 0;
$umode_value = $icmsConfig['com_mode'];
$uorder_value = $icmsConfig['com_order'];
include_once ICMS_INCLUDE_PATH .'/notification_constants.php';
$notify_method_value = XOOPS_NOTIFICATION_METHOD_PM;
$notify_mode_value = XOOPS_NOTIFICATION_MODE_SENDALWAYS;
$bio_value = '';
$rank_value = 0;
$mailok_value = 0;
$pass_expired_value = 0;
$op_value = 'addUser';
$form_title = _AM_ADDUSER;
$form_isedit = FALSE;
$language_value = $icmsConfig['language'];
//.........这里部分代码省略.........
示例13: isset
echo $xoopsMailer->getErrors();
} else {
echo '<div><h4>' . _MSC_REFERENCESENT . '</h4></div>';
}
//CloseTable();
}
break;
case 'online':
echo '<table width="100%" cellspacing="1" class="outer"><tr><th colspan="3">' . _WHOSONLINE . '</th></tr>';
$start = isset($_GET['start']) ? (int) $_GET['start'] : 0;
$online_handler = icms::handler('icms_core_Online');
$online_total =& $online_handler->getCount();
$limit = $online_total > 20 ? 20 : $online_total;
$criteria = new icms_db_criteria_Compo();
$criteria->setLimit($limit);
$criteria->setStart($start);
$onlines =& $online_handler->getAll($criteria);
$count = count($onlines);
$module_handler = icms::handler('icms_module');
$modules =& $module_handler->getList(new icms_db_criteria_Item('isactive', 1));
for ($i = 0; $i < $count; $i++) {
if ($onlines[$i]['online_uid'] == 0) {
$onlineUsers[$i]['user'] = '';
} else {
$onlineUsers[$i]['user'] = new icms_member_user_Object($onlines[$i]['online_uid']);
}
$onlineUsers[$i]['ip'] = $onlines[$i]['online_ip'];
$onlineUsers[$i]['updated'] = $onlines[$i]['online_updated'];
$onlineUsers[$i]['module'] = $onlines[$i]['online_module'] > 0 ? $modules[$onlines[$i]['online_module']] : '';
}
$class = 'even';
示例14: getContentsForSearch
/**
* Get Contents requested by the global search feature
*
* @param array $queryarray array containing the searched keywords
* @param bool $andor wether the keywords should be searched with AND or OR
* @param int $limit maximum results returned
* @param int $offset where to start in the resulting dataset
* @param int $userid should we return contents by specific contenter ?
* @return array array of contents
*/
public function getContentsForSearch($queryarray, $andor, $limit, $offset, $userid)
{
$criteria = new icms_db_criteria_Compo();
$criteria->setStart($offset);
$criteria->setLimit($limit);
if ($userid != 0) {
$criteria->add(new icms_db_criteria_Item('content_uid', $userid));
}
if ($queryarray) {
$criteriaKeywords = new icms_db_criteria_Compo();
for ($i = 0; $i < count($queryarray); $i++) {
$criteriaKeyword = new icms_db_criteria_Compo();
$criteriaKeyword->add(new icms_db_criteria_Item('content_title', '%' . $queryarray[$i] . '%', 'LIKE'), 'OR');
$criteriaKeyword->add(new icms_db_criteria_Item('content_body', '%' . $queryarray[$i] . '%', 'LIKE'), 'OR');
$criteriaKeywords->add($criteriaKeyword, $andor);
unset($criteriaKeyword);
}
$criteria->add($criteriaKeywords);
}
$criteria->add(new icms_db_criteria_Item('content_status', CONTENT_CONTENT_STATUS_PUBLISHED));
return $this->getObjects($criteria, true, false);
}