[Release] TwilightMu Website Clone + Grand Reset + Online Time Trade

Dungeon

New Member
Joined
Nov 15, 2009
Messages
2,234
Reaction score
819
3TMbH.jpg


PHP:
alter table character add GrandResets int not null default 0
Download
 

Attachments

  • header_top.jpg
    header_top.jpg
    301.4 KB · Views: 156
Last edited:
всичко е тип-топ ! но имам една не точно забележка, уеб-а ще работи перфектно само на версия 99б и нагоре... не е лошо да се помисли за функция която да задава каква е версията на сървъра и спрямо това уеб-а да работи на 100%, иначе всичко останало няма грешка ! :)
 
всичко е тип-топ ! но имам една не точно забележка, уеб-а ще работи перфектно само на версия 99б и нагоре... не е лошо да се помисли за функция която да задава каква е версията на сървъра и спрямо това уеб-а да работи на 100%, иначе всичко останало няма грешка ! :)

Искаш да кажеш че при 97д ще имаме проблеми с сайта?
 
Искаш да кажеш че при 97д ще имаме проблеми с сайта?

да !
ето това е кода който трябва да се сложи в core.php за весия като 97д... ако съм сбъркал нещо кажете :)


PHP:
<?php

function login()
{
if(isset($_POST['login']))
{
$account = secure($_POST['account']);
$password = secure($_POST['password']);
check_inject();

$check_accq = mssql_query("Select * from MEMB_INFO where memb___id='$account' and memb__pwd='$password'");
$check_acc = mssql_num_rows($check_accq);

if($check_acc == 0) {}
else
{
$_SESSION['user'] = $account;
$_SESSION['pass'] = $password;
header('Location: ?op=user');
}}
if(isset($_POST['logout']))
{
unset($_SESSION['user']);
unset($_SESSION['pass']);
header('Location: index.php');
}}

function check_login()
{
if($_GET['op'] == user & $_SESSION['user'] == false or $_GET['op'] == account & $_SESSION['user'] == false) { header('Location: index.php'); }
}

function pk_clear() {

$character = secure($_POST['character']);
$account = secure($_SESSION['user']);

check_inject();

global $pkclearmoney;

$charq = mssql_query("Select money,PkTime from Character where Name='$character'");
$char = mssql_fetch_row($charq);

$money = $pkclearmoney * $row[1];
$rmoney = $row[0] - $money;

$statusaq = mssql_query("select * from MEMB_STAT where memb___id='$account' and connectstat='1'");
$statusa = mssql_num_rows($statusaq);
if($statusa != 0) { $statusq = mssql_query("select GameIDC From AccountCharacter where Id='$account'"); $statusr = mssql_fetch_row($statusq); }


if(empty($character)) { echo"<tr><td align='center' class='modules'><b>Error:</b> Please select Character !</td></tr>"; $error=1; }
else{
if($statusr[0] == $character) { echo"<tr><td align='center' class='modules'><b>Error:</b> Character $character Is Online ! Please Log Off !</td></tr>"; $error=1; }
if($char[1] == 0) { echo"<tr><td align='center' class='modules'><b>Error:</b> Character $character haven't got any kills to clear !</td></tr>"; $error=1; }
if($rmoney < 0) { echo"<tr><td align='center' class='modules'><b>Error:</b> Character $character haven't god enought money to clear !</td></tr>"; $error=1; }

if($error != 1) {
echo"<tr><td align='center' class='modules'><span class='online'>Character $character Successfuly cleared!</span></td></tr>";
$a = mssql_query("Update Character Set Money='$rmoney',PkLevel='3',PkTime='0' where name='$character'");
}}}

function add_stats() { 

$character = secure($_POST['character']);
$account = secure($_SESSION['user']);
$strength = secure($_POST['strength']);
$agility = secure($_POST['agility']);
$vitality = secure($_POST['vitality']);
$energy = secure($_POST['energy']);

check_inject();

$charq = mssql_query("Select leveluppoint,Strength,Dexterity,Vitality,Energy,class from Character where name='$character'");
$char = mssql_fetch_row($charq);

$newstrength = $strength + $char[1];
$newagility = $agility + $char[2];
$newvitality = $vitality + $char[3];
$newenergy = $energy + $char[4];

$allstats = $strength+$agility+$vitality+$energy;

$newleveluppoints = $char[0] - $allstats;

$statusaq = mssql_query("select * from MEMB_STAT where memb___id='$account' and connectstat='1'");
$statusa = mssql_num_rows($statusaq);
if($statusa != 0) { $statusq = mssql_query("select GameIDC From AccountCharacter where Id='$account'"); $statusr = mssql_fetch_row($statusq); }

if(empty($character)) { echo"<tr><td align='center' class='modules'><b>Error:</b> Please select Character !</td></tr>"; $error=1; }
else{
if($statusr[0] == $character) { echo"<tr><td align='center' class='modules'><b>Error:</b> Character $character Is Online ! Please Log Off !</td></tr>"; $error=1; }
if($char[0] < $allstats) { echo"<tr><td align='center' class='modules'><b>Error:</b> Character $character haven't got enought points !</td></tr>"; $error=1; }
elseif($newstrength > 32767  or $newagility > 32767 or $newvitality > 32767 or $newenergy > 32767 { echo"<tr><td align='center' class='modules'><b>Error:</b> You can't add more than 32767 points !</td></tr>"; $error=1; }
if($error != 1)
{
echo"<tr><td align='center' class='modules'><span class='online'>Points Successfuly added and now $character have $newstrength Strenght , $newagility Agility , $newvitality Vitality , $newenergy Energy and $newleveluppoints points to add ! </span></td></tr>";

$a = mssql_query("Update Character set leveluppoint='$newleveluppoints',Strength='$newstrength',Dexterity='$newagility',Vitality='$newvitality',Energy='$newenergy' where name='$character'");



}}}

function clear_skills()
{
$character = secure($_POST['character']);
$account = secure($_SESSION['user']);

check_inject();

$statusaq = mssql_query("select * from MEMB_STAT where memb___id='$account' and connectstat='1'");
$statusa = mssql_num_rows($statusaq);
if($statusa != 0) { $statusq = mssql_query("select GameIDC From AccountCharacter where Id='$account'"); $statusr = mssql_fetch_row($statusq); }


if(empty($character)) { echo"<tr><td align='center' class='modules'><b>Error:</b> Please select Character !</td></tr>"; $error=1; }
else{
if($statusr[0] == $character) { echo"<tr><td align='center' class='modules'><b>Error:</b> Character $character Is Online ! Please Log Off !</td></tr>"; $error=1; }

if($error != 1) {
echo"<tr><td align='center' class='modules'><span class='online'>Character $character magic list successfuly cleared !</span></td></tr>";

$a = mssql_query("UPDATE Character SET [magiclist]=CONVERT(varbinary(180), null) WHERE Name='$character'");

}}}

function clear_inventory()
{
$character = secure($_POST['character']);
$account = secure($_SESSION['user']);

check_inject();

$statusaq = mssql_query("select * from MEMB_STAT where memb___id='$account' and connectstat='1'");
$statusa = mssql_num_rows($statusaq);
if($statusa != 0) { $statusq = mssql_query("select GameIDC From AccountCharacter where Id='$account'"); $statusr = mssql_fetch_row($statusq); }


if(empty($character)) { echo"<tr><td align='center' class='modules'><b>Error:</b> Please select Character !</td></tr>"; $error=1; }
else{
if($statusr[0] == $character) { echo"<tr><td align='center' class='modules'><b>Error:</b> Character $character Is Online ! Please Log Off !</td></tr>"; $error=1; }

if($error != 1) {
echo"<tr><td align='center' class='modules'><span class='online'>Character $character inventory successfuly cleared !</span></td></tr>";

$a = mssql_query("UPDATE Character SET [inventory]=CONVERT(varbinary(1560), null) WHERE Name='$character'");

}}}

function reset_character()
{
$character = secure($_POST['character']);
$account = secure($_SESSION['user']);

check_inject();

global $resetlevel;
global $resettype;
global $resetpoints;
global $resetmoney;
global $maxresets;


$charq = mssql_query("Select clevel,Resets,money,leveluppoint from Character where name='$character'");
$char = mssql_fetch_row($charq);

$statusaq = mssql_query("select * from MEMB_STAT where memb___id='$account' and connectstat='1'");
$statusa = mssql_num_rows($statusaq);
if($statusa != 0) { $statusq = mssql_query("select GameIDC From AccountCharacter where Id='$account'"); $statusr = mssql_fetch_row($statusq); }

$newresets = $char[1] + 1;
$newmoney = $char[2] - $resetmoney;
$newpoints = $char[1] * $resetpoints;

$bonus = $char[3] + $resetpoints;

if(empty($character)) { echo"<tr><td align='center' class='modules'><b>Error:</b> Please select Character !</td></tr>"; $error=1; }
else{
if($statusr[0] == $character) { echo"<tr><td align='center' class='modules'><b>Error:</b> Character $character Is Online ! Please Log Off !</td></tr>"; $error=1; }
if($char[0] <= $resetlevel) { echo"<tr><td align='center' class='modules'><b>Error:</b> Character $character haven't got $resetlevel to reset !</td></tr>"; $error=1; }
if($char[2] < $resetmoney) { echo"<tr><td align='center' class='modules'><b>Error:</b> Character $character haven't god enought money to reset !</td></tr>"; $error=1; }
if($newresets > $maxresets) { echo"<tr><td align='center' class='modules'><b>Error:</b> Character $character have reached the maximum resets !</td></tr>"; $error=1; }

if($error != 1) {
echo"<tr><td align='center' class='modules'><span class='online'>Character $character successfuly restarted !</span></td></tr>";

if($resettype == keep) { $a = mssql_query("Update Character Set Money='$newmoney',clevel='1',Experience='0',Resets='$newresets' where name='$character'"); }
elseif($resettype == bonus) { $a = mssql_query("Update Character Set Money='$newmoney',clevel='1',Experience='0',Resets='$newresets',LevelUpPoint='$bonus' where name='$character'"); }
elseif($resettype == reset) { $a = mssql_query("Update Character Set Strength='25',Dexterity='25',Vitality='25',Energy='25',Money='$newmoney',clevel='1',Experience='0',Resets='$newresets',LevelUpPoint='$newpoints' where name='$character'"); }
}}}

function vote_link() { 
$account = secure($_SESSION['user']); 
$vote = secure($_POST['vote']); 
check_inject(); 

$time = time(); 
$time2 = $time - 86400; 

$accq = mssql_query("Select * from votes2 where account='$account'"); 
$acc = mssql_num_rows($accq); 

if ($acc == 0 and $_SESSION['user'] == true){  
$a = mssql_query("INSERT INTO votes2 (account,time) VALUES ('$account','$time')"); 
echo "<meta http-equiv=\"refresh\" content=\"0;url=?op=user\">"; 
} 
elseif ($acc != 0 and $_SESSION['user'] == true) { 
$a = mssql_query("Update votes2 Set account='$account', time='$time' where account='$account'"); 
echo "<meta http-equiv=\"refresh\" content=\"0;url=?op=user\">"; 
}}  

function time_trade() {
if ((isset($_SESSION['pass'])) && (isset($_SESSION['user']))); {
$login = stripslashes ($_SESSION['user']);
$char = stripslashes ($_POST['chars']);
global $minutesneed;
global $creditsbonus;
$username_check = mssql_query("SELECT memb___id FROM MEMB_INFO WHERE memb___id='$login'"); 
$username_checked = mssql_num_rows($username_check);  
$name_check = mssql_query("SELECT Name FROM Character WHERE Name='$char' and AccountID ='$login'"); 
$name_checked = mssql_num_rows($name_check); 
$online_check = mssql_query("SELECT * FROM MEMB_STAT WHERE memb___id='$login'");
$online_checked = mssql_fetch_array($online_check);
$result = mssql_query("SELECT * FROM Character WHERE Name='$char'");
$row = mssql_fetch_array($result);
if (empty($char)) { echo "<tr><td align='center' class='modules'>Please Select Character!</td></tr>"; $error=1; }
elseif ($online_checked['ConnectStat'] != 0){ echo "<tr><td align='center' class='modules'>Account is online, must be logged off!</td></tr>"; $error=1; }
elseif ($row['TotalTime'] < $minutesneed){ echo "<tr><td align='center' class='modules'>$char need <b>$minutesneed</b> minutes to Trade Time!</td></tr>"; $error=1; }

if ($error !=1) {
mssql_query("UPDATE [Character] SET [TotalTime]=[TotalTime]-'$minutesneed' WHERE [Name]='$char'");
mssql_query("UPDATE memb_credits SET [credits]=credits+$creditsbonus WHERE memb___id='$login'");
echo "<tr><td align='center' class='modules'><b>$char</b> successfully traded $minutesneed Minutes and win $creditsbonus Credits!</td></tr><br />";
} 
 }
  }
  
function grand_reset() {
if ((isset($_SESSION['pass'])) && (isset($_SESSION['user']))); {
$login = stripslashes($_SESSION['user']);
$char = stripslashes($_POST['chars']);
global $resetsneed;
global $credits;
$username_check = mssql_query("SELECT memb___id FROM MEMB_INFO WHERE memb___id='$login'"); 
$username_checked = mssql_num_rows($username_check);  
$name_check = mssql_query("SELECT Name FROM Character WHERE Name='$char' and AccountID ='$login'"); 
$name_checked = mssql_num_rows($name_check); 
$online_check = mssql_query("SELECT * FROM MEMB_STAT WHERE memb___id='$login'");
$online_checked = mssql_fetch_array($online_check);
$result = mssql_query("SELECT * FROM Character WHERE Name='$char'");
$row = mssql_fetch_array($result);
if (empty($char)) { echo "<tr><td align='center' class='modules'>Please Select Character!</td></tr>"; $error=1; }
elseif ($online_checked['ConnectStat'] != 0){ echo "<tr><td align='center' class='modules'>Account is online, must be logged off!</td></tr>"; $error=1; }
elseif ($row['Resets'] < $resetsneed){ echo "<tr><td align='center' class='modules'>$char need <b>$resetsneed</b> resets to do Grand Reset!</td></tr>"; $error=1; }

if ($error !=1) {
mssql_query("UPDATE [Character] SET [Resets]=[Resets]-'$resetsneed',[GrandResets]=[GrandResets]+'1' WHERE [Name]='$char'");
mssql_query("UPDATE memb_credits SET [credits]=credits+$credits WHERE memb___id='$login'");
echo "<tr><td align='center' class='modules'><b>$char</b> successfully maked Grand Reset!</td></tr><br />";
} 
 }
  }
  
  function register()
{
global $md5;
global $servername;

$account = secure($_POST['account']);
$password = secure($_POST['password']);
$repassword = secure($_POST['repassword']);
$email = secure($_POST['email']);
$question = secure($_POST['squestion']);
$awnser = secure($_POST['sanswer']);

$accounts = strlen($account);
$passwords = strlen($password);
$repasswords = strlen($repassword);
$questions = strlen($question);
$awnsers = strlen($awnser);

check_inject();

$queryaccount = mssql_query("Select * from MEMB_INFO where memb___id='$account'");
$accountcheck = mssql_num_rows($queryaccount);

$querymail = mssql_query("Select * from MEMB_INFO where mail_addr='$email'");
$mailcheck = mssql_num_rows($querymail);

$date = date('Y-m-d H:i:s');

if(empty($account) or empty($password) or empty($repassword) or empty($email) or empty($question) or empty($awnser)) { echo"<font color='red'>You cannot leave any fields blank!</font><br>"; $error=1; }
if($accounts < 4) { echo"<font color='red'>Account must be at least 4 symbols</font><br>"; $error=1; }
if($passwords < 4 or $repasswords < 4) { echo"<font color='red'>Password must be at least 4 symbols</font><br>"; $error=1; }
if($questions < 4) { echo"<font color='red'>Secret Question must be at least 4 symbols</font><br>"; $error=1; }
if($awnsers < 4) { echo"<font color='red'>Secret Answer must be at least 4 symbols</font><br>"; $error=1; }
if($password != $repassword) { echo"<font color='red'>Passwords didn't match!</font><br>"; $error=1; }
if($accountcheck != 0) { echo"<font color='red'>Account is already in use!</font><br>"; $error=1; }
if($mail != 0) { echo"<font color='red'>Email is already in use!</font><br>"; $error=1; }

if($error != 1) {

echo"<font color='green'>Account $account has been succsesfuly created on $date!</font><br>";

if($md5 == 0) {
$a = mssql_query("INSERT INTO MEMB_INFO (memb___id,memb__pwd,memb_name,sno__numb,mail_addr,appl_days,modi_days,out__days,true_days,mail_chek,bloc_code,ctl1_code,fpas_ques,fpas_answ) VALUES ('$account','$password','$servername','1','$email','$date','$date','$date','$date','1','0','0','$question','$awnser')");
$b = mssql_query("INSERT INTO VI_CURR_INFO (ends_days,chek_code,used_time,memb___id,memb_name,memb_guid,sno__numb,Bill_Section,Bill_value,Bill_Hour,Surplus_Point,Surplus_Minute,Increase_Days ) VALUES ('2010','1',1234,'$account','$account',1,'7','6','3','6','6','$date','0' )");
}
else
{
$a = mssql_query("INSERT INTO MEMB_INFO (memb___id,memb__pwd,memb_name,sno__numb,mail_addr,appl_days,modi_days,out__days,true_days,mail_chek,bloc_code,ctl1_code,fpas_ques,fpas_answ) VALUES ('$account',md5($password),'$servername','1','$email','$date','$date','$date','$date','1','0','0','$question','$awnser')");
$b = mssql_query("INSERT INTO VI_CURR_INFO (ends_days,chek_code,used_time,memb___id,memb_name,memb_guid,sno__numb,Bill_Section,Bill_value,Bill_Hour,Surplus_Point,Surplus_Minute,Increase_Days ) VALUES ('2010','1',1234,'$account','$account',1,'7','6','3','6','6','$date','0' )");
}
}
}


?>
 
  • Like
Reactions: Ivaylo99
Чистият хеадер не си пасва с backgrounda , както при оригиналния хеадер
 
да !
ето това е кода който трябва да се сложи в core.php за весия като 97д... ако съм сбъркал нещо кажете :)


PHP:
<?php

function login()
{
if(isset($_POST['login']))
{
$account = secure($_POST['account']);
$password = secure($_POST['password']);
check_inject();

$check_accq = mssql_query("Select * from MEMB_INFO where memb___id='$account' and memb__pwd='$password'");
$check_acc = mssql_num_rows($check_accq);

if($check_acc == 0) {}
else
{
$_SESSION['user'] = $account;
$_SESSION['pass'] = $password;
header('Location: ?op=user');
}}
if(isset($_POST['logout']))
{
unset($_SESSION['user']);
unset($_SESSION['pass']);
header('Location: index.php');
}}

function check_login()
{
if($_GET['op'] == user & $_SESSION['user'] == false or $_GET['op'] == account & $_SESSION['user'] == false) { header('Location: index.php'); }
}

function pk_clear() {

$character = secure($_POST['character']);
$account = secure($_SESSION['user']);

check_inject();

global $pkclearmoney;

$charq = mssql_query("Select money,PkTime from Character where Name='$character'");
$char = mssql_fetch_row($charq);

$money = $pkclearmoney * $row[1];
$rmoney = $row[0] - $money;

$statusaq = mssql_query("select * from MEMB_STAT where memb___id='$account' and connectstat='1'");
$statusa = mssql_num_rows($statusaq);
if($statusa != 0) { $statusq = mssql_query("select GameIDC From AccountCharacter where Id='$account'"); $statusr = mssql_fetch_row($statusq); }


if(empty($character)) { echo"<tr><td align='center' class='modules'><b>Error:</b> Please select Character !</td></tr>"; $error=1; }
else{
if($statusr[0] == $character) { echo"<tr><td align='center' class='modules'><b>Error:</b> Character $character Is Online ! Please Log Off !</td></tr>"; $error=1; }
if($char[1] == 0) { echo"<tr><td align='center' class='modules'><b>Error:</b> Character $character haven't got any kills to clear !</td></tr>"; $error=1; }
if($rmoney < 0) { echo"<tr><td align='center' class='modules'><b>Error:</b> Character $character haven't god enought money to clear !</td></tr>"; $error=1; }

if($error != 1) {
echo"<tr><td align='center' class='modules'><span class='online'>Character $character Successfuly cleared!</span></td></tr>";
$a = mssql_query("Update Character Set Money='$rmoney',PkLevel='3',PkTime='0' where name='$character'");
}}}

function add_stats() { 

$character = secure($_POST['character']);
$account = secure($_SESSION['user']);
$strength = secure($_POST['strength']);
$agility = secure($_POST['agility']);
$vitality = secure($_POST['vitality']);
$energy = secure($_POST['energy']);

check_inject();

$charq = mssql_query("Select leveluppoint,Strength,Dexterity,Vitality,Energy,class from Character where name='$character'");
$char = mssql_fetch_row($charq);

$newstrength = $strength + $char[1];
$newagility = $agility + $char[2];
$newvitality = $vitality + $char[3];
$newenergy = $energy + $char[4];

$allstats = $strength+$agility+$vitality+$energy;

$newleveluppoints = $char[0] - $allstats;

$statusaq = mssql_query("select * from MEMB_STAT where memb___id='$account' and connectstat='1'");
$statusa = mssql_num_rows($statusaq);
if($statusa != 0) { $statusq = mssql_query("select GameIDC From AccountCharacter where Id='$account'"); $statusr = mssql_fetch_row($statusq); }

if(empty($character)) { echo"<tr><td align='center' class='modules'><b>Error:</b> Please select Character !</td></tr>"; $error=1; }
else{
if($statusr[0] == $character) { echo"<tr><td align='center' class='modules'><b>Error:</b> Character $character Is Online ! Please Log Off !</td></tr>"; $error=1; }
if($char[0] < $allstats) { echo"<tr><td align='center' class='modules'><b>Error:</b> Character $character haven't got enought points !</td></tr>"; $error=1; }
elseif($newstrength > 32767  or $newagility > 32767 or $newvitality > 32767 or $newenergy > 32767 { echo"<tr><td align='center' class='modules'><b>Error:</b> You can't add more than 32767 points !</td></tr>"; $error=1; }
if($error != 1)
{
echo"<tr><td align='center' class='modules'><span class='online'>Points Successfuly added and now $character have $newstrength Strenght , $newagility Agility , $newvitality Vitality , $newenergy Energy and $newleveluppoints points to add ! </span></td></tr>";

$a = mssql_query("Update Character set leveluppoint='$newleveluppoints',Strength='$newstrength',Dexterity='$newagility',Vitality='$newvitality',Energy='$newenergy' where name='$character'");



}}}

function clear_skills()
{
$character = secure($_POST['character']);
$account = secure($_SESSION['user']);

check_inject();

$statusaq = mssql_query("select * from MEMB_STAT where memb___id='$account' and connectstat='1'");
$statusa = mssql_num_rows($statusaq);
if($statusa != 0) { $statusq = mssql_query("select GameIDC From AccountCharacter where Id='$account'"); $statusr = mssql_fetch_row($statusq); }


if(empty($character)) { echo"<tr><td align='center' class='modules'><b>Error:</b> Please select Character !</td></tr>"; $error=1; }
else{
if($statusr[0] == $character) { echo"<tr><td align='center' class='modules'><b>Error:</b> Character $character Is Online ! Please Log Off !</td></tr>"; $error=1; }

if($error != 1) {
echo"<tr><td align='center' class='modules'><span class='online'>Character $character magic list successfuly cleared !</span></td></tr>";

$a = mssql_query("UPDATE Character SET [magiclist]=CONVERT(varbinary(180), null) WHERE Name='$character'");

}}}

function clear_inventory()
{
$character = secure($_POST['character']);
$account = secure($_SESSION['user']);

check_inject();

$statusaq = mssql_query("select * from MEMB_STAT where memb___id='$account' and connectstat='1'");
$statusa = mssql_num_rows($statusaq);
if($statusa != 0) { $statusq = mssql_query("select GameIDC From AccountCharacter where Id='$account'"); $statusr = mssql_fetch_row($statusq); }


if(empty($character)) { echo"<tr><td align='center' class='modules'><b>Error:</b> Please select Character !</td></tr>"; $error=1; }
else{
if($statusr[0] == $character) { echo"<tr><td align='center' class='modules'><b>Error:</b> Character $character Is Online ! Please Log Off !</td></tr>"; $error=1; }

if($error != 1) {
echo"<tr><td align='center' class='modules'><span class='online'>Character $character inventory successfuly cleared !</span></td></tr>";

$a = mssql_query("UPDATE Character SET [inventory]=CONVERT(varbinary(1560), null) WHERE Name='$character'");

}}}

function reset_character()
{
$character = secure($_POST['character']);
$account = secure($_SESSION['user']);

check_inject();

global $resetlevel;
global $resettype;
global $resetpoints;
global $resetmoney;
global $maxresets;


$charq = mssql_query("Select clevel,Resets,money,leveluppoint from Character where name='$character'");
$char = mssql_fetch_row($charq);

$statusaq = mssql_query("select * from MEMB_STAT where memb___id='$account' and connectstat='1'");
$statusa = mssql_num_rows($statusaq);
if($statusa != 0) { $statusq = mssql_query("select GameIDC From AccountCharacter where Id='$account'"); $statusr = mssql_fetch_row($statusq); }

$newresets = $char[1] + 1;
$newmoney = $char[2] - $resetmoney;
$newpoints = $char[1] * $resetpoints;

$bonus = $char[3] + $resetpoints;

if(empty($character)) { echo"<tr><td align='center' class='modules'><b>Error:</b> Please select Character !</td></tr>"; $error=1; }
else{
if($statusr[0] == $character) { echo"<tr><td align='center' class='modules'><b>Error:</b> Character $character Is Online ! Please Log Off !</td></tr>"; $error=1; }
if($char[0] <= $resetlevel) { echo"<tr><td align='center' class='modules'><b>Error:</b> Character $character haven't got $resetlevel to reset !</td></tr>"; $error=1; }
if($char[2] < $resetmoney) { echo"<tr><td align='center' class='modules'><b>Error:</b> Character $character haven't god enought money to reset !</td></tr>"; $error=1; }
if($newresets > $maxresets) { echo"<tr><td align='center' class='modules'><b>Error:</b> Character $character have reached the maximum resets !</td></tr>"; $error=1; }

if($error != 1) {
echo"<tr><td align='center' class='modules'><span class='online'>Character $character successfuly restarted !</span></td></tr>";

if($resettype == keep) { $a = mssql_query("Update Character Set Money='$newmoney',clevel='1',Experience='0',Resets='$newresets' where name='$character'"); }
elseif($resettype == bonus) { $a = mssql_query("Update Character Set Money='$newmoney',clevel='1',Experience='0',Resets='$newresets',LevelUpPoint='$bonus' where name='$character'"); }
elseif($resettype == reset) { $a = mssql_query("Update Character Set Strength='25',Dexterity='25',Vitality='25',Energy='25',Money='$newmoney',clevel='1',Experience='0',Resets='$newresets',LevelUpPoint='$newpoints' where name='$character'"); }
}}}

function vote_link() { 
$account = secure($_SESSION['user']); 
$vote = secure($_POST['vote']); 
check_inject(); 

$time = time(); 
$time2 = $time - 86400; 

$accq = mssql_query("Select * from votes2 where account='$account'"); 
$acc = mssql_num_rows($accq); 

if ($acc == 0 and $_SESSION['user'] == true){  
$a = mssql_query("INSERT INTO votes2 (account,time) VALUES ('$account','$time')"); 
echo "<meta http-equiv=\"refresh\" content=\"0;url=?op=user\">"; 
} 
elseif ($acc != 0 and $_SESSION['user'] == true) { 
$a = mssql_query("Update votes2 Set account='$account', time='$time' where account='$account'"); 
echo "<meta http-equiv=\"refresh\" content=\"0;url=?op=user\">"; 
}}  

function time_trade() {
if ((isset($_SESSION['pass'])) && (isset($_SESSION['user']))); {
$login = stripslashes ($_SESSION['user']);
$char = stripslashes ($_POST['chars']);
global $minutesneed;
global $creditsbonus;
$username_check = mssql_query("SELECT memb___id FROM MEMB_INFO WHERE memb___id='$login'"); 
$username_checked = mssql_num_rows($username_check);  
$name_check = mssql_query("SELECT Name FROM Character WHERE Name='$char' and AccountID ='$login'"); 
$name_checked = mssql_num_rows($name_check); 
$online_check = mssql_query("SELECT * FROM MEMB_STAT WHERE memb___id='$login'");
$online_checked = mssql_fetch_array($online_check);
$result = mssql_query("SELECT * FROM Character WHERE Name='$char'");
$row = mssql_fetch_array($result);
if (empty($char)) { echo "<tr><td align='center' class='modules'>Please Select Character!</td></tr>"; $error=1; }
elseif ($online_checked['ConnectStat'] != 0){ echo "<tr><td align='center' class='modules'>Account is online, must be logged off!</td></tr>"; $error=1; }
elseif ($row['TotalTime'] < $minutesneed){ echo "<tr><td align='center' class='modules'>$char need <b>$minutesneed</b> minutes to Trade Time!</td></tr>"; $error=1; }

if ($error !=1) {
mssql_query("UPDATE [Character] SET [TotalTime]=[TotalTime]-'$minutesneed' WHERE [Name]='$char'");
mssql_query("UPDATE memb_credits SET [credits]=credits+$creditsbonus WHERE memb___id='$login'");
echo "<tr><td align='center' class='modules'><b>$char</b> successfully traded $minutesneed Minutes and win $creditsbonus Credits!</td></tr><br />";
} 
 }
  }
  
function grand_reset() {
if ((isset($_SESSION['pass'])) && (isset($_SESSION['user']))); {
$login = stripslashes($_SESSION['user']);
$char = stripslashes($_POST['chars']);
global $resetsneed;
global $credits;
$username_check = mssql_query("SELECT memb___id FROM MEMB_INFO WHERE memb___id='$login'"); 
$username_checked = mssql_num_rows($username_check);  
$name_check = mssql_query("SELECT Name FROM Character WHERE Name='$char' and AccountID ='$login'"); 
$name_checked = mssql_num_rows($name_check); 
$online_check = mssql_query("SELECT * FROM MEMB_STAT WHERE memb___id='$login'");
$online_checked = mssql_fetch_array($online_check);
$result = mssql_query("SELECT * FROM Character WHERE Name='$char'");
$row = mssql_fetch_array($result);
if (empty($char)) { echo "<tr><td align='center' class='modules'>Please Select Character!</td></tr>"; $error=1; }
elseif ($online_checked['ConnectStat'] != 0){ echo "<tr><td align='center' class='modules'>Account is online, must be logged off!</td></tr>"; $error=1; }
elseif ($row['Resets'] < $resetsneed){ echo "<tr><td align='center' class='modules'>$char need <b>$resetsneed</b> resets to do Grand Reset!</td></tr>"; $error=1; }

if ($error !=1) {
mssql_query("UPDATE [Character] SET [Resets]=[Resets]-'$resetsneed',[GrandResets]=[GrandResets]+'1' WHERE [Name]='$char'");
mssql_query("UPDATE memb_credits SET [credits]=credits+$credits WHERE memb___id='$login'");
echo "<tr><td align='center' class='modules'><b>$char</b> successfully maked Grand Reset!</td></tr><br />";
} 
 }
  }
  
  function register()
{
global $md5;
global $servername;

$account = secure($_POST['account']);
$password = secure($_POST['password']);
$repassword = secure($_POST['repassword']);
$email = secure($_POST['email']);
$question = secure($_POST['squestion']);
$awnser = secure($_POST['sanswer']);

$accounts = strlen($account);
$passwords = strlen($password);
$repasswords = strlen($repassword);
$questions = strlen($question);
$awnsers = strlen($awnser);

check_inject();

$queryaccount = mssql_query("Select * from MEMB_INFO where memb___id='$account'");
$accountcheck = mssql_num_rows($queryaccount);

$querymail = mssql_query("Select * from MEMB_INFO where mail_addr='$email'");
$mailcheck = mssql_num_rows($querymail);

$date = date('Y-m-d H:i:s');

if(empty($account) or empty($password) or empty($repassword) or empty($email) or empty($question) or empty($awnser)) { echo"<font color='red'>You cannot leave any fields blank!</font><br>"; $error=1; }
if($accounts < 4) { echo"<font color='red'>Account must be at least 4 symbols</font><br>"; $error=1; }
if($passwords < 4 or $repasswords < 4) { echo"<font color='red'>Password must be at least 4 symbols</font><br>"; $error=1; }
if($questions < 4) { echo"<font color='red'>Secret Question must be at least 4 symbols</font><br>"; $error=1; }
if($awnsers < 4) { echo"<font color='red'>Secret Answer must be at least 4 symbols</font><br>"; $error=1; }
if($password != $repassword) { echo"<font color='red'>Passwords didn't match!</font><br>"; $error=1; }
if($accountcheck != 0) { echo"<font color='red'>Account is already in use!</font><br>"; $error=1; }
if($mail != 0) { echo"<font color='red'>Email is already in use!</font><br>"; $error=1; }

if($error != 1) {

echo"<font color='green'>Account $account has been succsesfuly created on $date!</font><br>";

if($md5 == 0) {
$a = mssql_query("INSERT INTO MEMB_INFO (memb___id,memb__pwd,memb_name,sno__numb,mail_addr,appl_days,modi_days,out__days,true_days,mail_chek,bloc_code,ctl1_code,fpas_ques,fpas_answ) VALUES ('$account','$password','$servername','1','$email','$date','$date','$date','$date','1','0','0','$question','$awnser')");
$b = mssql_query("INSERT INTO VI_CURR_INFO (ends_days,chek_code,used_time,memb___id,memb_name,memb_guid,sno__numb,Bill_Section,Bill_value,Bill_Hour,Surplus_Point,Surplus_Minute,Increase_Days ) VALUES ('2010','1',1234,'$account','$account',1,'7','6','3','6','6','$date','0' )");
}
else
{
$a = mssql_query("INSERT INTO MEMB_INFO (memb___id,memb__pwd,memb_name,sno__numb,mail_addr,appl_days,modi_days,out__days,true_days,mail_chek,bloc_code,ctl1_code,fpas_ques,fpas_answ) VALUES ('$account',md5($password),'$servername','1','$email','$date','$date','$date','$date','1','0','0','$question','$awnser')");
$b = mssql_query("INSERT INTO VI_CURR_INFO (ends_days,chek_code,used_time,memb___id,memb_name,memb_guid,sno__numb,Bill_Section,Bill_value,Bill_Hour,Surplus_Point,Surplus_Minute,Increase_Days ) VALUES ('2010','1',1234,'$account','$account',1,'7','6','3','6','6','$date','0' )");
}
}
}


?>

Може ли да ми помогнеш? със този код ми дава грешка на ред 96.
Parse error: parse error in D:\Xampp\htdocs\includes\core.php on line 96


PHP:
elseif($newstrength > 32767  or $newagility > 32767 or $newvitality > 32767 or $newenergy > 32767 { echo"<tr><td align='center' class='modules'><b>Error:</b> You can't add more than 32767 points !</td></tr>"; $error=1; }

това е ред 96

това ми го показва когато се логнеш във сайта, демек си напишеш акаунта
 
Пиши ми на скайпа. Има го в профила. Утре ще ти помогна ако не побързаш.
 
Може ли да ми помогнеш? със този код ми дава грешка на ред 96.
Parse error: parse error in D:\Xampp\htdocs\includes\core.php on line 96


PHP:
elseif($newstrength > 32767  or $newagility > 32767 or $newvitality > 32767 or $newenergy > 32767 { echo"<tr><td align='center' class='modules'><b>Error:</b> You can't add more than 32767 points !</td></tr>"; $error=1; }

това е ред 96

това ми го показва когато се логнеш във сайта, демек си напишеш акаунта

добави:
PHP:
if($error != 1)
след този 96-ти ред :) мисля, че ще стане
 
добави:
PHP:
if($error != 1)
след този 96-ти ред :) мисля, че ще стане

нестава :( то това си го има ... 97-ми ред само нямам това "!" накрая добавих го но не става...

edit:

PHP:
if($newstrength > 32767  or $newagility > 32767 or $newvitality > 32767 or $newenergy > 32767) { echo"<tr><td align='center' class='modules'><b>Error:</b> You can't add more than 32767 points !</td></tr>"; $error=1; }
ето така вече всичко работи! благодаря на ivowe3!
 
Last edited:
Липсва затварящата скоба на if-а )
 
може може в бързината не съм видял, че съм я изтрил скобата :)
 
а един въпрос дупки по сайта има ли ?