Witam, 

Zajmuję się grą MuOnline i firma Sky Team stworzyła skrypt strony do Tej gry. Ja go sobie edytuje i udostępniam moje poprawki innym. W panelu Admina znajduje się opcja do Update skryptu. Lecz link nie działa bo ta firma już dawno padła 2006rok. I chciałbym pozmieniać tak aby się to łączyło z moim ftp i mógbym udostępniać innym moje modyfikacje Ect.

Poniżej daje skrypt php z admina



  1. <?
  2. if(!defined('SkyTeamPageRUNNING'))
  3. {
  4. die("Include error..");
  5. }
  6. ?>
  7. <?
  8. if(defined('Isstronaprim'))
  9. {
  10. echo '<div style="text-align:center;"><h2 class=highlight>SkyTeam Page AutoUpdate Tool</h2>';
  11. $update_server = @file_get_contents('http://lorencia.com/acemu/update_server_info.txt');
  12. if(empty($update_server))
  13.  echo 'Update server connect failed. Try again.';
  14. else
  15.  {
  16.  if(substr($update_server,0,19) != 'STMPUPDATE_VERSIONS')
  17.      echo '<br>Downloaded file header incorrect!';
  18.  elseif(!isset($_GET['download_files']))
  19.      {
  20.      $file = explode("\n",$update_server);
  21.      $kolory = array('505050','707070');
  22.      echo '<table style="margin:auto;"><form action=index.php?strona=pageadmin/site_update&download_files=1 method=post>';
  23.      for($x=1;$x<count($file);++$x) //go check files..
  24.          {
  25.          echo '<tr style="background-color:#'.$kolory[$x%2].'">';
  26.          $checksum = explode('<#>',$file[$x]);
  27.          if(!file_exists($checksum[0]))  echo '<td><b>'.$checksum[0].'</b></td><td><b><font color=#00FFFF>File missing</font></b></td><td><input type=checkbox name=files[] value="'.$checksum[0].'"></td>';
  28.          elseif(chop($checksum[1]) == md5_file($checksum[0])) echo '<td><b>'.$checksum[0].'</b></td><td><b><font color=#00FF00>File correct</font></b></td><td><input type=checkbox disabled></td>';
  29.          else echo '<td><b>'.$checksum[0].'</b></td><td><b><font color=#FF5050 title="MD5 Hash '.md5_file($checksum[0]).'">File NOT correct</font></b></td><td><input type=checkbox name=files[] value="'.$checksum[0].'"></td>';
  30.          echo '</tr>';
  31.          }
  32.      echo '</table>';
  33.      echo '<input type=submit value="Update Selected"></form>';
  34.      }
  35.  elseif($_GET['download_files'] == '1')
  36.      {
  37.      $file = explode("\n",$update_server);
  38.      for($x=1;$x<count($file);++$x) //go check files..
  39.          {
  40.          $files_save[$x] = explode('<#>',$file[$x]);
  41.          $files_save[$x] = $files_save[$x][0];
  42.          }
  43.      for($x=0;$x<count($_POST['files']);++$x)
  44.          {
  45.          if(strlen(in_array($_POST['files'][$x],$files_save))==0)
  46.              die('HACK: file not avalable!');
  47.          $plik_content = @file_get_contents('http://lorencia.com/acemu/sourses/'.$_POST['files'][$x].'.txt');
  48.          if(empty($plik_content)) echo $_POST['files'][$x].' - This file is not avalable for download<br>';
  49.          else
  50.              {
  51.              $header = substr($plik_content,0,15);
  52.              $content = substr($plik_content,15,(strlen($plik_content)-14));
  53.              if($header != 'ST_UPDATE_FILE|') echo $_POST['files'][$x].' - Downloaded file is not correct<br>'.$content;
  54.              else
  55.                  {
  56.                  @copy($_POST['files'][$x],$_POST['files'][$x].'~');
  57.                  $content = gzuncompress($content) or die('DECOMPRESSION ERROR!!');
  58.                  $n = fopen($_POST['files'][$x],'w');
  59.                  fputs($n,$content);
  60.                  fclose($n);
  61.                  echo $_POST['files'][$x].' - File Updated. Old file saved under '.$_POST['files'][$x].'~<br>';
  62.                  echo @file_get_contents('http://lorencia.com/acemu/sourses/KOM'.$_POST['files'][$x].'.txt'); //komentarz
  63.                  }
  64.              }
  65.          }
  66.      }
  67.  else echo 'You'r Means?';
  68.  }
  69.  
  70. echo '</div>';
  71. }
  72. ?>
 



up.