- Joined
- Apr 1, 2009
- Messages
- 1,220
- Reaction score
- 1,281
Тук ще ви дам PHP кода за Stone Rena депозит и ранк.
Installation:
1.В Query Analyzer-а добавяте това:
2. Променете тези редове с вашата информация:
3. Настройки на Ранкинга.
sranking.php - Stone
rranking.php - Rena
3.1 Попълвате информацията
3.2 За промяна на страницата. (брой акаунти на страница) променяте:
3.3 Стилът си го правите по ваша преценка(в момента няма).
ето кодовете:
Deposit Stone:
Rena Deposit:
Stone Ranking:
Rena Ranking:
Може да изтеглите и всичко на 1 път от Attach Files.
Update 0.1: Променен е ранкинга. Вместо да пише акаунт ще пише последния герой който е влизал в акаунта.
Rena Ranking Update 0.1:
Stone Ranking Update 0.1:
Credits: ivowe3
Благодарение на този пост: DarksTeam Forum - View Single Post - [Req] Stones deposit by Damian
Използвайте
Installation:
1.В Query Analyzer-а добавяте това:
Code:
Use MuOnline
CREATE TABLE StoneRena ([acc] [varchar] (10) NOT NULL ,[Stone] [bigint] NOT NULL default (0),[Rena] [bigint] NOT NULL default (0)) ON [PRIMARY];
Code:
$host = "127.0.0.1";
$database = "MuOnline";
$user = "sa";
$password = "SQL pass";
sranking.php - Stone
rranking.php - Rena
3.1 Попълвате информацията
Code:
$host = "127.0.0.1";
$database = "MuOnline";
$user = "sa";
$password = "SQL pass";
Code:
$lines = '10';
ето кодовете:
Deposit Stone:
PHP:
<table align="center" width="400" id="main">
<form method="POST" action="">
<tr><td><b>acc:</b></td><td><input type="text" name="acc" size="25"/></td></tr>
<tr><td><b>Password:</b></td><td><input type="password" name="pass" size="25"/></td></tr>
<tr><td></td><td><input type="submit" name="submit" value="Register" /></td></tr>
</form>
</table>
<?
if (isset($_POST['submit'])) {
$host = "127.0.0.1";
$database = "MuOnline";
$user = "sa";
$password = "SQL pass";
if (extension_loaded('gd')){echo("");}
else{Die("<center>Loading php_gd2.dll Failed!<br>Please Enable php_gd2.dll In Your Php.ini</center>");}
$connect = mssql_connect($host,$user,$password);
$db = mssql_select_db($database,$connect);
if(!$db) die('<center>Connection with SQL Server failed!</center>');
$account = htmlspecialchars(addslashes($_POST['acc']));
$pass= htmlspecialchars(addslashes($_POST['pass']));
$querya = mssql_query("SELECT * From MEMB_STAT where memb___id='$account' and ConnectStat='1'");
$rowa = mssql_num_rows($querya);
$queryacc = mssql_query("SELECT * From MEMB_INFO where memb___id='$account' and memb__pwd='$pass'");
$rowacc = mssql_num_rows($queryacc);
if($rowa>0){ echo "Your Account is Online"; $err=1;}
elseif($rowacc<=0){ echo "Wrong Password or Account"; $err=1;}
if ($err!=1) {
function stone($account){
$query= mssql_query("declare @it varbinary(1200);
set @it=(select [Items] from [warehouse] where [AccountID]='$account');
print @it");
$items = substr(mssql_get_last_message(),2);
$br=0;
for($i=0;$i<120;$i++){
if(substr($items,$i*20,4)=="D508"){$br++;$items=substr_replace($items,"FFFFFFFFFFFFFFFFFFFF",$i*20,20);}
}
$new_warehouse=mssql_query("update [warehouse] set [Items]=0x$items where [AccountID]='$account'");
return $br;
}
$querych = mssql_query("SELECT * From StoneRena where acc='$account'");
$rowch = mssql_num_rows($querych);
$stones= stone($account);
if($rowch<=0){
$a = mssql_query("INSERT INTO StoneRena (acc, stone) VALUES('$account', '$stones')");
echo "You Deposited $stones Stone ";
}
else {
$a= mssql_query("update StoneRena set stone=stone+$stones where [acc]='$account'");
echo "You Deposited $stones Stone ";
}
return $br;
}
}
?>
Rena Deposit:
PHP:
<table align="center" width="400" id="main">
<form method="POST" action="">
<tr><td><b>acc:</b></td><td><input type="text" name="acc" size="25"/></td></tr>
<tr><td><b>Password:</b></td><td><input type="password" name="pass" size="25"/></td></tr>
<tr><td></td><td><input type="submit" name="submit" value="Register" /></td></tr>
</form>
</table>
<?
if (isset($_POST['submit'])) {
$host = "127.0.0.1";
$database = "MuOnline";
$user = "sa";
$password = "SQL Pass";
if (extension_loaded('gd')){echo("");}
else{Die("<center>Loading php_gd2.dll Failed!<br>Please Enable php_gd2.dll In Your Php.ini</center>");}
$connect = mssql_connect($host,$user,$password);
$db = mssql_select_db($database,$connect);
if(!$db) die('<center>Connection with SQL Server failed!</center>');
$account = htmlspecialchars(addslashes($_POST['acc']));
$pass= htmlspecialchars(addslashes($_POST['pass']));
$querya = mssql_query("SELECT * From MEMB_STAT where memb___id='$account' and ConnectStat='1'");
$rowa = mssql_num_rows($querya);
$queryacc = mssql_query("SELECT * From MEMB_INFO where memb___id='$account' and memb__pwd='$pass'");
$rowacc = mssql_num_rows($queryacc);
if($rowa>0){ echo "Your Account is Online"; $err=1;}
elseif($rowacc<=0){ echo "Wrong Password or Account"; $err=1;}
if ($err!=1) {
function rena($account){
$query= mssql_query("declare @it varbinary(1200);
set @it=(select [Items] from [warehouse] where [AccountID]='$account');
print @it");
$items = substr(mssql_get_last_message(),2);
$br=0;
for($i=0;$i<120;$i++){
if(substr($items,$i*20,4)=="D500"){$br++;$items=substr_replace($items,"FFFFFFFFFFFFFFFFFFFF",$i*20,20);}
}
$new_warehouse=mssql_query("update [warehouse] set [Items]=0x$items where [AccountID]='$account'");
return $br;
}
$querych = mssql_query("SELECT * From StoneRena where acc='$account'");
$rowch = mssql_num_rows($querych);
$rena= rena($account);
if($rowch<=0){
$a = mssql_query("INSERT INTO StoneRena (acc, Rena) VALUES('$account', '$rena')");
echo "You Deposited $rena Rena ";
}
else {
$a= mssql_query("update StoneRena set Rena=Rena+$rena where [acc]='$account'");
echo "You Deposited $rena Rena ";
}
return $br;
}
}
?>
Stone Ranking:
PHP:
<table width='400' align='center'>
<tr>
<td align='center'>#</td>
<td align='center'>Acc</td>
<td align='center'>Stone</td>
</tr>
<?
$host = "127.0.0.1";
$database = "MuOnline";
$user = "sa";
$password = "SQL pass";
if (extension_loaded('gd')){echo("");}
else{Die("<center>Loading php_gd2.dll Failed!<br>Please Enable php_gd2.dll In Your Php.ini</center>");}
$connect = mssql_connect($host,$user,$password);
$db = mssql_select_db($database,$connect);
if(!$db) die('<center>Connection with SQL Server failed!</center>');
$total = mssql_num_rows(mssql_query("SELECT * FROM StoneRena where acc like '%%'"));
$lines = '10';
if(!isset($_GET['pages']))
{
$limit='0';
$pagesa='1';
}
else
{
$page = (int)$_GET['pages'];
$pages = $page - 1;
$pagesa =$page;
$limit = $lines * $pages;
}
$total = ceil($total/$lines);
if($total >0){
echo '<center>';
if(($page-1) > 0)echo '<a href="?pages='.($pagesa-1).'"><b><<Previous</b></a> ';
echo '[Page '.$pagesa.' of total '.$total.']';
if(($page+1) <= $total)echo ' <a href="?pages='.($pagesa+1).'"><b>Next>></b></a>';
echo '</center><br>';}
$topq = mssql_query("Select ToP $lines acc,stone from StoneRena where acc not in (Select TOP $limit acc from StoneRena order by Stone desc) order by Stone desc");
for($i=0; $i < mssql_num_rows($topq); ++$i)
{
$rank = $i+1+$limit;
$row = mssql_fetch_row($topq);
echo"
<tr>
<td align='center'>$rank.</td>
<td align='center'>$row[0]</td>
<td align='center'>$row[1]</td>
</tr>
";
}
echo "</table>";
if($total >0){
echo '<center>';
if(($page-1) > 0)echo '<a href="?pages='.($pagesa-1).'"><b><<Previous</b></a> ';
echo '[Page '.$pagesa.' of total '.$total.']';
if(($page+1) <= $total)echo ' <a href="?pages='.($pagesa+1).'"><b>Next>></b></a>';
echo '</center><br>';}
?>
Rena Ranking:
PHP:
<table width='400' align='center'>
<tr>
<td align='center'>#</td>
<td align='center'>Acc</td>
<td align='center'>Rena</td>
</tr>
<?
$host = "127.0.0.1";
$database = "MuOnline";
$user = "sa";
$password = "SQL pass";
if (extension_loaded('gd')){echo("");}
else{Die("<center>Loading php_gd2.dll Failed!<br>Please Enable php_gd2.dll In Your Php.ini</center>");}
$connect = mssql_connect($host,$user,$password);
$db = mssql_select_db($database,$connect);
if(!$db) die('<center>Connection with SQL Server failed!</center>');
$total = mssql_num_rows(mssql_query("SELECT * FROM StoneRena where acc like '%%'"));
$lines = '10';
if(!isset($_GET['pages']))
{
$limit='0';
$pagesa='1';
}
else
{
$page = (int)$_GET['pages'];
$pages = $page - 1;
$pagesa =$page;
$limit = $lines * $pages;
}
$total = ceil($total/$lines);
if($total >0){
echo '<center>';
if(($page-1) > 0)echo '<a href="?pages='.($pagesa-1).'"><b><<Previous</b></a> ';
echo '[Page '.$pagesa.' of total '.$total.']';
if(($page+1) <= $total)echo ' <a href="?pages='.($pagesa+1).'"><b>Next>></b></a>';
echo '</center><br>';}
$topq = mssql_query("Select ToP $lines acc,rena from StoneRena where acc not in (Select TOP $limit acc from StoneRena order by rena desc) order by rena desc");
for($i=0; $i < mssql_num_rows($topq); ++$i)
{
$rank = $i+1+$limit;
$row = mssql_fetch_row($topq);
echo"
<tr>
<td align='center'>$rank.</td>
<td align='center'>$row[0]</td>
<td align='center'>$row[1]</td>
</tr>
";
}
echo "</table>";
if($total >0){
echo '<center>';
if(($page-1) > 0)echo '<a href="?pages='.($pagesa-1).'"><b><<Previous</b></a> ';
echo '[Page '.$pagesa.' of total '.$total.']';
if(($page+1) <= $total)echo ' <a href="?pages='.($pagesa+1).'"><b>Next>></b></a>';
echo '</center><br>';}
?>
Може да изтеглите и всичко на 1 път от Attach Files.
Update 0.1: Променен е ранкинга. Вместо да пише акаунт ще пише последния герой който е влизал в акаунта.
Rena Ranking Update 0.1:
PHP:
<table width='400' align='center'>
<tr>
<td align='center'>#</td>
<td align='center'>Char</td>
<td align='center'>Rena</td>
</tr>
<?
$host = "127.0.0.1";
$database = "MuOnline";
$user = "sa";
$password = "SQL pass";
if (extension_loaded('gd')){echo("");}
else{Die("<center>Loading php_gd2.dll Failed!<br>Please Enable php_gd2.dll In Your Php.ini</center>");}
$connect = mssql_connect($host,$user,$password);
$db = mssql_select_db($database,$connect);
if(!$db) die('<center>Connection with SQL Server failed!</center>');
$total = mssql_num_rows(mssql_query("SELECT * FROM StoneRena where acc like '%%'"));
$lines = '10';
if(!isset($_GET['pages']))
{
$limit='0';
$pagesa='1';
}
else
{
$page = (int)$_GET['pages'];
$pages = $page - 1;
$pagesa =$page;
$limit = $lines * $pages;
}
$total = ceil($total/$lines);
if($total >0){
echo '<center>';
if(($page-1) > 0)echo '<a href="?pages='.($pagesa-1).'"><b><<Previous</b></a> ';
echo '[Page '.$pagesa.' of total '.$total.']';
if(($page+1) <= $total)echo ' <a href="?pages='.($pagesa+1).'"><b>Next>></b></a>';
echo '</center><br>';}
$topq = mssql_query("Select ToP $lines acc,rena from StoneRena where acc not in (Select TOP $limit acc from StoneRena order by rena desc) order by rena desc");
for($i=0; $i < mssql_num_rows($topq); ++$i)
{
$rank = $i+1+$limit;
$row = mssql_fetch_row($topq);
$charr = mssql_query("Select GameIDC From AccountCharacter where Id='$row[0]'");
$char = mssql_fetch_row($charr);
echo"
<tr>
<td align='center'>$rank.</td>
<td align='center'>$char[0]</td>
<td align='center'>$row[1]</td>
</tr>
";
}
echo "</table>";
if($total >0){
echo '<center>';
if(($page-1) > 0)echo '<a href="?pages='.($pagesa-1).'"><b><<Previous</b></a> ';
echo '[Page '.$pagesa.' of total '.$total.']';
if(($page+1) <= $total)echo ' <a href="?pages='.($pagesa+1).'"><b>Next>></b></a>';
echo '</center><br>';}
?>
Stone Ranking Update 0.1:
PHP:
<table width='400' align='center'>
<tr>
<td align='center'>#</td>
<td align='center'>Char</td>
<td align='center'>Stone</td>
</tr>
<?
$host = "127.0.0.1";
$database = "MuOnline";
$user = "sa";
$password = "SQL pass";
if (extension_loaded('gd')){echo("");}
else{Die("<center>Loading php_gd2.dll Failed!<br>Please Enable php_gd2.dll In Your Php.ini</center>");}
$connect = mssql_connect($host,$user,$password);
$db = mssql_select_db($database,$connect);
if(!$db) die('<center>Connection with SQL Server failed!</center>');
$total = mssql_num_rows(mssql_query("SELECT * FROM StoneRena where acc like '%%'"));
$lines = '10';
if(!isset($_GET['pages']))
{
$limit='0';
$pagesa='1';
}
else
{
$page = (int)$_GET['pages'];
$pages = $page - 1;
$pagesa =$page;
$limit = $lines * $pages;
}
$total = ceil($total/$lines);
if($total >0){
echo '<center>';
if(($page-1) > 0)echo '<a href="?pages='.($pagesa-1).'"><b><<Previous</b></a> ';
echo '[Page '.$pagesa.' of total '.$total.']';
if(($page+1) <= $total)echo ' <a href="?pages='.($pagesa+1).'"><b>Next>></b></a>';
echo '</center><br>';}
$topq = mssql_query("Select ToP $lines acc,stone from StoneRena where acc not in (Select TOP $limit acc from StoneRena order by Stone desc) order by Stone desc");
for($i=0; $i < mssql_num_rows($topq); ++$i)
{
$rank = $i+1+$limit;
$row = mssql_fetch_row($topq);
$charr = mssql_query("Select GameIDC From AccountCharacter where Id='$row[0]'");
$char = mssql_fetch_row($charr);
echo"
<tr>
<td align='center'>$rank.</td>
<td align='center'>$char[0]</td>
<td align='center'>$row[1]</td>
</tr>
";
}
echo "</table>";
if($total >0){
echo '<center>';
if(($page-1) > 0)echo '<a href="?pages='.($pagesa-1).'"><b><<Previous</b></a> ';
echo '[Page '.$pagesa.' of total '.$total.']';
if(($page+1) <= $total)echo ' <a href="?pages='.($pagesa+1).'"><b>Next>></b></a>';
echo '</center><br>';}
?>
Credits: ivowe3
Благодарение на този пост: DarksTeam Forum - View Single Post - [Req] Stones deposit by Damian
Използвайте
Attachments
Last edited: