[Release] PHP scripts for VSRO
Players online:
PHP Code:
<?php
$sql_host = ".\SQLEXPRESS";
$sql_user = "sa";
$sql_pass = "";
$sql_db = "SRO_VT_ACCOUNT";
$sqlLink = mssql_connect($sql_host,$sql_user,$sql_pass);
if(!$sqlLink) die("MSSQL server is not accessable, why should we try to select database ?");
else {
mssql_select_db($sql_db,$sqlLink);
}
$query = mssql_query("SELECT top 1 * FROM _ShardCurrentUser WHERE nShardID = 64 ORDER BY nID desc") or die("Can't connect to database!");
while ($row = mssql_fetch_array($query)) {
echo "
<b>Server: <span style='color:red'><i>Paradise</i></span> - <span style='color:#fff'>$row[nUserCount]</span><span style='color:green'> of maximum</span> <span style='color:#fff'>2000</span> <span style='color:green'>are currently online!</span></b>
";
}
?>
Server status:
PHP Code:
<?php
function GetServerStatus($site, $port)
{
$status = array("<span style='color:red'>OFFLINE</span><b>", "<b><span style='color:green'>ONLINE</span>");
$fp = @fsockopen($site, $port, $errno, $errstr, 2);
if (!$fp) {
return $status[0];
} else
{ return $status[1];}
}
$site = "iphere";
$port = "porthere";
print "Server status: ";
print GetServerStatus($site, $port);
?>
some more comin soon.
Re: [Release] PHP scripts for VSRO
nice
easy to integrate into your website....
well done:thumbup1:
Re: [Release] PHP scripts for VSRO
Just wanted to add, I was playing around with the server status script, using basic HTML Sites, and this thing fits perfect in drop down tabs and drop down menu's, even copies over perfectly to run in flash components..
(Thats a hint to all you web dev's on the Silkroad mission)
This is a good script
Re: [Release] PHP scripts for VSRO
Awesome job, thanks so much for this :)
Re: [Release] PHP scripts for VSRO
thanks but i want php change password with email :)
Re: [Release] PHP scripts for VSRO
nice release, btw which port used for server status??
Re: [Release] PHP scripts for VSRO
Quote:
Originally Posted by
Artuuro_lv
Players online:
PHP Code:
<?php
$sql_host = ".\SQLEXPRESS";
$sql_user = "sa";
$sql_pass = "";
$sql_db = "SRO_VT_ACCOUNT";
$sqlLink = mssql_connect($sql_host,$sql_user,$sql_pass);
if(!$sqlLink) die("MSSQL server is not accessable, why should we try to select database ?");
else {
mssql_select_db($sql_db,$sqlLink);
}
$query = mssql_query("SELECT top 1 * FROM _ShardCurrentUser WHERE nShardID = 64 ORDER BY nID desc") or die("Can't connect to database!");
while ($row = mssql_fetch_array($query)) {
echo "
<b>Server: <span style='color:red'><i>Paradise</i></span> - <span style='color:#fff'>$row[nUserCount]</span><span style='color:green'> of maximum</span> <span style='color:#fff'>2000</span> <span style='color:green'>are currently online!</span></b>
";
}
?>
Server status:
PHP Code:
<?php
function GetServerStatus($site, $port)
{
$status = array("<span style='color:red'>OFFLINE</span><b>", "<b><span style='color:green'>ONLINE</span>");
$fp = @fsockopen($site, $port, $errno, $errstr, 2);
if (!$fp) {
return $status[0];
} else
{ return $status[1];}
}
$site = "iphere";
$port = "porthere";
print "Server status: ";
print GetServerStatus($site, $port);
?>
some more comin soon.
can u send me script for Change password...
Re: [Release] PHP scripts for VSRO
Quote:
Originally Posted by
kitez
nice release, btw which port used for server status??
32000
15880
15779
any of these ;))
Re: [Release] PHP scripts for VSRO