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


PHP dbplugin函数代码示例

本文整理汇总了PHP中dbplugin函数的典型用法代码示例。如果您正苦于以下问题:PHP dbplugin函数的具体用法?PHP dbplugin怎么用?PHP dbplugin使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: 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

示例2: 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

示例3: plugins_set_mine

function plugins_set_mine($id, $is_del = 0)
{
    $id = intval($id);
    $is_del = intval($is_del);
    $val = '';
    $uid = get_sess_userid();
    global $tablePreStr;
    $t_users = $tablePreStr . "users";
    $t_plugins = $tablePreStr . "plugins";
    $result_rs = array();
    $dbo = new dbex();
    dbplugin('r');
    $u_apps = get_sess_apps();
    if ($is_del == 0) {
        if ($u_apps == '') {
            $val = $id;
        } else {
            $val = $u_apps . "," . $id;
        }
    } else {
        $val = str_replace(",{$id},", "", ",{$u_apps},");
    }
    $sql = " update {$t_users} set use_apps = '{$val}' where user_id = {$uid} ";
    if ($dbo->exeUpdate($sql)) {
        set_sess_apps($val);
        if ($is_del == 0) {
            $sql = " update {$t_plugins} set use_num=use_num+1 where id={$id} ";
        } else {
            $sql = " update {$t_plugins} set use_num=use_num-1 where id={$id} ";
        }
        return $dbo->exeUpdate($sql);
    } else {
        return 0;
    }
}
开发者ID:omusico,项目名称:Social,代码行数:35,代码来源:plugins_set.php

示例4: inbox_read_base

function inbox_read_base($fields = "*", $condition = "", $get_type = "", $num = "", $by_col = "mess_id", $order = "desc", $cache = "", $cache_key = "")
{
    global $tablePreStr;
    global $page_num;
    global $page_total;
    $uid = get_sess_userid();
    $t_scrip = $tablePreStr . "msg_inbox";
    $result_rs = array();
    $dbo = new dbex();
    dbplugin('r');
    $by_col = $by_col ? " {$by_col} " : " mess_id ";
    $order = $order ? $order : "desc";
    $get_type = $get_type == 'getRow' ? "getRow" : "getRs";
    $sql = " select {$fields} from {$t_scrip} where user_id = {$uid} and mesinit_id!='' {$condition} order by {$by_col} {$order} ";
    if ($cache == 1 && $cache_key != '') {
        $key = 'inbox_' . $cache_key . $uid . '_' . $num;
        $key_mt = 'inbox_' . $cache_key . 'mt_' . $uid . '_' . $num;
        $result_rs = model_cache($key, $key_mt, $dbo, $sql, $get_type);
    }
    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,代码行数:26,代码来源:scrip_inbox.php

示例5: msgboard_set

function msgboard_set($to_user_id)
{
    global $tablePreStr;
    $dbo = new dbex();
    dbplugin('w');
    $t_message = $tablePreStr . "msgboard";
    $sql = "update {$t_message} set readed=1 where to_user_id='{$to_user_id}'";
    $dbo->exeUpdate($sql);
}
开发者ID:omusico,项目名称:Social,代码行数:9,代码来源:msgboard_set.php

示例6: user_get_user_point

function user_get_user_point($user_id)
{
    global $tablePreStr;
    $t_users = $tablePreStr . "users";
    $result_rs = array();
    $dbo = new dbex();
    dbplugin('r');
    $sql = "select user_point from {$t_users} where user_id={$user_id}";
    $result_rs = $dbo->getRow($sql);
    return $result_rs['user_point'];
}
开发者ID:omusico,项目名称:Social,代码行数:11,代码来源:user_get.php

示例7: user_self_by_total

function user_self_by_total()
{
    global $tablePreStr;
    $t_user = $tablePreStr . "users";
    $result_rs = array();
    $dbo = new dbex();
    dbplugin('r');
    $sql = "select count(*) as total from {$t_user}";
    $result_rs = $dbo->getRow($sql);
    return $result_rs['total'];
}
开发者ID:omusico,项目名称:Social,代码行数:11,代码来源:user_self.php

示例8: scrip_send

function scrip_send($sender, $title, $content, $to_id, $scrip_id = '')
{
    global $tablePreStr;
    $uid = get_sess_userid();
    $uico = get_sess_userico();
    $t_scrip = $tablePreStr . "msg_inbox";
    $dbo = new dbex();
    dbplugin('w');
    $sql = "insert into {$t_scrip} (mess_title,mess_content,from_user,from_user_ico,user_id,add_time,from_user_id,mesinit_id)" . "value('{$title}','{$content}','{$sender}','{$uico}',{$to_id},NOW(),{$uid},'{$scrip_id}')";
    return $dbo->exeUpdate($sql);
}
开发者ID:omusico,项目名称:Social,代码行数:11,代码来源:scrip_send.php

示例9: blog_sort_by_uid

function blog_sort_by_uid($id)
{
    global $tablePreStr;
    $t_blog = $tablePreStr . "blog_sort";
    $id = intval($id);
    $result_rs = array();
    $dbo = new dbex();
    dbplugin('r');
    $sql = " select * from {$t_blog} where user_id = {$id} ";
    $result_rs = $dbo->getRs($sql);
    return $result_rs;
}
开发者ID:omusico,项目名称:Social,代码行数:12,代码来源:blog_sort.php

示例10: user_set_update_user_point

function user_set_update_user_point($user_id, $user_point)
{
    global $tablePreStr;
    $t_users = $tablePreStr . "users";
    $result_rs = array();
    $dbo = new dbex();
    dbplugin('w');
    //update isns_users set user_point=2000 where user_id=1;
    $sql = "update {$t_users} set user_point={$user_point} where user_id={$user_id}";
    $result_rs = $dbo->exeUpdate($sql);
    return $result_rs;
}
开发者ID:omusico,项目名称:Social,代码行数:12,代码来源:user_set.php

示例11: code_exists

function code_exists()
{
    $is_admin = '';
    $sendor_id = '';
    $admin_id = get_session('admin_id');
    if ($admin_id) {
        $is_admin = 1;
        $sendor_id = $admin_id;
    } else {
        $user_id = get_sess_userid();
        if (!$user_id) {
            return false;
            exit;
        }
        $is_admin = 0;
        $sendor_id = $user_id;
    }
    if ($sendor_id != '' && $is_admin !== '') {
        global $inviteCodeValue;
        global $tablePreStr;
        global $inviteCodeLength;
        $t_invite_code = $tablePreStr . "invite_code";
        $t_users = $tablePreStr . "users";
        if ($is_admin == 0) {
            $user_info = api_proxy('user_self_by_uid', 'integral', $sendor_id);
            $intg = $user_info['integral'];
            if ($inviteCodeValue > $intg) {
                return false;
            }
        }
        $dbo = new dbex();
        dbplugin('r');
        $invite_code = randkeys($inviteCodeLength);
        $sql = "select id from {$t_invite_code} where code_txt='{$invite_code}'";
        $is_exists = $dbo->getRow($sql);
        if ($is_exists['id']) {
            code_exists();
        } else {
            $time = time();
            $sql = "insert into {$t_invite_code} (sendor_id,code_txt,is_admin,add_time) values({$sendor_id},'{$invite_code}',0,{$time})";
            $success = $dbo->exeUpdate($sql);
            if ($success) {
                if ($is_admin == 0) {
                    $sql = "update {$t_users} set integral=integral-{$inviteCodeValue} where user_id={$sendor_id}";
                    $dbo->exeUpdate($sql);
                }
                return $invite_code;
            } else {
                return false;
            }
        }
    }
}
开发者ID:omusico,项目名称:Social,代码行数:53,代码来源:produce_rand.php

示例12: money_set_add_user_money

function money_set_add_user_money($user_id, $consume_point, $exchange_datetime, $exchange_money)
{
    global $tablePreStr;
    $t_money = $tablePreStr . "money";
    $result_rs = array();
    $dbo = new dbex();
    dbplugin('w');
    //insert into isns_money (user_id, consume_point, exchange_datetime, exchange_money) value (1, 10, '2015-08-11 15:55:23', 33);
    $sql = "insert into {$t_money} (user_id, consume_point, exchange_datetime, exchange_money) \n\t\t\tvalue ({$user_id}, {$consume_point}, '{$exchange_datetime}', {$exchange_money})";
    $result_rs = $dbo->exeUpdate($sql);
    return $result_rs;
}
开发者ID:omusico,项目名称:Social,代码行数:12,代码来源:money_set.php

示例13: pals_sort_def

function pals_sort_def()
{
    global $tablePreStr;
    $t_pals_sort = $tablePreStr . "pals_def_sort";
    $result_rs = array();
    $dbo = new dbex();
    dbplugin('r');
    $sql = " select * from {$t_pals_sort} ";
    $key = "pals_def_sort/list/order_num/0/all";
    $key_mt = "pals_def_sort/list/order_num/0/all_mt";
    $result_rs = model_cache($key, $key_mt, $dbo, $sql);
    if (empty($result_rs)) {
        $result_rs = $dbo->getALL($sql);
    }
    return $result_rs;
}
开发者ID:omusico,项目名称:Social,代码行数:16,代码来源:pals_sort.php

示例14: group_sort_by_self

function group_sort_by_self()
{
    global $tablePreStr;
    $t_group_type = $tablePreStr . "group_type";
    $result_rs = array();
    $dbo = new dbex();
    dbplugin('r');
    $sql = "select * from {$t_group_type} order by order_num desc";
    $key = "group_sort/list/order_num/0/all";
    $key_mt = 'group_sort/list/order_num/0/all_mt';
    $result_rs = model_cache($key, $key_mt, $dbo, $sql);
    if (empty($result_rs)) {
        $result_rs = $dbo->getRs($sql);
    }
    return $result_rs;
}
开发者ID:omusico,项目名称:Social,代码行数:16,代码来源:group_sort.php

示例15: plugins_get_pid

function plugins_get_pid($id, $get_type = '')
{
    global $tablePreStr;
    $t_plugins = $tablePreStr . "plugins";
    $t_plugin_url = $tablePreStr . "plugin_url";
    $result_rs = array();
    $dbo = new dbex();
    dbplugin('r');
    $id_str = filt_num_array($id);
    $sql = "select a.*,b.url from {$t_plugins} as a join {$t_plugin_url} as b on (a.name=b.name) where a.id ={$id_str}";
    $get_type = $get_type ? $get_type : "getRow";
    if (strpos($id_str, ",")) {
        $sql = "select a.*,b.url from {$t_plugins} as a join {$t_plugin_url} as b on (a.name=b.name) where a.id in ({$id_str})";
        $get_type = "getRs";
    }
    return $dbo->{$get_type}($sql);
}
开发者ID:omusico,项目名称:Social,代码行数:17,代码来源:plugins_get.php


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