本文整理汇总了PHP中dbex类的典型用法代码示例。如果您正苦于以下问题:PHP dbex类的具体用法?PHP dbex怎么用?PHP dbex使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了dbex类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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: 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
示例3: 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
示例4: 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
示例5: 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
示例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: 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
示例9: 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
示例10: 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
示例11: 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
示例12: pals_sort
function pals_sort($uid = '')
{
$uid = intval($uid);
if ($uid == 0) {
$uid = get_sess_userid();
}
global $tablePreStr;
$t_pals_sort = $tablePreStr . "pals_sort";
$result_rs = array();
$dbo = new dbex();
dbplugin('r');
$sql = " select * from {$t_pals_sort} where user_id={$uid} ";
$result_rs = $dbo->getALL($sql);
return $result_rs;
}
开发者ID:omusico,项目名称:Social,代码行数:15,代码来源:pals_sort.php
示例13: 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
示例14: check_pri
function check_pri($holder, $exp = '')
{
$sess_uid = get_sess_userid();
$is_admin = get_sess_admin();
if ($sess_uid != $holder && !$is_admin) {
if ($exp) {
if (!$sess_uid) {
return false;
}
if ($exp == '!all') {
//全否定
return false;
}
if (strpos(",{$exp}", "{")) {
//限定人
$per_str = preg_replace("/{([,\\d]+)}/", "\$1", $exp);
if (strpos(",{$per_str}", ",{$sess_uid},")) {
return true;
}
}
if (strpos(",{$exp}", "[")) {
//限定组
$sort_str = preg_replace("/\\[([,\\d]+)\\]/", "\$1", $exp);
global $dbo;
global $tablePreStr;
global $dbServs;
if (!$dbo) {
$dbo = new dbex();
dbplugin('r');
}
$table = $tablePreStr . "pals_mine";
$sql = "select pals_sort_id from {$table} where pals_id={$sess_uid} and user_id={$holder}";
$sort_id = $dbo->getRow($sql);
$sess_sort_id = $sort_id['pals_sort_id'];
if (strpos(",{$sort_str}", ",{$sess_sort_id},")) {
return true;
}
}
} else {
return true;
}
} else {
return true;
}
}
开发者ID:omusico,项目名称:Social,代码行数:45,代码来源:trans_pri.php
示例15: message_get_affair_uid
function message_get_affair_uid($id, $type = '', $num = 20)
{
$limit = intval($num) ? " limit {$num} " : "";
$type_str = filt_num_array($type);
$id_str = filt_num_array($id);
$sql_type = "";
if ($type_str != '') {
$sql_type = " and mod_type in ({$type_str}) ";
}
global $tablePreStr;
$t_recent_affair = $tablePreStr . "recent_affair";
$result_rs = array();
$dbo = new dbex();
dbplugin('r');
$sql = "select * from {$t_recent_affair} where user_id in ({$id_str}) {$sql_type} order by id desc {$limit} ";
$result_rs = $dbo->getALL($sql);
return $result_rs;
}
开发者ID:omusico,项目名称:Social,代码行数:18,代码来源:message_get.php
示例16: group_self_by_pals
function group_self_by_pals($fields = "*")
{
$fields = filt_fields($fields);
$group_id_str = '';
global $tablePreStr;
$t_group_members = $tablePreStr . "group_members";
$result_rs = array();
$dbo = new dbex();
dbplugin('r');
$pals_id = get_sess_mypals();
$sql = " select group_id from {$t_group_members} where user_id in ({$pals_id}) ";
$group_data = $dbo->getRs($sql);
foreach ($group_data as $rs) {
$group_id_str .= $rs['group_id'] . ",";
}
$group_id_str = preg_replace("/,\$/", "", $group_id_str);
return group_self_by_gid($fields, $group_id_str);
}
开发者ID:omusico,项目名称:Social,代码行数:18,代码来源:group_self.php
示例17: 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
示例18: tag_relation
function tag_relation($mod_id, $tag_id, $content_id, $type = 'add')
{
global $tablePreStr;
global $dbo;
$dbo = new dbex();
dbplugin('w');
$table = $tablePreStr . "tag_relation";
$tag_id = explode(',', $tag_id);
foreach ($tag_id as $rs) {
if ($rs != '') {
if ($type == 'add') {
$sql = "insert into {$table} (`id`,`mod_id`,`content_id`) values ({$rs},{$mod_id},{$content_id})";
} else {
$sql = "delete from {$table} where content_id={$content_id} and id={$tag_id} and mod_id={$mod_id}";
}
if (!$dbo->exeUpdate($sql)) {
return 'error';
break;
}
}
}
}
开发者ID:omusico,项目名称:Social,代码行数:22,代码来源:ftag.php
示例19: header
require_once $webRoot . 'lib/saetv2.ex.class.php';
require_once $webRoot . 'lib/dbo.class.php';
require_once $webRoot . "foundation/status.php";
require_once $dbConfFile;
// init $dbServs
require_once $webRoot . 'foundation/debug.php';
if (!is_login()) {
header($siteRoot . "index.php");
exit;
}
echo '<p><sup>说明:<br />通过调用api <a href="http://open.weibo.com/wiki/2/statuses/repost_by_me">repost_by_me</a> 来获取当前用户最新转发微博列表.<br />然后比对数据库中当前用户的任务记录.<br />问题:<br />1. repost_by_me 只能用户登录时自己调用;<br />2. repost_by_me获取所谓‘最新转发’,但是具体时间并没有说明,测试结果也比较诡异。包括since_id和max_id,都有待进一步测试。</p>';
echo '<hr />';
// 按照用户检查转发任务,测试版
// 从数据库中取出当前用户做过的转发任务的mid(同id)
$uid = $_SESSION['uid'];
$dbo = new dbex($dbServs);
echo '<h3>我在微动力做转发任务产生的mid</h3>';
$sql = "select task_id, repost_mid, task_text from do_task JOIN task using(task_id) where user_id = {$uid} and status = 'finish' and type = 'forward' limit 10";
$sql_res = $dbo->getRs($sql);
$task_weibo_mids = array();
if (0 != count($sql_res)) {
foreach ($sql_res as $weibo) {
echo '任务微博 -- ' . $weibo['task_text'] . '。<br />转发产生的mid -- ' . $weibo['repost_mid'] . '</p>';
$task_weibo_mids[$weibo['task_id']] = $weibo['repost_mid'];
}
} else {
echo '<p>我最近没有在微动力上做任务</p>';
}
// 通过api查询当前用户最近转发的微博id
//var_dump($sql_res);
echo '<hr />';
开发者ID:mafergomez70,项目名称:micro-power,代码行数:31,代码来源:check_forward_draft2.php
示例20: modulelp
//语言包引入
$m_langpackage = new modulelp();
$ad_langpackage = new adminmenulp();
require "../foundation/fback_search.php";
$is_check = check_rights("c28");
if (!$is_check) {
echo $m_langpackage->m_no_pri;
exit;
}
$com_type_select = array("blog_comment" => $m_langpackage->m_blog, "group_subject_comment" => $m_langpackage->m_subject, "album_comment" => $m_langpackage->m_album, "photo_comment" => $m_langpackage->m_photo, "poll_comment" => $m_langpackage->m_poll, "share_comment" => $m_langpackage->m_share, "mood_comment" => $m_langpackage->m_mood);
$com_type = array("photo_comment" => "photo_id", "mood_comment" => "mood_id", "share_comment" => "s_id", "poll_comment" => "p_id", "group_subject_comment" => "subject_id", "album_comment" => "album_id", "blog_comment" => "log_id");
$idtype = get_argg('idtype');
$com_table_str = $idtype ? $idtype : "blog_comment";
$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);
开发者ID:omusico,项目名称:Social,代码行数:31,代码来源:comment_list.php
注:本文中的dbex类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论