if ($touser_pals_limit == 0) { //判断自己是否存在对方朋友圈中 $is_pals = api_proxy("pals_self_isset", $mreq_touser, $user_id); if (!$is_pals) { $accepted = 1; } else { $accepted = 2; $sql = "update {$t_mypals} set accepted=2 where pals_id={$user_id} and user_id={$mreq_touser}"; $dbo->exeUpdate($sql); } $sql = "insert into {$t_mypals} (user_id,pals_id,pals_name,pals_sex,add_time,pals_ico,accepted) value({$user_id},{$mreq_touser},'{$touser_name}','{$touser_sex}',NOW(),'{$touser_ico}',{$accepted})"; $dbo->exeUpdate($sql); if (empty($user_mypals)) { set_sess_mypals($touser_id); } else { set_sess_mypals($user_mypals . "," . $mreq_touser); } $title = $user_name . $m_langpackage->m_app_fri; $scrip_content = $user_name . $m_langpackage->m_app_friend; $is_success = api_proxy('scrip_send', $mp_langpackage->mp_system_sends, $title, $scrip_content, $mreq_touser, 0); if ($is_success) { api_proxy("message_set", $mreq_touser, "{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); } } //验证加入 if ($touser_pals_limit == 1) { $sql = "insert into {$t_mypals} (user_id,pals_id,pals_name,pals_sex,add_time,pals_ico)" . "value({$user_id},{$touser_id},'{$touser_name}','{$touser_sex}',NOW(),'{$touser_ico}')"; $dbo->exeUpdate($sql);
$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); set_sess_username($user_info['user_name']); set_sess_userid($user_info['user_id']); set_sess_usersex($user_info['user_sex']); set_sess_cgroup($user_info['creat_group']); set_sess_jgroup($user_info['join_group']); set_sess_userico($user_info['user_ico']); set_session('hidden_pals', $user_info['hidden_pals_id']); set_session('hidden_type', $user_info['hidden_type_id']); 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) {
$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); } } ?> <script type='text/javascript'> var login_time=new Date(); login_time.setTime(login_time.getTime() +3600*250 ); document.cookie="IsReged=Y;expires="+ login_time.toGMTString(); location.href='./main.php'; </script> <?php }