Esempio n. 1
0
    case "5":
        $t_table = $t_share;
        $t_table_com = $t_share_comment;
        $mod_col = "s_id";
        break;
    case "6":
        $t_table = $t_mood;
        $t_table_com = $t_mood_comment;
        $mod_col = "mood_id";
        break;
    default:
        echo 'error';
        break;
}
//定义读操作
dbtarget('w', $dbServs);
$is_true = 0;
$sql = "delete from {$t_table_com} where comment_id={$com_id}";
if ($dbo->exeUpdate($sql)) {
    $sql = "update {$t_table} set comments=comments-1 where {$mod_col}={$parent_id}";
    $is_true = $dbo->exeUpdate($sql);
}
if ($is_true) {
    increase_integral($dbo, $int_del_com_msg, $sendor_id);
    echo "success";
} else {
    echo $rp_langpackage->rp_del_los;
}
?>

$join_group = get_sess_jgroup();
$creat_group = get_sess_cgroup();
$group_id = intval(get_argg('group_id'));
$ulog_title = short_check(get_argp("LOG_TITLE"));
$ulog_txt = big_check(get_argp("CONTENT"));
$u_id = intval(get_argg('user_id'));
$tag = short_check(get_argp('tag'));
//防止重复提交
antiRePost($ulog_title);
//数据表定义
$t_group_subject = $tablePreStr . "group_subject";
$t_group = $tablePreStr . "groups";
//权限判定
dbtarget('r', $dbServs);
$dbo = new dbex();
//写入方式
dbtarget('w', $dbServs);
$sql = "insert into {$t_group_subject} (user_id,title,content,add_time,group_id,user_name,hits,user_ico,`tag`) values({$user_id},'{$ulog_title}','{$ulog_txt}',NOW(),{$group_id},'{$user_name}',0,'{$user_ico}','{$tag}')";
$dbo->exeUpdate($sql);
$last_id = mysql_insert_id();
$sql = "update {$t_group} set subjects_num=subjects_num+1 where group_id={$group_id}";
$dbo->exeUpdate($sql);
//标签功能
$tag_id = tag_add($tag);
$tag_state = tag_relation(4, $tag_id, $last_id);
increase_integral($dbo, $int_subject, $user_id);
$jump = "modules.php?app=group_space&group_id={$group_id}&user_id=" . $u_id;
action_return(1, "", $jump);
?>

Esempio n. 3
0
set_sess_plugins($user_info['use_plugins']);
set_sess_apps($user_info['use_apps']);
set_sess_online($hidden);
set_session($user_info['user_id'] . "_dressup", $user_info['dressup']);
$sql = "select * from {$t_frontgroup} where gid='{$user_info['user_group']}'";
$rights = $dbo->getRow($sql);
if ($rights) {
    set_sess_rights($rights['rights']);
} else {
    set_sess_rights("");
}
//定义写操作
dbtarget('w', $dbServs);
$now_time = time();
$last_data = date("Y-m-d", strtotime($user_info['lastlogin_datetime']));
$now_data = date("Y-m-d", $now_time);
if ($last_data != $now_data) {
    increase_integral($dbo, $int_login, $user_info['user_id']);
}
$sql = "delete from {$t_online} where user_id={$user_info['user_id']}";
$dbo->exeUpdate($sql);
$sql = "insert into {$t_online} (user_id,user_name,user_sex,user_ico,birth_province,birth_city,reside_province,reside_city,active_time,hidden,birth_year) values " . "({$user_info['user_id']},'{$user_info['user_name']}',{$user_info['user_sex']},'{$user_info['user_ico']}','{$user_info['birth_province']}','{$user_info['birth_city']}','{$user_info['reside_province']}','{$user_info['reside_city']}',{$now_time},{$hidden},'{$user_info['birth_year']}')";
$dbo->exeUpdate($sql);
$sql = "update {$t_users} set lastlogin_datetime=now(),login_ip='{$_SERVER['REMOTE_ADDR']}' where user_id={$user_info['user_id']}";
$dbo->exeUpdate($sql);
if (get_sess_preloginurl()) {
    echo get_sess_preloginurl();
} else {
    echo $acttarget[1];
    set_sess_preloginurl('');
}
Esempio n. 4
0
<?php

require "foundation/aintegral.php";
require "api/Check_MC.php";
//引入语言包
$mb_langpackage = new msgboardlp();
//变量取得
$to_user_id = intval(get_argg('user_id'));
$mess_id = intval(get_argg('mess_id'));
$from_user_id = get_sess_userid();
//数据表定义区
$t_message = $tablePreStr . "msgboard";
$dbo = new dbex();
//读写分离定义函数
dbtarget('w', $dbServs);
//评论相册
$sql = "delete from {$t_message} where mess_id={$mess_id} ";
if ($dbo->exeUpdate($sql)) {
    increase_integral($dbo, $int_del_com_msg, $to_user_id);
}
//回应信息
action_return(1, "", "-1");
    if ($img_ext == 'gif') {
        $temp_img = imagecreatefromgif($ico_url);
    }
    if ($img_ext == 'png') {
        $temp_img = imagecreatefrompng($ico_url);
    }
    $s_ico = str_replace('.' . $img_ext, '_small.' . $img_ext, $ico_url);
    $small_ico = imagecreatetruecolor(70, 70);
    imagecopyresampled($small_ico, $temp_img, 0, 0, 0, 0, 70, 70, 200, 200);
    imagejpeg($small_ico, $s_ico);
} else {
    $s_ico = $ico_url;
}
if (update_user_ico($dbo, $t_users, $user_ico, $u_field_id, $user_id, $s_ico)) {
    if (get_sess_userico() == "skin/{$skinUrl}/images/d_ico_0_small.gif" or get_sess_userico() == "skin/{$skinUrl}/images/d_ico_1_small.gif") {
        increase_integral($dbo, $int_one_ico, get_sess_userid());
    }
    //更新数据
    update_user_ico($dbo, $t_mypals, $pals_ico, $p_field_id, $user_id, $s_ico);
    update_user_ico($dbo, $t_pals_req, $req_ico, $q_field_id, $user_id, $s_ico);
    set_sess_userico($s_ico);
    if (preg_match("/uploadfiles\\/photo_store/", $photo_url)) {
        unlink($photo_url);
        //删除临时图片文件
    }
    //记录新鲜事
    $title = $u_langpackage->u_picture_update;
    $content = '<img class="photo_frame" onerror=parent.pic_error(this) src="' . $ico_url . '" align="top">';
    api_proxy("message_set", 0, $title, $content, 1, 7);
    action_return(1, "", 'modules.php?app=user_ico');
} else {
//删除主题内部的图片
$subject_content = api_proxy("group_sub_by_sid", "content", $subject_id);
$subject_content = $subject_content['content'];
preg_match_all("/classId=\"\\d\"/", $subject_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_group_subject} where subject_id={$subject_id}";
$dbo->exeUpdate($sql);
$sql = "update {$t_group} set subjects_num=subjects_num-1 where group_id={$group_id}";
$dbo->exeUpdate($sql);
$sql = "delete from {$t_group_comment} where subject_id={$subject_id}";
$dbo->exeUpdate($sql);
$jump = "modules.php?app=group_space&group_id={$group_id}&user_id=" . $u_id;
increase_integral($dbo, $int_del_subject, $sendor_id);
action_return(1, "", $jump);
?>

Esempio n. 7
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>
Esempio n. 8
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>
Esempio n. 9
0
        $dbo->exeUpdate($sql);
        increase_integral($dbo, $int_del_poll, $sendor_id);
    }
} else {
    //变量区
    if (empty($pid)) {
        $pid = intval(get_argg('poll_id'));
        $sendor_id = intval(get_argg('sendor_id'));
    }
    //数据表定义区
    $t_users = $tablePreStr . "users";
    $t_poll = $tablePreStr . "poll";
    $t_polloption = $tablePreStr . "polloption";
    $t_polluser = $tablePreStr . "polluser";
    $t_poll_com = $tablePreStr . "poll_comment";
    $sql = "delete from {$t_poll} where p_id={$pid}";
    $dbo->exeUpdate($sql);
    $sql = "delete from {$t_polloption} where pid={$pid}";
    $dbo->exeUpdate($sql);
    $sql = "delete from {$t_polluser} where pid={$pid}";
    $dbo->exeUpdate($sql);
    $sql = "delete from {$t_poll_com} where p_id={$pid}";
    $dbo->exeUpdate($sql);
    increase_integral($dbo, $int_del_poll, $sendor_id);
    //回应信息
    echo $m_langpackage->m_del_suc;
}
?>
<script language="javascript" type="text/javascript">
window.location.href='poll_list.php?order_by=p_id&order_sc=desc';
</script>
Esempio n. 10
0
        $title = $s_langpackage->s_shared . $user_name . $s_langpackage->s_video . '<a href="home.php?h=' . $uid . '&app=share_show&s_id=' . $s_content_id . '" target="_blank">' . $title_data . '</a>';
        $share_id = share_act($dbo, $s_type, $s_content_id, $title, $tag, $re_link, $re_thumb, $re_m_link);
        $content = '<div style="background:url(' . $re_thumb . ') no-repeat scroll 0% 0% transparent;" class="movie_player"><a href="home.php?h=' . $user_id . '&app=share_show&s_id=' . $share_id . '" target="_blank"></a></div>';
        break;
    case "8":
        $rs = api_proxy("group_sub_by_sid", "group_id,user_id,user_name,title,content", $s_content_id);
        if ($rs['user_id'] == $user_id) {
            echo $s_langpackage->s_no_share;
        } else {
            $user_name = '<a href="home.php?h=' . $rs['user_id'] . '" target="_blank">' . $rs['user_name'] . '</a>';
            $title_data = $title_data ? $title_data : $rs['title'];
            $title = $s_langpackage->s_shared . $user_name . $s_langpackage->s_s_topic . '<a href="home.php?h=' . $rs['user_id'] . '&app=group_sub_show&group_id=' . $rs['group_id'] . '&subject_id=' . $s_content_id . '" target="_blank">' . $title_data . '</a>';
            $share_id = share_act($dbo, $s_type, $s_content_id, $title, $tag);
            $content = get_blog_lentxt($rs['content']);
            break;
        }
}
//标签功能
$tag_id = tag_add($tag);
$tag_state = tag_relation(3, $tag_id, $share_id);
$content .= $s_comment ? '<div class="clear"></div><div class="left_g left"></div><div class="center_g left">' . $s_comment . '</div><div class="right_g left"></div><div class="clear"></div>' : '';
//插入动态表
$is_suc = api_proxy("message_set", $share_id, $title, $content, 4, 5);
if ($is_suc) {
    $sql = "update {$t_share} set content='{$content}' where s_id={$share_id}";
    $is_update = $dbo->exeUpdate($sql);
    increase_integral($dbo, $int_share, $user_id);
    echo "success";
} else {
    echo $s_langpackage->s_share_los;
}
Esempio n. 11
0
 set_sess_userid($user_id);
 set_sess_usersex($user_sex);
 set_sess_username($user_name);
 set_sess_userico($user_ico);
 set_sess_online('0');
 $now_time = time();
 $sql = "insert into {$t_online} (user_id,user_name,user_sex,user_ico,active_time,hidden) values ({$user_id},'{$user_name}',{$user_sex},'{$user_ico}','{$now_time}',0)";
 $dbo->exeUpdate($sql);
 foreach ($sort_rs as $rs) {
     $sort_id = $rs['id'];
     $sort_name = $rs['name'];
     $sql = "insert into {$t_pals_sort} ( name , user_id ) values ( '{$sort_name}' , {$user_id} )";
     $dbo->exeUpdate($sql);
 }
 if ($invite_fromuid) {
     increase_integral($dbo, $int_invited, $invite_fromuid);
     //取得介绍人的资料信息
     $user_row = api_proxy("user_self_by_uid", "user_id,user_name,user_sex,user_ico,palsreq_limit", $invite_fromuid);
     if ($user_row) {
         $touser_id = $user_row['user_id'];
         $touser_name = $user_row['user_name'];
         $touser_sex = $user_row['user_sex'];
         $touser_ico = $user_row['user_ico'];
         $touser_pals_limit = $user_row['palsreq_limit'];
     }
     if ($touser_pals_limit == 0) {
         $sql = "insert into {$t_mypals} (user_id,pals_id,pals_name,pals_sex,add_time,pals_ico,accepted) values ({$user_id},{$invite_fromuid},'{$touser_name}','{$touser_sex}',NOW(),'{$touser_ico}',1)";
         $dbo->exeUpdate($sql);
         set_sess_mypals($invite_fromuid);
     }
 }
Esempio n. 12
0
if ($to_user_id != $from_user_id && $user_info['inputmess_limit']) {
    if ($user_info['inputmess_limit'] == 2) {
        action_return($result_type, $mb_langpackage->mb_add_pvw, "-1");
        exit;
    } else {
        if ($user_info['inputmess_limit'] == 1) {
            if (!api_proxy("pals_self_isset", $to_user_id)) {
                action_return($result_type, $mb_langpackage->mb_add_pvw, "-1");
                exit;
            }
        }
    }
}
$dbo = new dbex();
//读写分离定义函数
dbtarget('w', $dbServs);
//留言
$sql = "insert into {$t_message}(`from_user_id`,`from_user_name`,`from_user_ico`,`to_user_id`,`message`,`add_time`) values({$from_user_id},'{$from_user_name}','{$from_user_ico}',{$to_user_id},'{$message}',now())";
if ($dbo->exeUpdate($sql)) {
    if ($to_user_id != $from_user_id) {
        increase_integral($dbo, $int_com_msg, $from_user_id);
        api_proxy("message_set", $to_user_id, $mb_langpackage->mb_remind, "modules.php?app=msgboard_more", 0, 7, "remind");
    }
    if ($restore == 1) {
        $sql = "insert into {$t_message}(`from_user_id`,`from_user_name`,`from_user_ico`,`to_user_id`,`message`,`add_time`) values({$from_user_id},'{$from_user_name}','{$from_user_ico}',{$from_user_id},'{$message}',now())";
        $dbo->exeUpdate($sql);
    }
    action_return($result_type, "", "-1");
} else {
    action_return($result_type, $mb_langpackage->mb_message_failed, "-1");
}
Esempio n. 13
0
if ($maxchoice == 1) {
    $input_type = 'radio';
} else {
    $input_type = 'checkbox';
}
$poll_option = "<input type=\"" . $input_type . "\" disabled />" . $cho_array[0] . "<br />";
$poll_option .= "<input type=\"" . $input_type . "\" disabled />" . $cho_array[1] . "<br />";
$poll_option .= "......";
$cho_ser = serialize(array($cho_array[0], $cho_array[1]));
$multiple = $maxchoice == 1 ? 0 : 1;
$cre_value = empty($credit) ? 0 : intval($credit);
$per_value = empty($percredit) ? 0 : intval($percredit);
$sql = "insert into {$t_poll} (`user_id`,`username`,`user_ico`,`subject`,`multiple`,`maxchoice`,`sex`,`noreply`,`dateline`,`credit`,`percredit`,`expiration`,`message`,`option`) values ({$user_id},'{$user_name}','{$userico}','{$subject}',{$multiple},{$maxchoice},{$sex},{$noreply},NOW(),{$cre_value},{$per_value},'{$expiration}','{$message}','{$cho_ser}')";
$dbo->exeUpdate($sql);
$last_pid = mysql_insert_id();
foreach ($cho_array as $val) {
    $sql = "insert into {$t_polloption} (`pid` ,`option`) values ({$last_pid},'{$val}')";
    $dbo->exeUpdate($sql);
}
if ($makefeed == 1) {
    //纪录新鲜事
    $title = $pol_langpackage->pol_launch_vote . '<a href="home.php?h=' . $user_id . '&app=poll&p_id=' . $last_pid . '" target="_blank">' . $subject . '</a>';
    $content = '<a href="home.php?h=' . $user_id . '&app=poll&p_id=' . $last_pid . '" target="_blank">' . $subject . '</a>';
    $is_suc = api_proxy("message_set", $last_pid, $title, $content, 0, 4);
}
//标签功能
$tag_id = tag_add($tag);
$tag_state = tag_relation(5, $tag_id, $last_pid);
increase_integral($dbo, $int_poll, $user_id);
//回应信息
action_return(0, "", "");
Esempio n. 14
0
//目录设置
$up->set_thumb(180, 180);
//缩略图设置
$fs = $up->execute();
$i = 0;
foreach ($fs as $index => $realtxt) {
    if ($realtxt['flag'] == 1) {
        $fileSrcStr = str_replace(dirname(__FILE__), "", $realtxt['dir']) . $realtxt['name'];
        $thumb_src = str_replace(dirname(__FILE__), "", $realtxt['dir']) . $realtxt['thumb'];
        $sql = "insert into {$t_photo}(`user_id`,`add_time`,`photo_src`,`photo_thumb_src`,`album_id`,`user_name`,`privacy`)\r\n\t\t\t\t\t                     values({$user_id},now(),'{$fileSrcStr}','{$thumb_src}',{$album_id},'{$user_name}','');";
        if ($dbo->exeUpdate($sql)) {
            $photo_id = mysql_insert_id();
            $fs[$index]['photo_id'] = $photo_id;
            $sql = "update {$t_album} set photo_num=photo_num+1,update_time=NOW() where album_id={$album_id}";
            if ($dbo->exeUpdate($sql)) {
                increase_integral($dbo, $int_photo, $user_id);
            }
            $photos_array[$i]['id'] = $photo_id;
            $photos_array[$i]['file'] = $thumb_src;
        }
        $i++;
    } else {
        if ($realtxt['flag'] == -1) {
            action_return(0, $a_langpackage->a_no_jpg, "-1");
        } else {
            if ($realtxt['flag'] == -2) {
                action_return(0, $a_langpackage->a_big, "-1");
            }
        }
    }
}
Esempio n. 15
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);
}
Esempio n. 16
0
        $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'));
    //数据表定义区
    $t_table = $tablePreStr . "msgboard";
    $dbo = new dbex();
    //读写分离定义函数
    dbtarget('w', $dbServs);
    //删除留言
    $sql = "delete from {$t_table} where mess_id={$mess_id}";
    if ($dbo->exeUpdate($sql)) {
        increase_integral($dbo, $int_del_com_msg, $fu_id);
        echo $m_langpackage->m_del_suc;
    }
}
?>
<script language="javascript" type="text/javascript">
window.location.href='msgboard_list.php?order_by=mess_id&order_sc=desc';
</script>
Esempio n. 17
0
    if ($visitor_id != $host_id) {
        $focus = api_proxy("message_get_remind_count", $host_id);
        if ($focus[0] >= 20) {
            api_proxy("message_set_del", "remind", '', $host_id);
        }
        api_proxy("message_set", $host_id, $remind_content, $link, 1, 0, "remind");
    }
    if ($to_userid) {
        $focus = api_proxy("message_get_remind_count", $to_userid);
        if ($focus[0] >= 20) {
            api_proxy("message_set_del", "remind", '', $to_userid);
        }
        api_proxy("message_set", $to_userid, $remind_content, $link, 1, 0, "remind");
    }
}
increase_integral($dbo, $int_com_msg, $visitor_id);
if ($last_id) {
    echo '
			<div class="reaction" id="record_' . $type_id . '_' . $last_id . '">';
    if ($visitor_id == $host_id) {
        echo '<a href="javascript:parent.del_com(' . $host_id . ',' . $type_id . ',' . $mod_id . ',' . $last_id . ',' . $visitor_id . ')" class="replyclose"></a>';
    }
    echo '
				<a class="figure" href="home.php?h=' . $visitor_id . '" target="_blank"><img src="' . $visitor_ico . '"/></a>
				<a href="home.php?h=' . $visitor_id . '" target="_blank">' . filt_word($visitor_name) . '</a><label>' . date("Y-m-d H:i:s", time()) . '</label>
				<p class="left">' . filt_word(get_face($content)) . '</p>
			</div>';
}
?>