Advertisement
LexManos

Untitled

Aug 12th, 2012
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.16 KB | None | 0 0
  1. <?php
  2.     $level = "Recommended";
  3.     if (isset($_GET["v"]))
  4.     {
  5.         if (!strcmp($_GET["v"], "Latest"))
  6.         {
  7.             $level = "Latest";
  8.         }
  9.     }
  10.     $type = 'Client';
  11.     if (isset($_GET["t"]))
  12.     {
  13.         if (!strcmp($_GET["t"], "src"))
  14.         {
  15.             $type = "Source";
  16.         }
  17.         elseif (!strcmp($_GET["t"], "server"))
  18.         {
  19.             $type = "Server";
  20.         }
  21.     }
  22.     $tag = file_get_contents(sprintf("http://dl.dropbox.com/u/28221422/MinecraftForge/%s.txt", $level));
  23.     $filename = sprintf("./forge/MinecraftForge-%s-%s.zip", $tag, $type);
  24.     $filepath = sprintf("http://dl.dropbox.com/u/28221422/MinecraftForge/MinecraftForge-%s-%s.zip", $level, $type);    
  25.    
  26.     if (!file_exists($filename))
  27.     {
  28.         $ret == file_put_contents($filename, file_get_contents($filepath));
  29.         if ($ret == false)
  30.         {
  31.             header("HTTP/1.1 301 Moved Permanently");
  32.             header(sprintf("Location: %s", $filepath));
  33.             return;
  34.         }
  35.     }
  36.     else
  37.     {
  38.         header("HTTP/1.1 301 Moved Permanently");
  39.         header(sprintf("Location: %s", $filename));
  40.     }
  41. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement