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


PHP dbex::setPages方法代码示例

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


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

示例1: blog_read_base

function blog_read_base($fields = "*", $condition = "", $get_type = "", $num = "", $by_col = "log_id", $order = "desc", $cache = "", $cache_key = "")
{
    global $tablePreStr;
    global $page_num;
    global $page_total;
    global $is_self;
    $is_pass = ' is_pass = 1 ';
    $is_admin = get_sess_admin();
    $t_blog = $tablePreStr . "blog";
    $result_rs = array();
    $dbo = new dbex();
    dbplugin('r');
    $limit = $num ? " limit {$num} " : "";
    $by_col = $by_col ? " {$by_col} " : " log_id ";
    $order = $order ? $order : "desc";
    $get_type = $get_type == 'getRow' ? "getRow" : "getRs";
    $is_pass = $is_self == 'Y' || $is_admin ? '1' : $is_pass;
    $sql = " select {$fields} from {$t_blog} where {$is_pass} {$condition} order by {$by_col} {$order} {$limit} ";
    if (empty($result_rs)) {
        if ($limit == '') {
            $dbo->setPages(20, $page_num);
        }
        $result_rs = $dbo->{$get_type}($sql);
        $page_total = $dbo->totalPage;
    }
    return $result_rs;
}
开发者ID:omusico,项目名称:Social,代码行数:27,代码来源:blog_self.php

示例2: msgboard_read_base

function msgboard_read_base($fields = "*", $condition = "", $get_type = "", $num = "", $by_col = "mess_id", $order = "desc", $cache = "", $cache_key = "")
{
    global $tablePreStr;
    global $page_num;
    global $page_total;
    global $cachePages;
    $t_msgboard = $tablePreStr . "msgboard";
    $result_rs = array();
    $dbo = new dbex();
    dbplugin('r');
    $limit = $num ? " limit {$num} " : "";
    $by_col = $by_col ? " {$by_col} " : " mess_id ";
    $order = $order ? $order : "desc";
    $get_type = $get_type == 'getRow' ? "getRow" : "getRs";
    $sql = " select {$fields} from {$t_msgboard} where {$condition} order by {$by_col} {$order} {$limit} ";
    /*
    可以加入缓存机制
    */
    if (empty($result_rs)) {
        if ($limit == '') {
            $dbo->setPages(20, $page_num);
        }
        $result_rs = $dbo->{$get_type}($sql);
        $page_total = $dbo->totalPage;
    }
    return $result_rs;
}
开发者ID:omusico,项目名称:Social,代码行数:27,代码来源:msgboard_self.php

示例3: scrip_notice_get

function scrip_notice_get($fields = "*", $num = "", $condition = "")
{
    global $tablePreStr;
    global $page_num;
    global $page_total;
    $fields = filt_fields($fields);
    $uid = get_sess_userid();
    $t_scrip = $tablePreStr . "msg_inbox";
    $result_rs = array();
    $dbo = new dbex();
    dbplugin('r');
    $sql = " select {$fields} from {$t_scrip} where user_id = {$uid} and mesinit_id='' {$condition} order by mess_id desc ";
    $dbo->setPages(20, $page_num);
    $result_rs = $dbo->getRs($sql);
    $page_total = $dbo->totalPage;
    return $result_rs;
}
开发者ID:omusico,项目名称:Social,代码行数:17,代码来源:scrip_notice.php

示例4: group_sub_read_base

function group_sub_read_base($fields = "*", $condition = "", $get_type = "", $num = "", $by_col = "subject_id", $order = "desc", $cache = "", $cache_key = "")
{
    global $tablePreStr;
    global $page_num;
    global $page_total;
    $t_group_subject = $tablePreStr . "group_subject";
    $result_rs = array();
    $dbo = new dbex();
    dbplugin('r');
    $by_col = $by_col ? " {$by_col} " : " subject_id ";
    $order = $order ? $order : "desc";
    $get_type = $get_type ? "getRow" : "getRs";
    $sql = " select {$fields} from {$t_group_subject} where {$condition} order by {$by_col} {$order} ";
    if (empty($result_rs)) {
        $dbo->setPages(20, $page_num);
        $result_rs = $dbo->{$get_type}($sql);
        $page_total = $dbo->totalPage;
    }
    return $result_rs;
}
开发者ID:omusico,项目名称:Social,代码行数:20,代码来源:group_sub.php

示例5: dbex

$t_table = $tablePreStr . $com_table_str;
$con_id = $com_type[$com_table_str];
$dbo = new dbex();
dbtarget('w', $dbServs);
//当前页面参数
$page_num = trim(get_argg('page'));
//变量区
$c_orderby = short_check(get_argg('order_by'));
$c_ordersc = short_check(get_argg('order_sc'));
$c_perpage = get_argg('perpage') ? intval(get_argg('perpage')) : 20;
$eq_array = array('host_id', 'visitor_id', 'visitor_name', $con_id);
$like_array = array('content');
$date_array = array("add_time");
$num_array = array();
$sql = spell_sql($t_table, $eq_array, $like_array, $date_array, $num_array, $c_orderby, $c_ordersc);
$dbo->setPages($c_perpage, $page_num);
//设置分页
$com_rs = $dbo->getRs($sql);
$page_total = $dbo->totalPage;
//分页总数
//按字段排序
$o_def = '';
$o_add_time = '';
if (get_argg('order_by') == '' || get_argg('order_by') == "com_id") {
    $o_def = "selected";
}
if (get_argg('order_by') == "add_time") {
    $o_add_time = "selected";
}
//显示控制
$isset_data = "";
开发者ID:omusico,项目名称:Social,代码行数:31,代码来源:comment_list.php

示例6: dbex

$t_groups = $tablePreStr . "groups";
$t_group_members = $tablePreStr . "group_members";
$t_group_subject = $tablePreStr . "group_subject";
$t_group_subject_comment = $tablePreStr . "group_subject_comment";
//定义读操作
dbtarget('r', $dbServs);
$dbo = new dbex();
$show_action = 0;
//权限判断
$role = api_proxy("group_member_by_role", $group_id, $user_id);
$role = $role[0];
if (($role == 0 || $role == 1) && isset($role)) {
    $show_action = 1;
}
$condition = "group_id={$group_id} and title like '%{$key_word}%'";
$order_by = "order by add_time desc";
$type = "getRs";
$dbo->setPages(20, $page_num);
//设置分页
$subject_rs = get_db_data($dbo, $t_group_subject, $condition, $order_by, $type);
$page_total = $dbo->totalPage;
//分页总数
//显示控制
$isset_data = "";
$none_data = "content_none";
$isNull = 0;
if (empty($subject_rs)) {
    $isNull = 1;
    $isset_data = "content_none";
    $none_data = "";
}
开发者ID:omusico,项目名称:Social,代码行数:31,代码来源:search_subject.php


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