コード例 #1
0
ファイル: message_set.php プロジェクト: omusico/Social
function message_set_remind($touid, $content, $link, $type, $is_focus)
{
    $uid = get_sess_userid();
    $userico = get_sess_userico();
    $uname = get_sess_username();
    global $tablePreStr;
    $t_remind = $tablePreStr . "remind";
    $dbo = new dbex();
    dbplugin('w');
    $content = htmlspecialchars_decode($content);
    $link = htmlspecialchars_decode($link);
    if ($is_focus == 0) {
        $update_con = " and type_id = {$type} ";
    } else {
        $update_con = " and link = '{$link}' ";
    }
    $sql_check = " select id from {$t_remind} where user_id={$touid} {$update_con} ";
    $is_set = $dbo->getRow($sql_check);
    if (empty($is_set)) {
        $sql = " insert into {$t_remind} (user_id,type_id,date,content,is_focus,from_uid,from_uname,from_uico,link) values ({$touid},{$type},NOW(),'{$content}',{$is_focus},{$uid},'{$uname}','{$userico}','{$link}') ";
    } else {
        $sql = " update {$t_remind} set count = count+1,date = NOW() where user_id = {$touid} {$update_con} ";
    }
    return $dbo->exeUpdate($sql);
}
コード例 #2
0
ファイル: user_get.php プロジェクト: omusico/Social
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'];
}
コード例 #3
0
ファイル: user_self.php プロジェクト: omusico/Social
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'];
}
コード例 #4
0
ファイル: produce_rand.php プロジェクト: omusico/Social
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;
            }
        }
    }
}
コード例 #5
0
ファイル: message_get.php プロジェクト: omusico/Social
function message_get_remind_count($uid = '')
{
    $uid = intval($uid);
    $result_rs = array();
    $dbo = new dbex();
    dbplugin('r');
    $uid = $uid ? $uid : get_sess_userid();
    global $tablePreStr;
    $t_remind = $tablePreStr . "remind";
    $sql = "select count(*) from {$t_remind} where user_id={$uid} and is_focus=1";
    return $dbo->getRow($sql);
}
コード例 #6
0
ファイル: trans_pri.php プロジェクト: omusico/Social
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;
    }
}
コード例 #7
0
ファイル: ftag.php プロジェクト: omusico/Social
function tag_del($tag_data)
{
    if ($tag_data) {
        global $tablePreStr;
        global $dbo;
        $table = $tablePreStr . "tag";
        $dbo = new dbex();
        dbplugin('w');
        foreach ($tag_data as $rs) {
            $sql = "select count from {$table} where id={$rs}";
            $tag_info = $dbo->getRow($sql);
            if ($tag_info['count'] == 1) {
                $sql = "delete from {$table} where id={$rs}";
                $dbo->exeUpdate($sql);
            } else {
                $sql = "update {$table} set count=count-1 where id={$rs}";
                $dbo->exeUpdate($sql);
            }
        }
    }
}
コード例 #8
0
ファイル: rpshow.php プロジェクト: omusico/Social
    $reTurnTxt = $m_langpackage->m_out;
    $reTurnUrl = "modules.php?app=msg_moutbox";
    $mess_id = $msg_row['mess_id'];
    if ($msg_row['state'] == "0") {
        $reButTxt = $m_langpackage->m_b_sed;
        $reButUrl = "do.php?act=msg_send&to_id={$mess_id}";
    } else {
        $reButTxt = $m_langpackage->m_b_con;
        $reButUrl = $reTurnUrl;
    }
} else {
    $dbo = new dbex();
    //读写分离定义函数
    dbtarget('r', $dbServs);
    $sql = "select mess_title,mess_content,from_user_id,from_user,from_user_ico,add_time,mesinit_id,mess_id,readed " . "from {$t_msg_inbox} where mess_id='{$msg_id}'";
    $msg_row = $dbo->getRow($sql);
    $relaUserStr = $m_langpackage->m_from_user;
    $reTurnTxt = $m_langpackage->m_in;
    $reButTxt = $m_langpackage->m_b_com;
    $reTurnUrl = "modules.php?app=msg_minbox";
    $mess_id = $msg_row['mess_id'];
    $from_user_id = $msg_row['from_user_id'];
    $mess_title = $msg_row['mess_title'];
    $mesint_id = $msg_row['mesinit_id'];
    $reButUrl = "modules.php?app=msg_creator&2id={$from_user_id}&rt=" . urlencode($mess_title);
    if ($type == '2') {
        $send_join_js = "mypals_add({$from_user_id});";
        $reTurnUrl = "modules.php?app=msg_notice";
        $reButTxt = $m_langpackage->m_b_bak;
        $reTurnTxt = $m_langpackage->m_to_notice;
        $reButUrl = $reTurnUrl;
コード例 #9
0
ファイル: user_reg.php プロジェクト: omusico/Social
if ($allowReg == false) {
    $is_show = 0;
    $error_str = $u_langpackage->u_not_open_register;
} else {
    if ($inviteCode == 1) {
        $invite_code = get_argg('invite_code');
        if (strlen($invite_code) == $inviteCodeLength) {
            $t_invite_code = $tablePreStr . "invite_code";
            $dbo = new dbex();
            dbtarget('r', $dbServs);
            $now_time = time();
            $left_time = $inviteCodeLife * 60 * 60;
            $sql = "delete from {$t_invite_code} where {$now_time}-add_time > {$left_time}";
            $dbo->exeUpdate($sql);
            $sql = "select id from {$t_invite_code} where code_txt='{$invite_code}'";
            $is_check = $dbo->getRow($sql);
            if (empty($is_check)) {
                $error_str = $u_langpackage->u_invite_incorrect_or_failed;
                $is_show = 0;
            } else {
                $is_show = 1;
            }
        } else {
            $is_show = 0;
            $error_str = $u_langpackage->u_need_invite_register;
        }
    }
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
コード例 #10
0
ファイル: photo_del.action.php プロジェクト: omusico/Social
    }
} else {
    //变量取得
    if (empty($photo_id)) {
        $photo_id = intval(get_argg('pid'));
        $album_id = intval(get_argg('aid'));
        $user_id = intval(get_argg('uid'));
    }
    //数据表定义区
    $t_album = $tablePreStr . "album";
    $t_photo = $tablePreStr . "photo";
    $dbo = new dbex();
    //读写分离定义函数
    dbtarget('r', $dbServs);
    $sql = "select * from {$t_photo} where photo_id={$photo_id}";
    $photo_row = $dbo->getRow($sql);
    $album_id = $photo_row['album_id'];
    $sql = "select * from {$t_album} where album_id={$album_id}";
    $album_row = $dbo->getRow($sql);
    //读写分离定义函数
    dbtarget('w', $dbServs);
    //删除照片
    if ($album_row['album_skin'] == $photo_row['photo_thumb_src']) {
        $album_skin = 'uploadfiles/album/logo.jpg';
        $sql = "update {$t_album} set album_skin = '{$album_skin}' where album_id={$album_id}";
        $dbo->exeUpdate($sql);
    }
    @unlink('../' . $photo_row['photo_src']);
    @unlink('../' . $photo_row['photo_thumb_src']);
    $sql = "delete from {$t_photo} where photo_id={$photo_row['photo_id']}";
    if ($dbo->exeUpdate($sql)) {
コード例 #11
0
ファイル: report_add.action.php プロジェクト: omusico/Social
//数据表定义区
$t_report = $tablePreStr . "report";
//引入语言包
$rp_langpackage = new reportlp();
$dbo = new dbex();
//变量区
$type = intval(get_argg('type'));
$user_id = get_sess_userid();
$user_name = get_sess_username();
$userd_id = intval(get_argg('uid'));
$reason = short_check(get_argp('reason'));
$mod_id = intval(get_argg('mod_id'));
$t_report = $tablePreStr . "report";
dbtarget('r', $dbServs);
$sql = "select user_id from {$t_report} where reported_id={$mod_id} and type={$type}";
$report_row = $dbo->getRow($sql);
if ($report_row) {
    if ($user_id == $report_row['user_id']) {
        echo $rp_langpackage->rp_no_repeat;
        exit;
    } else {
        dbtarget('w', $dbServs);
        $sql = "update {$t_report} set rep_num=rep_num+1 where reported_id={$mod_id} and type={$type}";
        if ($dbo->exeUpdate($sql)) {
            echo 'true';
        } else {
            echo $rp_langpackage->rp_los;
            exit;
        }
    }
} else {
コード例 #12
0
ファイル: pals_self.php プロジェクト: omusico/Social
function pals_self_isset($holder_id, $pals_id = '')
{
    global $tablePreStr;
    $t_pals = $tablePreStr . "pals_mine";
    $result_rs = array();
    $pals_id = $pals_id ? $pals_id : get_sess_userid();
    if ($pals_id) {
        $dbo = new dbex();
        dbplugin('r');
        $sql = "select id from {$t_pals} where user_id={$holder_id} and pals_id={$pals_id}";
        $result_rs = $dbo->getRow($sql);
    } else {
        $result_rs = 0;
    }
    return $result_rs;
}
コード例 #13
0
ファイル: paper_get.php プロジェクト: omusico/Social
function paper_get_is_owned_user($user_id, $paper_id)
{
    global $tablePreStr;
    $t_papers = $tablePreStr . "papers";
    //评论类型
    $comment_type = 1;
    $result_rs = array();
    $dbo = new dbex();
    dbplugin('r');
    $sql = "select * from {$t_papers} where paper_id={$paper_id} and user_id={$user_id}";
    $result_rs = $dbo->getRow($sql);
    return empty($result_rs) ? 0 : 1;
}
コード例 #14
0
ファイル: user_info.php プロジェクト: omusico/Social
<?php

require "session_check.php";
$user_id = get_argg('user_id');
$dbo = new dbex();
dbtarget('w', $dbServs);
//引入语言包
$m_langpackage = new modulelp();
$ad_langpackage = new adminmenulp();
//表定义区
$t_users = $tablePreStr . "users";
$sql = "select user_name,user_ico,user_marry,user_qq,user_blood,birth_province,birth_year, birth_city ,reside_province , reside_city,user_email from {$t_users} where user_id='{$user_id}'";
$member_info = $dbo->getRow($sql);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" media="all" href="css/admin.css">
</head>

<body>
<div id="maincontent">
    <div class="wrap">
        <div class="infobox">
            <h3><?php 
echo $member_info['user_name'];
echo $m_langpackage->m_information;
?>
</h3>
            <div class="content">
コード例 #15
0
ファイル: album_del.action.php プロジェクト: omusico/Social
//判断是否批量删除
if (get_argp('checkany')) {
    //批量
    $dbo = new dbex();
    dbtarget('r', $dbServs);
    dbtarget('w', $dbServs);
    $album_ids = get_argp('checkany');
    foreach ($album_ids as $rs) {
        $t_album = $tablePreStr . "album";
        $t_photo = $tablePreStr . "photo";
        $t_photo_comment = $tablePreStr . "photo_comment";
        $t_album_comment = $tablePreStr . "album_comment";
        $sql = "select * from {$t_photo} where album_id={$rs}";
        $photo_rs = $dbo->getRs($sql);
        $sql = "select * from {$t_album} where album_id={$rs}";
        $user_id = $dbo->getRow($sql);
        foreach ($photo_rs as $val) {
            @unlink('../' . $val['photo_src']);
            @unlink('../' . $val['photo_thumb_src']);
            increase_integral($dbo, $int_del_photo, $user_id);
            //删除照片相关评论
            $photo_id = $val['photo_id'];
            $sql = "delete from {$t_photo_comment} where photo_id ={$photo_id}";
            $dbo->exeUpdate($sql);
        }
        //删除相册有关照片
        $sql = "delete from {$t_photo} where album_id={$rs}";
        $dbo->exeUpdate($sql);
        //删除相册相关评论
        $sql = "delete from {$t_album_comment} where album_id={$rs}";
        $dbo->exeUpdate($sql);
コード例 #16
0
ファイル: comment_add.action.php プロジェクト: omusico/Social
$commenter_id = get_sess_userid();
if (empty($commenter_id)) {
    header("location:error.php");
    exit;
}
$paper_id = get_argp("paper_id");
//数据表定义区
$t_comments = $tablePreStr . "comments";
$t_papers = $tablePreStr . "papers";
$current_time = date('y-m-d H:i:s', time());
$dbo = new dbex();
//增加评论数
//insert into isns_papers (user_id, content, picture, create_time) value (1, '纸条内容', '纸条路径', '2015-08-12 15:57:12');
dbplugin('r');
$get_comment_count_sql = "select {$t_papers}.comment_count,{$t_papers}.private_count from {$t_papers} where {$t_papers}.paper_id={$paper_id}";
$result_rs = $dbo->getRow($get_comment_count_sql);
$comment_count = $result_rs['comment_count'];
$private_count = $result_rs['private_count'];
if ($comment_type == 0) {
    $comment_count += 1;
} else {
    $private_count += 1;
}
//读写分离定义函数
dbtarget('w', $dbServs);
/* update isns_papers set isns_papers.comment_count = 3 where isns_papers.paper_id=111114; */
$update_comment_count_sql = "update {$t_papers} set {$t_papers}.comment_count={$comment_count},{$t_papers}.private_count={$private_count} where {$t_papers}.paper_id={$paper_id}";
if ($dbo->exeUpdate($update_comment_count_sql)) {
    //插入纸条评论
    //insert into isns_comments (paper_id, comment_content, commenter_id, comment_time, comment_status, comment_type)
    //value (1111111, "abc", 1, '2015-08-05 22:39:12', 0, 1);
コード例 #17
0
ファイル: mess_del.action.php プロジェクト: omusico/Social
}
//语言包引入
$m_langpackage = new modulelp();
//判断是否批量删除
if (get_argp('checkany')) {
    //批量
    $dbo = new dbex();
    dbtarget('r', $dbServs);
    dbtarget('w', $dbServs);
    $mess_ids = get_argp('checkany');
    //数据表定义
    $t_table = $tablePreStr . "msgboard";
    foreach ($mess_ids as $rs) {
        //变量取得
        $sql = "select * from {$t_table} where mess_id={$rs}";
        $msgboards = $dbo->getRow($sql);
        $fu_id = $msgboards['from_user_id'];
        $to_uid = $msgboards['to_user_id'];
        //删除留言
        $sql = "delete from {$t_table} where mess_id={$rs}";
        if ($dbo->exeUpdate($sql)) {
            increase_integral($dbo, $int_del_com_msg, $fu_id);
        }
    }
} else {
    //单条
    //变量取得
    $mess_id = intval(get_argg('mid'));
    $fu_id = intval(get_argg('fu_id'));
    $to_uid = intval(get_argg('to_uid'));
    //数据表定义区
コード例 #18
0
ファイル: my.php プロジェクト: mafergomez70/micro-power
 $dbo = new dbex($dbServs);
 // 确定参数data的值
 if (!isset($_GET['data'])) {
     $data = 'action';
 } else {
     $data = $_GET['data'];
     if ('change' != $data && 'basic' != $data && 'money' != $data && 'action' != $data) {
         $data = 'action';
     }
 }
 switch ($data) {
     case 'change':
         break;
     case 'money':
         $sql = "select task_taken, task_finished, total_money, realtime_money from user where user_id = '{$_SESSION['uid']}'";
         $res = $dbo->getRow($sql);
         $task_taken = $res['task_taken'];
         $task_finished = $res['task_finished'];
         $total_user_money = price_db_to_user($res['total_money']);
         $realtime_user_money = price_db_to_user($res['realtime_money']);
         break;
     case 'basic':
         // case 'basic'
         $sql = "select email, pro, con, reg_time from user where user_id = '{$_SESSION['uid']}' limit 1";
         $res = $dbo->getRow($sql);
         $email = $res['email'];
         $pro = $res['pro'];
         $con = $res['con'];
         $reg_time = $res['reg_time'];
         break;
     default:
コード例 #19
0
ファイル: group_manager.php プロジェクト: omusico/Social
$ad_langpackage = new adminmenulp();
if (get_session('admin_group') != 'superadmin') {
    echo $ri_langpackage->ri_refuse;
    exit;
}
//数据库读写
$dbo = new dbex();
dbtarget('w', $dbServs);
//变量定义区
$t_backgroup = $tablePreStr . "backgroup";
$id = get_args('id');
$value = get_args('value');
$elements = array();
if (get_args("add")) {
    $sql = "select * from {$t_backgroup} where gid='{$id}'";
    $group = $dbo->getRow($sql);
    if (!$group) {
        $sql = "insert into {$t_backgroup}(gid,name)values('{$id}','{$value}')";
        $dbo->exeUpdate($sql);
    } else {
        echo $ri_langpackage->ri_isset_id;
        exit;
    }
} else {
    if (get_args('del') == 'del') {
        $sql = "delete from {$t_backgroup} where gid='{$id}'";
        $dbo->exeUpdate($sql);
    } else {
        if (get_args('update')) {
            $sql = "update {$t_backgroup} set name='{$value}' where gid='{$id}'";
            $dbo->exeUpdate($sql);
コード例 #20
0
ファイル: show_ico_cut.php プロジェクト: omusico/Social
    exit;
}
//语言包引入
$f_langpackage = new foundationlp();
$m_langpackage = new modulelp();
$a_langpackage = new albumlp();
$ad_langpackage = new adminmenulp();
$user_id = intval(get_argg('user_id'));
//表定义区
$t_users = $tablePreStr . "users";
$t_album = $tablePreStr . "album";
$t_recommend = $tablePreStr . "recommend";
$dbo = new dbex();
dbtarget('r', $dbServs);
$sql = "select user_name , user_ico , show_ico from {$t_recommend} where user_id={$user_id}";
$user_row = $dbo->getRow($sql);
$album_rs = api_proxy("album_self_by_uid", "album_id,album_name", $user_id);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title><?php 
echo $m_langpackage->m_member_list;
?>
</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" type="text/css" href="css/admin.css">
<script type='text/javascript' src='../servtools/ajax_client/ajax.js'></script>
</head>
<body>
<div id="maincontent">
コード例 #21
0
//数据表
$t_photo = $tablePreStr . "photo";
$t_album = $tablePreStr . "album";
$t_online = $tablePreStr . "online";
$t_tmp_file = $tablePreStr . "tmp_file";
$dbo = new dbex();
//读写分离定义函数
dbtarget('r', $dbServs);
//验证用户权限
if (empty($session_code)) {
    $success = "false";
    exit;
}
$code_array = explode("|", $session_code);
$sql = "select user_id,user_name,user_ico,session_code from {$t_online} where user_id={$code_array['1']}";
$user_row = $dbo->getRow($sql);
if (empty($user_row)) {
    $success = "false";
    exit;
}
if ($user_row['session_code'] != $code_array[0]) {
    $success = "false";
    exit;
}
$user_id = $user_row['user_id'];
$user_name = $user_row['user_name'];
$uico_url = $user_row['user_ico'];
function return_result($success, $errors, $data)
{
    echo "<?xml version=\"1.0\" encoding=\"utf-8\"?>";
    echo '<results><success>' . $success . '</success>';
コード例 #22
0
ファイル: admin_manager.php プロジェクト: omusico/Social
        if (get_args('op') == 'lock') {
            $id = get_args('id');
            dbtarget('w', $dbServs);
            $sql = "update  {$t_admin} set is_pass=if(is_pass=1,0,1) where admin_id={$id}";
            $dbo->exeUpdate($sql);
        } else {
            if (get_args('op') == 'add') {
                $name = get_args('name');
                $password = md5(get_args('password'));
                $repassword = md5(get_args('repassword'));
                $group = get_args('group');
                if ($name && $password && $group) {
                    if ($password == $repassword) {
                        dbtarget('r', $dbServs);
                        $sql = "select * from {$t_admin} where admin_name='{$name}'";
                        $admin = $dbo->getRow($sql);
                        if (!$admin) {
                            dbtarget('w', $dbServs);
                            $sql = "insert into {$t_admin} (admin_name,admin_password,active_time,admin_group) values('{$name}','{$password}',now(),'{$group}')";
                            $dbo->exeUpdate($sql);
                        } else {
                            echo $ri_langpackage->ri_isset_user;
                        }
                    } else {
                        echo "<script>alert('" . $p_langpackage->p_differ . "')</script>";
                    }
                }
            }
        }
    }
}
コード例 #23
0
ファイル: get_restore.php プロジェクト: omusico/Social
    case "6":
        $t_table = $t_mood;
        $t_table_com = $t_mood_comment;
        $mod_col = "mood_id";
        break;
    default:
        echo 'error';
        break;
}
$function = "parent.get_mod_com(" . $type_id . "," . $mod_id . "," . intval($show_num + $start_num) . ",10);document.getElementById('page_" . $type_id . "_" . $mod_id . "').parentNode.style.display='none';document.getElementById('page_" . $type_id . "_" . $mod_id . "').parentNode.innerHTML='';";
$visitor_id = get_sess_userid();
$info_row = array();
$com_rs = array();
$show_str = intval($start_num + $show_num);
$sql = "select comments,user_id from {$t_table} where {$mod_col}={$mod_id}";
$info_row = $dbo->getRow($sql);
$is_show = 0;
if ($info_row['comments'] > 0) {
    $is_show = 1;
    $sql = "select * from {$t_table_com} where {$mod_col}={$mod_id} order by `comment_id` desc limit {$start_num},{$show_num}";
    $com_rs = $dbo->getRs($sql);
    if ($info_row['comments'] <= $start_num + $show_num) {
        $show_str = intval($info_row['comments']);
        $function = "void(0)";
    }
}
if ($is_show == 1) {
    ?>
	<?php 
    foreach ($com_rs as $rs) {
        ?>
コード例 #24
0
ファイル: photo_update.php プロジェクト: omusico/Social
$a_langpackage = new albumlp();
require "foundation/auser_mustlogin.php";
require "api/base_support.php";
//变量取得
$album_id = intval(get_argg('album_id'));
$user_id = get_sess_userid();
$s_fs = get_session("S_fs");
$fs = array();
//表定义区
$t_tmp_file = $tablePreStr . "tmp_file";
$album_row = api_proxy("album_self_by_aid", "privacy,album_name", $album_id);
if (empty($s_fs)) {
    $dbo = new dbex();
    dbtarget('r', $dbServs);
    $sql = "select data_array from {$t_tmp_file} where mod_id={$album_id}";
    $session_data = $dbo->getRow($sql);
    $fs = unserialize($session_data['data_array']);
    $sql = "delete from {$t_tmp_file} where mod_id={$album_id}";
    $dbo->exeUpdate($sql);
} else {
    $fs = $s_fs;
    set_session("S_fs", '');
}
if ($fs) {
    //新鲜事
    if ($album_row['privacy'] == '') {
        $show_limit = 0;
        $content = '';
        foreach ($fs as $val) {
            if ($show_limit == 4) {
                break;
コード例 #25
0
ファイル: check_login.php プロジェクト: omusico/Social
header("content-type:text/html;charset=utf-8");
require "../foundation/asession.php";
require "../configuration.php";
require "includes.php";
//语言包引入
$l_langpackage = new loginlp();
//表定义区
$t_admin = $tablePreStr . "admin";
$t_backgroup = $tablePreStr . "backgroup";
$admin_name = short_check(get_argp('admin_name'));
$admin_password = short_check(get_argp('admin_password'));
$dbo = new dbex();
dbtarget('w', $dbServs);
$sql = " select * from {$t_admin} where admin_name='{$admin_name}' and is_pass=1 ";
$admin_info = $dbo->getRow($sql);
if ($admin_info['admin_name'] == $admin_name && $admin_password == $admin_info['admin_password']) {
    echo "<script type='text/javascript' src='servtools/rpc.js'></script>";
    set_session('admin_id', $admin_info['admin_id']);
    set_session('admin_group', $admin_info['admin_group']);
    if ($admin_info['admin_group'] != 'superadmin') {
        $sql = "select rights from {$t_backgroup} where gid='{$admin_info['admin_group']}'";
        $rights = $dbo->getRow($sql);
        if ($rights) {
            set_session('rights', $rights['rights']);
        }
    }
    set_sess_admin($admin_info['admin_name']);
    sleep(1);
    echo "<script type='text/javascript'>window.location.href='main.php';</script>";
} else {
コード例 #26
0
ファイル: pic_cut.php プロジェクト: omusico/Social
require "../foundation/module_album.php";
//语言包引入
$u_langpackage = new userslp();
$f_langpackage = new foundationlp();
$m_langpackage = new modulelp();
$ad_langpackage = new adminmenulp();
//变量获得
$photo_url = short_check(get_argg('photo_url'));
$user_id = intval(get_argg('user_id'));
$img_info = getimagesize('../' . $photo_url);
//表定义
$t_recommend = $tablePreStr . "recommend";
$dbo = new dbex();
dbtarget('w', $dbServs);
$sql = "select show_ico from {$t_recommend} where user_id={$user_id}";
$recom = $dbo->getRow($sql);
$recom_ico = $recom['show_ico'];
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="UTF-8">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<link rel="stylesheet" type="text/css" media="all" href="css/admin.css">
<script type="text/javascript" src="img_cut/prototype.js"></script>
<script type="text/javascript" src="img_cut/drag.js"></script>
<script type="text/javascript" src="img_cut/cut_image.js"></script>

<style type="text/css">
*{ margin:0; padding:0;}
#wrapper{ clear:both;margin:10px; padding:0;}
コード例 #27
0
ファイル: poll_submit.action.php プロジェクト: omusico/Social
if (empty($anon)) {
    $anon = 0;
}
if (empty($cho)) {
    action_return(0, "{$pol_langpackage->pol_error}", -1);
}
//数据表定义区
$t_poll = $tablePreStr . "poll";
$t_polloption = $tablePreStr . "polloption";
$t_polluser = $tablePreStr . "polluser";
$t_users = $tablePreStr . "users";
//定义写操作
dbtarget('r', $dbServs);
$dbo = new dbex();
$sql = "select username from {$t_polluser} where uid={$ses_uid} and pid={$pid}";
$is_poll = $dbo->getRow($sql);
if (!empty($is_poll)) {
    action_return(0, "{$pol_langpackage->pol_repeat}", -1);
}
$option = '';
foreach ($cho as $v) {
    $option .= "," . $v;
}
$sql = "select `option` from {$t_polloption} where oid in(0.{$option})";
$option_rs = $dbo->getRs($sql);
$cho_str = '';
foreach ($option_rs as $val) {
    $cho_str .= "\"" . $val['option'] . "\",";
}
//定义写操作
dbtarget('w', $dbServs);
コード例 #28
0
ファイル: album_lock.action.php プロジェクト: omusico/Social
require "session_check.php";
require "../api/base_support.php";
$is_check = check_rights("c24");
if (!$is_check) {
    echo $m_langpackage->m_no_pri;
    exit;
}
//变量区
$album_id = intval(get_argg('album_id'));
$type_value = short_check(get_argg('type_value'));
$dbo = new dbex();
dbtarget('w', $dbServs);
//表定义区
$t_album = $tablePreStr . "album";
$t_photo = $tablePreStr . "photo";
$sql = "update {$t_album} set is_pass={$type_value} where album_id={$album_id}";
$dbo->exeUpdate($sql);
$sql = "update {$t_photo} set is_pass={$type_value} where album_id={$album_id}";
$dbo->exeUpdate($sql);
//发送锁定通知
if ($type_value == 0) {
    $sql = "select album_info,user_name,user_id from {$t_album} where album_id='{$album_id}'";
    $notice = $dbo->getRow($sql);
    $title = "您的" . $notice['album_info'] . "相册已被锁定";
    $scrip_content = $notice['user_name'] . ",您的相册" . $notice['album_info'] . "因违反本站协议已被锁定,请您尽快修改,否则由管理员对您的信息进行修改和删除等操作所产生的一切后果,将由您自己承担。";
    $is_success = api_proxy('scrip_send', "系统发送", $title, $scrip_content, $notice['user_id'], 0);
    if ($is_success) {
        api_proxy("message_set", $notice['user_id'], "{num}个通知", "modules.php?app=msg_notice", 0, 1, "remind");
    }
}
コード例 #29
0
}
// 通过api查询当前用户最近转发的微博id
//var_dump($sql_res);
echo '<hr />';
$c = new SaeTClientV2(WB_AKEY, WB_SKEY, $_SESSION['stoken']);
echo '<h3>用新浪api获取我最近转发的微博mid</h3>';
$repost_weibos = $c->repost_by_me(1, 9, 3430446513991533);
if (!$repost_weibos || 0 === $repost_weibos['total_number']) {
    // 我最近转发的微博都不存在了
    echo '<p>我最近转发的微博全都不在了<sub>或者repost_by_me没有获取到</sub></p>';
    $fail_tasks = $task_weibo_mids;
} else {
    $real_weibo_mids = array();
    foreach ($repost_weibos['reposts'] as $weibo) {
        //echo $weibo['retweeted_status']['mid'].'<br />';
        echo $weibo['mid'] . ' -- ' . $weibo['text'] . ' on <sub>' . $weibo['created_at'] . '</sub><br />';
        $real_weibo_mids[] = $weibo['mid'];
    }
    $fail_tasks = array_diff($task_weibo_mids, $real_weibo_mids);
}
echo '<hr />';
echo '<h3>出问题的任务(可能是我删除了这条微博)</h3>';
if (0 == count($fail_tasks)) {
    echo '<p>NONE</p>';
} else {
    foreach ($fail_tasks as $k => $v) {
        $sql = "select task_text from task where task_id = {$k} limit 1";
        $sql_res = $dbo->getRow($sql);
        echo 'task_id:' . $k . ' weibo_mid: ' . $v . '<br /> text:' . $sql_res['task_text'] . '</p>';
    }
}
コード例 #30
0
ファイル: login_act.php プロジェクト: omusico/Social
//用户名已经记录了
$user_pws = md5(get_argp("u_pws"));
//密码已经记录了
$hidden = intval(get_argp('hidden'));
//登录方式
//数据表定义区
$t_users = $tablePreStr . "users";
$t_group_members = $tablePreStr . "group_members";
$t_online = $tablePreStr . "online";
$t_mypals = $tablePreStr . "pals_mine";
$t_frontgroup = $tablePreStr . "frontgroup";
//定义读操作
dbtarget('r', $dbServs);
$dbo = new dbex();
$sql = "select * from {$t_users} where user_email='{$u_email}'";
$user_info = $dbo->getRow($sql);
if (empty($user_info)) {
    echo 'emailmsg|' . $l_langpackage->l_not_check;
    exit;
}
$get_pws = $user_info['user_pws'];
if ($get_pws != $user_pws) {
    echo 'pwdmsg|' . $l_langpackage->l_wrong_pass;
    exit;
}
if ($user_info['is_pass'] == 0) {
    echo 'emailmsg|' . $l_langpackage->l_lock_u;
    exit;
}
$mypals = getMypals($dbo, $user_info['user_id'], $t_mypals);
set_sess_mypals($mypals);