Пример #1
0
<?php

//引入语言包
$mo_langpackage = new moodlp();
require "foundation/module_affair.php";
//变量取得
$mood_id = intval(get_argg('mood_id'));
$user_id = get_sess_userid();
//数据表定义区
$t_mood = $tablePreStr . "mood";
$t_mood_com = $tablePreStr . "mood_comment";
$dbo = new dbex();
//读写分离定义函数
dbtarget('w', $dbServs);
//删除心情
$sql = "delete from {$t_mood} where mood_id={$mood_id} and user_id={$user_id}";
$dbo->exeUpdate($sql);
$sql = "delete from {$t_mood_com} where mood_id={$mood_id}";
$dbo->exeUpdate($sql);
del_affair($dbo, 6, $mood_id);
//回应信息
action_return(1, "", "-1");
Пример #2
0
//读写分离定义函数
dbtarget('r', $dbServs);
//删除blog内部的图片
$blog_content = api_proxy("blog_self_by_bid", "log_content", $ulog_id);
$blog_content = $blog_content['log_content'];
preg_match_all("/classId=\"\\d\"/", $blog_content, $match);
$match = preg_replace("/[classId=,\"]/", '', $match[0]);
if (!empty($match)) {
    $match = join(",", $match);
    $sql = "select file_src from {$t_uploadfile} where id in ({$match})";
    $file_src = $dbo->getRs($sql);
    foreach ($file_src as $rs) {
        unlink($rs['file_src']);
    }
}
//定义写操作
dbtarget('w', $dbServs);
if (!empty($match)) {
    $sql = "delete from {$t_uploadfile} where id in ({$match})";
    $dbo->exeUpdate($sql);
}
$sql = "delete from {$t_blog} where log_id={$ulog_id} and user_id={$user_id}";
if ($dbo->exeUpdate($sql) && mysql_affected_rows() > 0) {
    $sql = "delete from {$t_blog_comments} where log_id={$ulog_id}";
    $dbo->exeUpdate($sql);
    increase_integral($dbo, $int_del_blog, $user_id);
    del_affair($dbo, 0, $ulog_id);
    action_return(1, '', 'modules.php?app=blog_list');
} else {
    action_return(0, $b_langpackage->b_del_false);
}
Пример #3
0
//读取方式
dbtarget('r', $dbServs);
$dbo = new dbex();
//读取用户信息
$my_creat_group = api_proxy("user_self_by_uid", "creat_group", $user_id);
$my_c_group = preg_replace("/,{$group_id},/", ",", $my_creat_group['creat_group']);
//读取群组数据
$group_data = api_proxy("group_self_by_gid", "group_logo", $group_id);
//卸载群组logo
@unlink($group_data['group_logo']);
//写入方式
dbtarget('w', $dbServs);
//更新用户表
$sql = "update {$t_users} set creat_group='{$my_c_group}' where user_id={$user_id}";
$dbo->exeUpdate($sql);
//卸载群组表
$sql = "delete from {$t_groups} where group_id={$group_id}";
$dbo->exeUpdate($sql);
//卸载群组会员表
$sql = "delete from {$t_group_members} where group_id={$group_id}";
$dbo->exeUpdate($sql);
//卸载群组主题标
$sql = "delete from {$t_group_subject} where group_id={$group_id}";
$dbo->exeUpdate($sql);
//卸载群组评论表
$sql = "delete from {$t_group_subject_comment} where group_id={$group_id}";
$dbo->exeUpdate($sql);
//更新session
set_sess_cgroup($my_c_group);
del_affair($dbo, 1, $group_id);
action_return(1, '', "");
Пример #4
0
        //删除评论
        $sql = "delete from {$t_share} where s_id={$rs}";
        if ($dbo->exeUpdate($sql)) {
            del_affair($dbo, 5, $rs);
            increase_integral($dbo, $int_del_share, $u_id);
        }
    }
} else {
    //单条
    //变量取得
    if (empty($share_id)) {
        $share_id = intval(get_argg('sid'));
        $u_id = intval(get_argg('u_id'));
    }
    //数据表定义区
    $t_share = $tablePreStr . "share";
    $dbo = new dbex();
    //读写分离定义函数
    dbtarget('w', $dbServs);
    //删除评论
    $sql = "delete from {$t_share} where s_id={$share_id}";
    if ($dbo->exeUpdate($sql)) {
        del_affair($dbo, 5, $share_id);
        increase_integral($dbo, $int_del_share, $u_id);
        echo $m_langpackage->m_del_suc;
    }
}
?>
<script language="javascript" type="text/javascript">
window.location.href='share_list.php?order_by=s_id&order_sc=desc';
</script>
Пример #5
0
$t_photo = $tablePreStr . "photo";
$t_photo_comment = $tablePreStr . "photo_comment";
$t_album_comment = $tablePreStr . "album_comment";
$dbo = new dbex();
//读写分离定义方法
dbtarget('r', $dbServs);
$photo_rs = api_proxy("album_photo_by_aid", "*", $album_id);
dbtarget('w', $dbServs);
$photo_num = 0;
foreach ($photo_rs as $val) {
    @unlink($val['photo_src']);
    @unlink($val['photo_thumb_src']);
    //删除照片相关评论
    $photo_id = $val['photo_id'];
    $sql = "delete from {$t_photo_comment} where photo_id ={$photo_id} and user_id={$user_id}";
    $dbo->exeUpdate($sql);
    $photo_num++;
}
//删除相册有关照片
$sql = "delete from {$t_photo} where album_id={$album_id} and user_id={$user_id}";
$dbo->exeUpdate($sql);
//删除相册相关评论
$sql = "delete from {$t_album_comment} where album_id={$album_id} and user_id={$user_id}";
$dbo->exeUpdate($sql);
//删除相册
$sql = "delete from {$t_album} where album_id={$album_id} and user_id={$user_id}";
if ($dbo->exeUpdate($sql)) {
    del_affair($dbo, 2, $album_id);
}
//回应信息
action_return(1, "", "");
Пример #6
0
    $blog_content = $blog_content['log_content'];
    preg_match_all("/classId=\"\\d\"/", $blog_content, $match);
    $match = preg_replace("/[classId=,\"]/", '', $match[0]);
    if (!empty($match)) {
        $match = join(",", $match);
        $sql = "select file_src from {$t_uploadfile} where id in ({$match})";
        $file_src = $dbo->getRs($sql);
        foreach ($file_src as $rs) {
            unlink($rs['file_src']);
        }
    }
    if (!empty($match)) {
        $sql = "delete from {$t_uploadfile} where id in ({$match})";
        $dbo->exeUpdate($sql);
    }
    $sql = "delete from {$t_blog} where log_id={$blog_id}";
    if ($dbo->exeUpdate($sql)) {
        $sql = "delete from {$t_blog_comments} where log_id={$blog_id}";
        $dbo->exeUpdate($sql);
        increase_integral($dbo, $int_del_blog, $sendor_id);
        del_affair($dbo, 0, $blog_id);
        //回应信息
        echo $m_langpackage->m_del_suc;
    } else {
        echo $m_langpackage->m_del_lose;
    }
}
?>
<script language="javascript" type="text/javascript">
window.location.href='blog_list.php?order_by=log_id&order_sc=desc';
</script>