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


PHP search::setUserLimit方法代码示例

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


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

示例1: searchProject

function searchProject($string, $categories, $page = 1, $type_loading = 1)
{
    require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/search/search.php';
    require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/projects.php';
    require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/professions.php';
    $objResponse = new xajaxResponse();
    if (!$string) {
        $string = '';
    }
    $limit_project = 10;
    if ($type_loading == 0) {
        $filter['active'] = 't';
        $filter['my_specs'] = 'f';
        if ($categories[0] != '-1') {
            $filter['categories'][0] = array($categories[0] => '0');
            if ($categories[1] != '-1') {
                unset($filter['categories'][0]);
                $filter['categories'][1] = array($categories[1] => '1');
            }
        }
        $project = new new_projects();
        $project->page_size = $limit_project;
        $projects = $project->getProjects($total, -1, $page, false, $filter, true, false, null, true);
    } else {
        $_SESSION['search_tab_active'] = 'projects';
        $search = new search(false);
        $search->setUserLimit($limit_project);
        $search->addElement('projects', true, $limit_project);
        $filter['active'] = 't';
        $filter['my_specs'] = 'f';
        if ($categories[0] != '-1') {
            $filter['categories'][0] = array($categories[0] => '0');
            if ($categories[1] != '-1') {
                unset($filter['categories'][0]);
                $filter['categories'][1] = array($categories[1] => '1');
            }
        } else {
            $filter['categories'] = null;
        }
        $filter['is_closed_contest'] = true;
        $search->search($string, $page, $filter);
        $element = $search->getElements();
        $total = $element['projects']->total;
        $projects = $element['projects']->results;
    }
    $max_page = ceil($total / $limit_project);
    $next_page = $page + 1;
    if ($projects) {
        if ($page > 1) {
            $dont_show_hint = true;
        }
        ob_start();
        include $_SERVER['DOCUMENT_ROOT'] . '/wizard/registration/steps/tpl.step.search.project.php';
        $html = ob_get_clean();
        $objResponse->script("\$('project_search_hint').show()");
    } else {
        $html = 'Совпадений не найдено';
        $objResponse->script("\$('project_search_hint').hide()");
    }
    if ($next_page > $max_page) {
        $objResponse->script("\$('load_project').getElement('.b-button').addClass('b-button_disabled')");
    } else {
        $objResponse->script("\$('load_project').getElement('.b-button').removeClass('b-button_disabled')");
        $objResponse->assign('page-search', 'value', $next_page);
    }
    if ($page > 1) {
        $objResponse->assign('project_loader_content', 'innerHTML', $html);
        $objResponse->script("var html = new Element('span', {html:\$('project_loader_content').get('html')});\n                              \$('project_content').adopt(html);");
        $objResponse->assign('project_loader_content', 'innerHTML', '');
    } else {
        $objResponse->assign('project_content', 'innerHTML', $html);
    }
    return $objResponse;
}
开发者ID:kapai69,项目名称:fl-ru-damp,代码行数:74,代码来源:wizard.server.php

示例2: isset

if (!$type) {
    $_SESSION['search_string'] = '';
}
$_SESSION['search_string'] = isset($_POST['search_string']) || $action == 'search' ? base64_encode(html_entity_decode(stripslashes(trim($pss)), ENT_QUOTES)) : $_SESSION['search_string'];
if (isset($_POST['search_elms']) && is_array($_POST['search_elms'])) {
    $search_elms = array();
    foreach ($_POST['search_elms'] as $search_elm => $total) {
        if (in_array($search_elm, array('projects', 'users', 'works', 'messages', 'commune', 'notes'))) {
            $search_elms[$search_elm] = abs(intval($total));
        }
    }
    $_SESSION['search_elms'] = $search_elms;
}
$search_string = trim(base64_decode($_SESSION['search_string']) . ' ' . $_SESSION['string_professions']);
$search = new search($uid);
$search->setUserLimit($set_usr_limit);
foreach ($_SESSION['search_elms'] as $key => $total) {
    $search->addElement($key, true, $set_usr_limit);
}
if ($type == 'all') {
    $action = 'search';
}
if (!$page) {
    $page = 1;
    $bPageDefault = true;
}
if ($_POST['action']) {
    $action = $_POST['action'];
}
if (isset($_SESSION['search_advanced'][$type]) && $action == 'view') {
    $action = 'view_advanced';
开发者ID:Nikitian,项目名称:fl-ru-damp,代码行数:31,代码来源:index.php


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