[PHP] World Ranking

Results 1 to 6 of 6
  1. #1
    The Worst One inetpub is offline
    MemberRank
    Oct 2012 Join Date
    C:Location
    232Posts

    idea [PHP] World Ranking

    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


  2. #2
    Valued Member xSilver is offline
    MemberRank
    Apr 2012 Join Date
    FranceLocation
    137Posts

    Re: [PHP] World Ranking

    I did not tested it but its cool release, thank you

  3. #3
    The Worst One inetpub is offline
    MemberRank
    Oct 2012 Join Date
    C:Location
    232Posts

    Re: [PHP] World Ranking

    tested for brigade marks too - can insert png brigade logo to database and size can be more than 24x12 ! :)

  4. #4
    You won't get me... PanKJ is offline
    MemberRank
    Sep 2010 Join Date
    Too Damn HighLocation
    593Posts

    Re: [PHP] World Ranking

    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.

  5. #5
    Enthusiast Owner Thunder is offline
    MemberRank
    Nov 2012 Join Date
    Джидда, SLocation
    26Posts

    Re: [PHP] World Ranking

    ty inetput

  6. #6
    The Worst One inetpub is offline
    MemberRank
    Oct 2012 Join Date
    C:Location
    232Posts

    Re: [PHP] World Ranking

    Quote Originally Posted by PanKJ View Post
    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



Advertisement