當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。