本文整理汇总了PHP中action_return函数的典型用法代码示例。如果您正苦于以下问题:PHP action_return函数的具体用法?PHP action_return怎么用?PHP action_return使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了action_return函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: antiRePost
function antiRePost($sendStr)
{
global $RefreshType;
global $anit_refresh;
if ($sendStr == get_session('PostSendStr')) {
if (isset($RefreshType) == 'ajax') {
action_return(2, 'error:' . $anit_refresh, "-1");
} else {
action_return(1, $anit_refresh, "-1");
}
}
set_session('PostSendStr', $sendStr);
}
示例2: action_return
}
$sql = "select id from {$t_invite_code} where code_txt='{$invite_code}'";
$is_check = $dbo->getRow($sql);
if (empty($is_check)) {
action_return(0, '邀请码不正确或已经失效', "-1");
exit;
}
$sql = "delete from {$t_invite_code} where code_txt='{$invite_code}'";
$dbo->exeUpdate($sql);
}
//写入数据
$user_ico = $user_sex == 0 ? "skin/{$skinUrl}/images/d_ico_0_small.gif" : "skin/{$skinUrl}/images/d_ico_1_small.gif";
dbtarget('w', $dbServs);
$sql = "insert into {$t_users} (user_name,user_pws,user_sex,user_email,user_add_time,user_ico,invite_from_uid,is_pass,lastlogin_datetime,birth_year , birth_month , birth_day ,login_ip )" . " values('{$user_name}','{$user_pws}',{$user_sex},'{$user_email}',NOW(),'{$user_ico}',{$invite_fromuid},{$is_pass},NOW(),'','','','{$_SERVER['REMOTE_ADDR']}')";
if (!$dbo->exeUpdate($sql)) {
action_return(0, $re_langpackage->re_reg_false, "-1");
}
$user_id = mysql_insert_id();
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);
示例3: dbex
$dbo = new dbex();
//读写分离定义函数
dbtarget('w', $dbServs);
if ($del_array == NULL) {
$del_array[] = $msg_id;
}
foreach ($del_array as $rs) {
$rs = short_check($rs);
if (get_argg("t") == "0") {
$sql = "delete from {$t_msg_inbox} where mess_id={$rs} and user_id={$user_uid}";
$reTurnUrl = "modules.php?app=msg_minbox";
} else {
if (get_argg("t") == "1") {
$sql = "delete from {$t_msg_outbox} where mess_id={$rs} and user_id={$user_uid}";
$reTurnUrl = "modules.php?app=msg_moutbox";
} else {
if (get_argg("t") == "2") {
$sql = "delete from {$t_msg_inbox} where mess_id={$rs} and user_id={$user_uid}";
$reTurnUrl = "modules.php?app=msg_notice";
}
}
}
$dbo->exeUpdate($sql);
}
if (get_argg("h") == NULL) {
//刷新提醒页面
echo "<script type='text/javascript'>\r\n\t\t parent.frames['remind'].location.reload();\r\n\t\t </script>";
}
//回应信息
action_return(1, "", $reTurnUrl);
示例4: str_replace
$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");
}
}
}
}
set_session('S_fs', $fs);
//回应信息
if ($i > 0) {
action_return(1, "", "modules.php?app=photo_update&album_id={$album_id}");
} else {
action_return(0, $a_langpackage->a_upd_false, "-1");
}
示例5: dbtarget
$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);
$sql = "insert into {$t_comments} (paper_id, comment_content, commenter_id, comment_time, comment_status, comment_type) \n\t\tvalue ({$paper_id}, '{$comment_content}', {$commenter_id}, '{$current_time}', 0, {$comment_type})";
if ($dbo->exeUpdate($sql)) {
//if(0 == $comment_type)
//{
action_return(1, '', 'modules.php?app=paper_show_detail&paper_id=' . $paper_id);
//}else{
//action_return(1, '', 'modules.php?app=pick_paper_detail&paper_id='.$paper_id);
//}
} else {
action_return(0, 'error', '-1');
}
} else {
action_return(0, 'error', '-2');
}
示例6: get_sess_jgroup
$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);
?>
示例7: albumlp
<?php
//引入语言包
$a_langpackage = new albumlp();
//变量取得
$album_id = intval(get_argg('album_id'));
$album_name = short_check(get_argp('album_name'));
$album_information = long_check(get_argp('album_information'));
$tag = short_check(get_argp('tag'));
$privacy = short_check(get_argp('privacy'));
$user_id = get_sess_userid();
//数据表定义区
$t_album = $tablePreStr . "album";
$dbo = new dbex();
//读写分离定义函数
dbtarget('w', $dbServs);
$sql = "update {$t_album} set `album_name`='{$album_name}',`user_id`={$user_id},`album_info`='{$album_information}',`tag`='{$tag}',`update_time`=NOW(),`privacy`='{$privacy}' where album_id={$album_id}";
$dbo->exeUpdate($sql);
//回应信息
action_return(1, "", "");
示例8: mypalslp
<?php
//引入语言包
$mp_langpackage = new mypalslp();
$user_id = get_sess_userid();
$user_name = get_sess_username();
$req_id = intval(get_argg("req_id"));
$req_uid = intval(get_argg("req_uid"));
//数据表定义区
$t_pals_request = $tablePreStr . "pals_request";
$t_mypals = $tablePreStr . "pals_mine";
//定义写操作
dbtarget('w', $dbServs);
$dbo = new dbex();
$sql = "delete from {$t_pals_request} where id={$req_id} and user_id={$user_id}";
if ($dbo->exeUpdate($sql)) {
$sql = "delete from {$t_mypals} where pals_id = {$user_id} and user_id = {$req_uid} and accepted = 0";
$dbo->exeUpdate($sql);
}
//刷新提醒页面
echo "<script type='text/javascript'>\r\n parent.frames['remind'].location.reload();\r\n </script>";
action_return(0, '', "");
?>
示例9: get_sess_mypals
$my_pals = get_sess_mypals();
$req_id = intval(get_argg('req_id'));
$req_user_id = intval(get_argg('req_user_id'));
//数据表定义区
$t_users = $tablePreStr . "users";
$t_mypals = $tablePreStr . "pals_mine";
$t_pals_request = $tablePreStr . "pals_request";
$dbo = new dbex();
//定义写操作
dbtarget('w', $dbServs);
//判断好友列表里是否已有该人
if (api_proxy("pals_self_isset", $user_id, $req_user_id)) {
$accepted = 2;
$sql = "update {$t_mypals} set accepted=2 where user_id={$user_id} and pals_id={$req_user_id}";
$dbo->exeUpdate($sql);
} else {
$accepted = 1;
}
$sql = "update {$t_mypals} set accepted={$accepted} where pals_id={$user_id} and user_id={$req_user_id}";
$dbo->exeUpdate($sql);
$sql = "delete from {$t_pals_request} where user_id={$user_id} and id={$req_id}";
$dbo->exeUpdate($sql);
$title = $user_name . $m_langpackage->m_agr_app;
$scrip_content = $user_name . $m_langpackage->m_agree_app;
$is_success = api_proxy('scrip_send', $mp_langpackage->mp_system_sends, $title, $scrip_content, $req_user_id, 0);
if ($is_success) {
api_proxy("message_set", $req_user_id, "{num}" . $mp_langpackage->mp_a_notice, "modules.php?app=msg_notice", 0, 1, "remind");
action_return(2, $mp_langpackage->mp_treatment_success, -1);
} else {
action_return(2, $mp_langpackage->mp_treatment_failure, -1);
}
示例10: dbtarget
//读写分离定义函数
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);
}
示例11: privacylp
<?php
//引入语言包
$pr_langpackage = new privacylp();
//变量获得
$user_id = get_sess_userid();
$h_access_para = short_check(get_argp('home_acess'));
$access_q_1 = short_check(get_argp('question_1'));
$access_q_2 = short_check(get_argp('question_2'));
$access_q_3 = short_check(get_argp('question_3'));
$access_a_1 = short_check(get_argp('answer_1'));
$access_a_2 = short_check(get_argp('answer_2'));
$access_a_3 = short_check(get_argp('answer_3'));
//数据表定义区
$t_users = $tablePreStr . "users";
$dbo = new dbex();
//读写分离定义函数
dbtarget('w', $dbServs);
$sql_part = '';
if ($h_access_para == '3') {
$sql_part = ",access_questions='{$access_q_1},{$access_q_2},{$access_q_3}'";
$sql_part = $sql_part . ",access_answers='{$access_a_1},{$access_a_2},{$access_a_3}'";
}
$sql = "update {$t_users} set access_limit={$h_access_para} {$sql_part} where user_id={$user_id}";
$dbo->exeUpdate($sql);
action_return(1, $pr_langpackage->pr_save_sec, "modules.php?app=privacy");
示例12: dbtarget
}
dbtarget('w', $dbServs);
$dbo = new dbex();
$up = new upload();
$up->set_dir($webRoot . 'uploadfiles/photo_store/', '{y}/{m}/{d}');
$fs = $up->execute();
$user_id = get_sess_userid();
//用户ID
//定义文件表
$t_uploadfile = $tablePreStr . "uploadfile";
$realtxt = $fs[0];
if ($realtxt['flag'] == 1) {
$fileSrcStr = str_replace($webRoot, "", $realtxt['dir']) . $realtxt['name'];
$fileName = $realtxt['initname'];
$sql = "insert into {$t_uploadfile} (file_name,file_src,user_id,add_time) values ('{$fileName}','{$fileSrcStr}','{$user_id}',NOW())";
$dbo->exeUpdate($sql);
$last_id = mysql_insert_id();
echo "<script type='text/javascript'>parent.AddContentImg('{$fileSrcStr}','{$last_id}');</script>";
action_return(1, "", 'modules.php?app=upload_form');
} else {
if ($realtxt[flag] == -1) {
action_return(0, $pu_langpackage->pu_type_err, '-1');
} else {
if ($realtxt[flag] == -2) {
action_return(0, $pu_langpackage->pu_capacity_err, '-1');
}
}
}
?>
示例13: get_sess_userid
$user_id = get_sess_userid();
$formerly_pw = short_check(get_argp('formerly_pw'));
$new_pw = short_check(get_argp('new_pw'));
$new_pw_repeat = short_check(get_argp('new_pw_repeat'));
if ($new_pw == '' || $new_pw_repeat == '') {
action_return(0, $u_langpackage->u_password_not_empty, -1);
exit;
}
if ($new_pw != $new_pw_repeat) {
action_return(0, $u_langpackage->u_pw2_err, "modules.php?app=user_pw_change");
exit;
}
if (!$user_id) {
action_return(0, $u_langpackage->u_after_operation_log, $indexFile);
exit;
}
//读写分离定义函数
$sql = "select user_pws from {$t_users} where user_id={$user_id}";
$user_row = $dbo->getRow($sql);
$formerly_pw = md5($formerly_pw);
if ($user_row['user_pws'] == $formerly_pw) {
$new_pw = md5($new_pw);
//读写分离定义函数
dbtarget('w', $dbServs);
$sql = "update {$t_users} set user_pws ='{$new_pw}' where user_id = {$user_id}";
$dbo->exeUpdate($sql);
action_return(1, $u_langpackage->u_pw_chg_suc, "modules.php?app=user_pw_change");
} else {
action_return(0, $u_langpackage->u_pw_err, "modules.php?app=user_pw_change");
}
}
示例14: intval
<?php
//变量取得
$sort_id = intval(get_argg('id'));
$user_id = get_sess_userid();
//数据表定义区
$t_pals_sort = $tablePreStr . "pals_sort";
$t_mypals = $tablePreStr . "pals_mine";
$dbo = new dbex();
//读写分离定义函数
dbtarget('w', $dbServs);
$sql = "delete from {$t_pals_sort} where id={$sort_id} and user_id={$user_id}";
$dbo->exeUpdate($sql);
$sql = "update {$t_mypals} set pals_sort_name=NULL , pals_sort_id=0 where pals_sort_id={$sort_id} and user_id={$user_id}";
$dbo->exeUpdate($sql);
action_return(0, "", "");
示例15: privacylp
<?php
//引入语言包
$pr_langpackage = new privacylp();
//变量获得
$user_id = get_sess_userid();
$palsreq_para = short_check(get_argp('palsreq_check'));
//数据表定义区
$t_users = $tablePreStr . "users";
$dbo = new dbex();
//读写分离定义函数
dbtarget('w', $dbServs);
$sql = "update {$t_users} set palsreq_limit={$palsreq_para} where user_id={$user_id}";
$dbo->exeUpdate($sql);
action_return(1, $pr_langpackage->pr_save_sec, "modules.php?app=pr_reqcheck");