$start_map_x = $row["map_x"]; $start_map_y = $row["map_y"]; $avatar = $avatar . '_' . $sex . '.gif'; $result = myquery("\n\t\t\tINSERT game_users SET\n\t\t\tuser_name='{$user_name}',\n\t\t\tuser_pass='******',\n\t\t\tname='{$name}',\n\t\t\tHP='{$hp1}',\n\t\t\tHP_MAX='{$hp_max1}',\n\t\t\tMP='{$mp1}',\n\t\t\tMP_MAX='{$mp_max1}',\n\t\t\tSTM='{$stm1}',\n\t\t\tSTM_MAX='{$stm_max1}',\n\t\t\tEXP='{$exp1}',\n\t\t\tGP='{$gp1}',\n\t\t\tSTR='{$str1}',\n\t\t\tNTL='{$ntl1}',\n\t\t\tPIE='{$pie1}',\n\t\t\tVIT='{$vit1}',\n\t\t\tDEX='{$dex1}',\n\t\t\tSPD='{$spd1}',\n\t\t\tSTR_MAX='{$str1}',\n\t\t\tNTL_MAX='{$ntl1}',\n\t\t\tPIE_MAX='{$pie1}',\n\t\t\tVIT_MAX='{$vit1}',\n\t\t\tDEX_MAX='{$dex1}',\n\t\t\tSPD_MAX='{$spd1}',\n\t\t\tCW='" . $gp1 * money_weight . "',\n\t\t\tCC=40,\n\t\t\trace='" . $row['id'] . "',\n\t\t\tavatar='{$avatar}'\n\t\t\t") or die('Database Error: ' . mysql_error() . '<br>'); //lucky='$lucky1', //lucky_max='$lucky1', //vospr='$vospr1', //vospr_max='$vospr1', //magic_res='$magic_res1', //magic_res_max='$magic_res1', $result = myquery("DELETE FROM game_users_reg WHERE user_name = '{$user_name}'"); list($uid) = mysql_fetch_array(myquery("SELECT user_id FROM game_users WHERE user_name='{$user_name}'")); $result = myquery("\n\t\t\tINSERT game_users_map SET\n\t\t\tuser_id='{$uid}',\n\t\t\tmap_name='{$start_map_name}',\n\t\t\tmap_xpos='{$start_map_x}',\n\t\t\tmap_ypos='{$start_map_y}'\n\t\t\t") or die('Database Error: ' . mysql_error() . '<br>'); $result = myquery("\n\t\t\tINSERT game_users_data SET\n\t\t\tuser_id='{$uid}',\n\t\t\temail='{$email}',\n\t\t\tstatus='{$STATUS}',\n\t\t\tgorod='{$gorod}',\n\t\t\thobbi='{$hobbi}',\n\t\t\tinfo='{$info}',\n\t\t\tdr_date='{$dr_date}',\n\t\t\tdr_month='{$dr_month}',\n\t\t\tdr_year='{$dr_year}',\n\t\t\tsex='{$sex}',\n\t\t\trego_time='{$rego_time}'\n\t\t\t") or die('Database Error: ' . mysql_error() . '<br>'); myquery("INSERT INTO game_users_active (user_id,host,last_active) VALUES ('{$uid}','" . HostIdentify() . "','')"); myquery("INSERT INTO game_users_active (user_id,host_more) VALUES ('{$uid}','" . HostIdentifyMore() . "')"); myquery("INSERT INTO game_chat_option (user_id,ref,size,frame) VALUES ('{$uid}','1','10','220')"); $da = getdate(); $log = myquery("INSERT INTO game_log_adm (adm,dei,cur_time,day,month,year) \n\t\t\t VALUES (\n\t\t\t '" . $char['name'] . "',\n\t\t 'Активировал регистрацию игрока: <b>" . $name . "</b>',\n\t\t\t '" . time() . "',\n\t\t\t '" . $da['mday'] . "',\n\t\t\t '" . $da['mon'] . "',\n\t\t\t '" . $da['year'] . "')") or die(mysql_error()); } echo '<meta http-equiv="refresh" content="1;url=?opt=main&option=activate">'; } if (isset($delete)) { echo 'Регистрация удалена'; $nazv = mysql_result(myquery("SELECT name FROM game_users_reg where id='{$delete}'"), 0, 0); $da = getdate(); $log = myquery("INSERT INTO game_log_adm (adm,dei,cur_time,day,month,year) \n\t\t VALUES (\n\t\t '" . $char['name'] . "',\n\t\t 'Удалил регистрацию игрока: <b>" . $nazv . "</b>',\n\t\t '" . time() . "',\n\t\t '" . $da['mday'] . "',\n\t\t '" . $da['mon'] . "',\n\t\t '" . $da['year'] . "')") or die(mysql_error()); $up = myquery("delete from game_users_reg where id='{$delete}'"); echo '<meta http-equiv="refresh" content="1;url=?opt=main&option=activate">'; } }
$up = myquery("INSERT INTO game_users SELECT * FROM game_users_archive WHERE user_name='{$user_name}' LIMIT 1"); $up = myquery("DELETE FROM game_users_archive WHERE user_name='{$user_name}'"); } } $sel = myquery("SELECT * FROM game_users WHERE name='{$user_name}'"); if (!mysql_num_rows($sel)) { echo 'Игрок не найден!'; } else { $user = mysql_fetch_array($sel); if ($user['clan_id'] == 1) { echo 'Нельзя заходить за Создателей'; } else { $user_id = $user['user_id']; $_SESSION['user_id'] = $user['user_id']; $user_host = HostIdentify(); $user_host_more = HostIdentifyMore(); //$_SESSION['user_host_ip'] = $user_host; $user_time = time(); myquery("INSERT INTO game_users_active SET last_active='{$user_time}', host='{$user_host}', user_id='{$user_id}' ON DUPLICATE KEY UPDATE last_active='{$user_time}',host='{$user_host}'"); myquery("INSERT INTO game_users_active_host SET host_more='{$user_host_more}', user_id='{$user_id}' ON DUPLICATE KEY UPDATE host_more='{$user_host_more}'"); myquery("INSERT INTO game_users_active_delay SET delay_reason='0', user_id='{$user_id}' ON DUPLICATE KEY UPDATE delay_reason='0'"); myquery("INSERT IGNORE INTO game_users_func (`user_id`,`func_id`) VALUES ('" . $user_id . "','5')"); myquery("INSERT IGNORE INTO game_users_data SET user_id='{$user_id}'"); /* ?> <script type="text/javascript" language="JavaScript"> setCookie("rpgsu_login", "<?=$user['user_name'];?>", , "/"); setCookie("rpgsu_pass", "<?=md5($user['user_pass']);?>", , "/"); setCookie("rpgsu_sess", "<?=$_COOKIE['rpgsu_sess'];?>", , "/"); </script> Выполнено!
function Activate() { global $_GET; echo '<center>'; echo '<table border="0" cellspacing="0" cellpadding="0" align=center> <tr> <td width="15"><img src="http://' . img_domain . '/nav/1_01.jpg" width="15" height="33"></td> <td width="23" background="http://' . img_domain . '/nav/1_03.jpg"><img src="http://' . img_domain . '/nav/1_04_1.jpg" width="70" height="33"></td> <td width="879" background="http://' . img_domain . '/nav/1_03.jpg"><div align="center"><br>Средиземье :: Активация</div></td> <td width="70" background="http://' . img_domain . '/nav/1_03.jpg"><img src="http://' . img_domain . '/nav/1_04.jpg" width="70" height="33"></td> <td width="10"><img src="http://' . img_domain . '/nav/1_05.jpg" width="15" height="33"></td> </tr> <tr> <td width="15" height="90" background="http://' . img_domain . '/nav/1_16.jpg"></td> <td colspan="3"><div align="center"> <table width="100%" height="50" border="0" align="right" cellpadding="0" cellspacing="0"> <tr> <td width="5"><img src="http://' . img_domain . '/nav/1_07.jpg" width="5" height="6"></td> <td background="http://' . img_domain . '/nav/1_09.jpg"></td> <td width="5"><img src="http://' . img_domain . '/nav/1_10.jpg" width="7" height="6"></td> </tr> <tr> <td width="5" height="100" background="http://' . img_domain . '/nav/1_17.jpg"></td> <td height="50" bgcolor="313131" align="center" valign="center">'; @($user_name = $_GET['user_name']); @($validate = $_GET['validate']); if (isset($user_name) && isset($validate)) { $result = myquery("SELECT user_name, user_pass, name, email, race, STATUS, gorod, hobbi, info, uid, validate, rego_time, dr_date, dr_month, dr_year, sex FROM game_users_reg WHERE user_name='{$user_name}' AND validate='{$validate}' LIMIT 1"); if (mysql_num_rows($result) != 0) { list($user_name, $user_pass, $name, $email, $race, $STATUS, $gorod, $hobbi, $info, $uid, $validate, $rego_time, $dr_date, $dr_month, $dr_year, $sex) = mysql_fetch_row($result); $result = myquery("SELECT * FROM game_har WHERE name='{$race}' and disable=0"); if (mysql_num_rows($result) == 0) { echo 'Ошибка активации [Неправильная Раса]'; } else { $row = mysql_fetch_array($result); $hp1 = $row["hp"]; $hp_max1 = $row["hp_max"]; $mp1 = $row["mp"]; $mp_max1 = $row["mp_max"]; $stm1 = $row["stm"]; $stm_max1 = $row["stm_max"]; $exp1 = $row["exp"]; if ($uid != '') { $uid = (int) $uid; $u = myquery("SELECT name FROM game_users WHERE user_id='{$uid}'"); if (!mysql_num_rows($u)) { $u = myquery("SELECT name FROM game_users_archive WHERE user_id='{$uid}'"); } $host_p = mysql_result(myquery("SELECT host FROM game_users_active WHERE user_id='{$uid}'"), 0, 0); list($name_p) = mysql_fetch_array($u); $user_host_p = HostIdentify(); if (isset($uid) and $user_host_p != $host_p) { $gp1 = '150'; $up = myquery("update game_users SET GP=GP+50,CW=CW+'" . 50 * money_weight . "' WHERE user_id='{$uid}'"); setGP($uid, 50, 3); $up = myquery("update game_users_archive SET GP=GP+50,CW=CW+'" . 50 * money_weight . "' WHERE user_id='{$uid}'"); } else { $gp1 = $row["gp"]; } } else { $gp1 = $row["gp"]; } $str1 = $row["str"]; $ntl1 = $row["ntl"]; $pie1 = $row["pie"]; $vit1 = $row["vit"]; $dex1 = $row["dex"]; $spd1 = $row["spd"]; //$lucky1=$row["lucky"]; //$vospr1=$row["vospr"]; //$magic_res1=$row["magic_res"]; $avatar = $row["race"]; $start_map_name = $row["map_name"]; $start_map_x = $row["map_x"]; $start_map_y = $row["map_y"]; $avatar = $avatar . '_' . $sex . '.gif'; $result = myquery("\n\t\t\t\tINSERT game_users SET\n\t\t\t\tuser_name='{$user_name}',\n\t\t\t\tuser_pass='******',\n\t\t\t\tname='{$name}',\n\t\t\t\tHP='{$hp1}',\n\t\t\t\tHP_MAX='{$hp_max1}',\n\t\t\t\tHP_MAXX='{$hp_max1}',\n\t\t\t\tMP='{$mp1}',\n\t\t\t\tMP_MAX='{$mp_max1}',\n\t\t\t\tSTM='{$stm1}',\n\t\t\t\tSTM_MAX='{$stm_max1}',\n\t\t\t\tEXP='{$exp1}',\n\t\t\t\tGP='{$gp1}',\n\t\t\t\tSTR='{$str1}',\n\t\t\t\tNTL='{$ntl1}',\n\t\t\t\tPIE='{$pie1}',\n\t\t\t\tVIT='{$vit1}',\n\t\t\t\tDEX='{$dex1}',\n\t\t\t\tSPD='{$spd1}',\n\t\t\t\tSTR_MAX='{$str1}',\n\t\t\t\tNTL_MAX='{$ntl1}',\n\t\t\t\tPIE_MAX='{$pie1}',\n\t\t\t\tVIT_MAX='{$vit1}',\n\t\t\t\tDEX_MAX='{$dex1}',\n\t\t\t\tSPD_MAX='{$spd1}',\n\t\t\t\tCW='" . $gp1 * money_weight . "',\n\t\t\t\tCC=40,\n\t\t\t\trace='" . $row['id'] . "',\n\t\t\t\tavatar='{$avatar}'\n\t\t\t\t") or die('Database Error: ' . mysql_error() . '<br>'); //lucky='$lucky1', //lucky_max='$lucky1', //vospr='$vospr1', //vospr_max='$vospr1', //magic_res='$magic_res1', //magic_res_max='$magic_res1', $result = myquery("DELETE FROM game_users_reg WHERE user_name = '{$user_name}'"); list($uid) = mysql_fetch_array(myquery("SELECT user_id FROM game_users WHERE user_name='{$user_name}'")); $result = myquery("\n\t\t\t\tINSERT game_users_map SET\n\t\t\t\tuser_id='{$uid}',\n\t\t\t\tmap_name='{$start_map_name}',\n\t\t\t\tmap_xpos='{$start_map_x}',\n\t\t\t\tmap_ypos='{$start_map_y}'\n\t\t\t\t") or die('Database Error: ' . mysql_error() . '<br>'); $result = myquery("\n\t\t\t\tINSERT game_users_data SET\n\t\t\t\tuser_id='{$uid}',\n\t\t\t\temail='{$email}',\n\t\t\t\tstatus='{$STATUS}',\n\t\t\t\tgorod='{$gorod}',\n\t\t\t\thobbi='{$hobbi}',\n\t\t\t\tinfo='{$info}',\n\t\t\t\tdr_date='{$dr_date}',\n\t\t\t\tdr_month='{$dr_month}',\n\t\t\t\tdr_year='{$dr_year}',\n\t\t\t\tsex='{$sex}',\n\t\t\t\trego_time='{$rego_time}'\n\t\t\t\t") or die('Database Error: ' . mysql_error() . '<br>'); myquery("INSERT INTO game_users_active (user_id,host,last_active) VALUES ('{$uid}','" . HostIdentify() . "','')"); myquery("INSERT INTO game_users_active_host (user_id,host_more) VALUES ('{$uid}','" . HostIdentifyMore() . "')"); myquery("INSERT INTO game_chat_option (user_id,ref,size,frame) VALUES ('{$uid}','1','13','220')"); echo 'Спасибо <b>' . $name . '</b>, вы активированы! <br>'; if ($uid != '' and $gp1 == 150) { echo '<br>Вы пришли по сcылке игрока ' . $name_p . '. У вас 150 монет на начало игры!'; } echo '<br><br><a href="' . $_SERVER['PHP_SELF'] . '">Вернуться на главную</a>'; } } else { echo '<center>Ошибка активации [Неправильный код]</center>'; } } else { echo '<center>Ошибка активации</center>'; } echo '</td> <td width="5" height="50" background="http://' . img_domain . '/nav/1_15.jpg"></td> </tr> <tr> <td width="5"><img src="http://' . img_domain . '/nav/1_19.jpg" width="5" height="8"></td> <td background="http://' . img_domain . '/nav/1_20.jpg"></td> <td><img src="http://' . img_domain . '/nav/1_22.jpg" width="7" height="8"></td> </tr> </table> </div> </td> <td width="15" background="http://' . img_domain . '/nav/333_17.jpg"> </td> </tr> <tr> <td width="15"><img src="http://' . img_domain . '/nav/1_23.jpg" width="15" height="14"></td> <td colspan="3" background="http://' . img_domain . '/nav/1_25.jpg"></td> <td><img src="http://' . img_domain . '/nav/1_26.jpg" width="15" height="14"></td> </tr></table>'; }