Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

[PHP] World Ranking

Experienced Elementalist
Joined
Oct 9, 2012
Messages
226
Reaction score
76
Hi,
This is script which can upload service images to world ranking tables, its simple to edit so i guess everybody can use it.

Before run script you have to open
atum2_db_account.dbo.td_wrk_selfServiceInfo
and
atum2_db_account.dbo.td_wrk_allServiceInfo
and insert data to following columns:

ServiceUID (if you set it up by admin tool put 2000)
ServiceName (in selfServiceInfo put ServerGroup name and in allServiceinfo put country)

Then run script

Code:
<?php

$db_host = ''; //MSSQL server name
$db_user = ''; //MSSQL user
$db_pass = ''; //MSSQL pass

$conn = @mssql_connect($db_host,$db_user,$db_pass) or die('conn Err 1');
$db = @mssql_select_db('atum2_db_account',$conn) or die('db con Err 2');

if(isset($_POST) && !empty($_POST)){
$fileName = @$_FILES['userfile']['name'];
$tmpName  = @$_FILES['userfile']['tmp_name'];
$fileSize = @$_FILES['userfile']['size'];
$fileType = @$_FILES['userfile']['type'];

$datastring= @file_get_contents($tmpName);
$data=unpack("H*hex", $datastring);

$SQL="UPDATE atum2_db_account.dbo.td_wrk_allServiceInfo SET ServiceSymbolImage = 0x".$data['hex']." , SymbolImageSize = '$fileSize' where ServiceUID = '2000'";
$SQL2="UPDATE atum2_db_account.dbo.td_wrk_SelfServiceInfo SET ServiceSymbolImage = 0x".$data['hex']." , SymbolImageSize = '$fileSize' where ServiceUID = '2000'";


echo $SQL;

echo "<br><br>";
echo $fileType;
mssql_query($SQL) or die('Error, query failed');
mssql_query($SQL2) or die('Error, query 2 failed');

}
?>

<form action="#" method="post" enctype="multipart/form-data">


<label for="file">Filename:</label>
<input type="file" name="userfile" id="userfile"><br>

<input type="submit" name="submit" value="Submit">
</form>

You can upload BMP, JPG and PNG which is not supported by AdminTool

Cheers
 
Experienced Elementalist
Joined
Oct 9, 2012
Messages
226
Reaction score
76
tested for brigade marks too - can insert png brigade logo to database and size can be more than 24x12 ! :)
 
Joined
Sep 7, 2010
Messages
431
Reaction score
263
You can always open the image you want to put in database with hex editor, copy the whole hex, paste it in a sql script like:
Code:
update SomeTable
set SomeImageColumn = 'paste hex here'
where <whatever criteria you have>

Then you simply execute it.
 
Experienced Elementalist
Joined
Oct 9, 2012
Messages
226
Reaction score
76
You can always open the image you want to put in database with hex editor, copy the whole hex, paste it in a sql script like:
Code:
update SomeTable
set SomeImageColumn = 'paste hex here'
where <whatever criteria you have>

Then you simply execute it.

Ofc you can copy hex but this is faster and inesert size of file too
 
Back
Top