Example #1
0
	$password=md5($reg_pass);
	$sql ="INSERT INTO $cfg[tb_members] SET ";
	$sql.="u_name		='$reg_name',";
	$sql.="u_avatar		='default.gif',";
	$sql.="u_pass		='******',";
	$sql.="u_email		='$reg_email',";
	$sql.="show_email	='$show_email',";
	$sql.="reg_pass		='******',";
	$sql.="reg_ip		='$userip',";
	$sql.="reg_date		='$nowtime',";
	$sql.="last_visit	='$nowtime',";
	$sql.="have_new_pm	='1',";
	$sql.="act_check	='$checkcode'";

	$result=RenDB_Query($sql);
	if(	$row=RenDB_Insert_ID() )//insert succeed
	{
		//send welcome message
		$admins=explode('|',$cfg['admins']);

		$sql ="INSERT INTO $cfg[tb_pms] SET ";
		$sql.="sendto='$reg_name',";
		$sql.="comefrom='$admins[0]',";
		$sql.="sendtime='$nowtime',";
		$sql.="message='$cfg[welcome_msg]',";
		$sql.="u_stand='4'";

		RenDB_Query($sql);

		setcookie('cook_name',$reg_name);
		setcookie('cook_pass',md5($reg_pass));
Example #2
0
        if (!In_Names($sendto, $cfg['admins'])) {
            //检查消息是否已满
            //	$sql ="SELECT COUNT(*) FROM $cfg[tb_pms] WHERE sendto='$sendto' OR comefrom='$sendto' LIMIT $cfg[maxpm]";
            $sql = "SELECT COUNT(*) FROM {$cfg['tb_pms']} WHERE sendto='{$sendto}' LIMIT {$cfg['maxpm']}";
            $result = RenDB_Query($sql);
            if ($row = RenDB_Fetch_Row($result)) {
                if ($row[0] >= $cfg['maxpm']) {
                    SimplyBox('对方消息已经满了');
                }
            }
        }
        //var_dump($meminfo);
        //写入数据库
        $sql = "INSERT INTO `{$cfg['tb_pms']}` SET ";
        $sql .= "sendto='{$sendto}',";
        $sql .= "comefrom='{$udata['u_name']}',";
        $sql .= "sendtime='{$nowtime}',";
        $sql .= "message='{$message}',";
        $sql .= "u_stand='{$pm_stand}'";
        $result = RenDB_Query($sql);
        if ($row = RenDB_Insert_ID()) {
            //通知用户有新消息
            if (!$meminfo['have_new_pm']) {
                $sql = "UPDATE {$cfg['tb_members']} SET have_new_pm=1 WHERE u_name='{$sendto}' LIMIT 1";
                RenDB_Query($sql, true);
            }
            SimplyBox('消息发送成功', true);
        }
        break;
}
SimplyBox($str['act_fail']);
Example #3
0
 $sql .= "rules='{$rules}', ";
 $sql .= "host_name='{$udata['u_name']}',";
 $sql .= "host_color='{$hostcolor}',";
 $sql .= "skill_range='{$skill_range}',";
 $sql .= "tout_max='{$maxtout}',";
 $sql .= "step_time='{$timestep}',";
 $sql .= "add_time='{$timeadd}',";
 $sql .= "u_ip='{$userip}',";
 $sql .= "l_time='{$nowtime}'";
 //$gcreate = 10000;
 $cinfo = '';
 $created = 0;
 for ($i = 1; $i <= $gcreate; $i++) {
     $cinfo .= "No.{$i} 创建...";
     $result = RenDB_Query($sql);
     $gid = RenDB_Insert_ID();
     if ($gid != 0) {
         $created++;
         $cinfo .= "成功! <br />";
     } else {
         $cinfo .= "失败.<br />";
     }
 }
 $lks = array();
 if ($created) {
     $cinfo .= "<br />您创建了{$created}个新局,请等待对手的加入. ";
     $cinfo .= MakeBBButton("pm_new.php?action=invite1", '邀请朋友', 500, 220);
     $cinfo .= "<br />";
     $lks[] = array("查看", 'room_mynew');
     if ($row[0] + $gcreate < $cfg['maxnewgame']) {
         $lks[] = array("继续创建", 'g_new', 'action' => 'new1');