Exemplo n.º 1
0
if ($version != "legacy") {
    $resource = json_decode(file_get_contents("http://s3.amazonaws.com/Minecraft.Download/versions/{$version}/{$version}.json"), true);
    $assets = $resource["assets"];
} else {
    $assets = "legacy";
}
if (!$assets) {
    die("Unable to extract assets\n");
}
printl("Assets version: {$assets}\n");
printl("Download assets version... ");
$assets_version = $assets;
$assets_data = file_get_contents("https://s3.amazonaws.com/Minecraft.Download/indexes/{$assets}.json");
$assetsj = json_decode($assets_data, true);
$assets = $assetsj["objects"];
printl("Found " . count($assets) . " assets\n");
if ($dir_prefix) {
    echo "CANFAIL MKDIR \"{$dir_prefix}\"\n";
}
echo "CANFAIL MKDIR \"{$dir_prefix}indexes\"\n";
echo "OVERRIDE \"{$dir_prefix}indexes/{$assets_version}.json\" \"https://s3.amazonaws.com/Minecraft.Download/indexes/{$assets_version}.json\"\n";
echo "ADD \"{$dir_prefix}indexes/{$assets_version}.json\" \"" . sha1($assets_data) . "\"\n";
echo "CANFAIL MKDIR \"{$dir_prefix}objects\"\n";
$created_dirs = array();
foreach ($assets as $file => $asset) {
    $asset = $asset["hash"];
    $dir = substr($asset, 0, 2);
    if (!isset($created_dirs[$dir])) {
        echo "CANFAIL MKDIR \"{$dir_prefix}objects/{$dir}\"\n";
        $created_dirs[$dir] = true;
    }
<?php

$soundcloudIsGoldAdvancedPlayerDefault = array('checkboxes' => array('buying' => array('label' => 'Show/Hide Buying', 'slug' => 'Buying', 'value' => TRUE, 'type' => 'checkboxes'), 'sharing' => array('label' => 'Show/Hide Sharing', 'slug' => 'Sharing', 'value' => TRUE, 'type' => 'checkboxes'), 'show_bpm' => array('label' => 'Show/Hide Bpm', 'slug' => 'bpm', 'value' => TRUE, 'type' => 'checkboxes'), 'show_playcount' => array('label' => 'Show/Hide Playcount', 'slug' => 'Playcount', 'value' => TRUE, 'type' => 'checkboxes'), 'enable_api' => array('label' => 'Enable API', 'slug' => 'Api', 'value' => FALSE, 'type' => 'checkboxes'), 'single_active' => array('label' => 'Single Active', 'slug' => 'SingleActive', 'value' => FALSE, 'type' => 'checkboxes'), 'show_user' => array('label' => 'Show/Hide User', 'slug' => 'User', 'value' => TRUE, 'type' => 'checkboxes')), 'texts' => array('theme_color' => array('label' => 'Theme Color', 'slug' => 'ThemeColor', 'value' => '', 'type' => 'colorPicker'), 'text_buy_track' => array('label' => 'Text buy track', 'slug' => 'TextBuyTrack', 'value' => '', 'type' => 'texts'), 'text_buy_set' => array('label' => 'Text buy set', 'slug' => 'TextBuySet', 'value' => '', 'type' => 'texts'), 'text_download_track' => array('label' => 'Text download track', 'slug' => 'TextDownloadTrack', 'value' => '', 'type' => 'texts'), 'start_track' => array('label' => 'Start Track', 'slug' => 'StartTrack', 'value' => '', 'type' => 'texts'), 'height' => array('label' => 'Height', 'slug' => 'Height', 'value' => '', 'type' => 'texts'), 'font' => array('label' => 'Font', 'slug' => 'Font', 'value' => '', 'type' => 'texts')));
add_option('soundcloud_is_gold_advanced_player', $soundcloudIsGoldAdvancedPlayerDefault);
/* Default Settings */
$soundcloudIsGoldAdvancedPlayer = get_option('soundcloud_is_gold_advanced_player');
printl($soundcloudIsGoldAdvancedPlayer);
?>
<div id="soundcloudMMAdvancedSettingsOptions" class="subSettings">
    <a href="#" title="bring it on!" id="soundcloudMMAdvancedSettingsShowHide" class="soundcloudMMAdvancedSettingsShowHide">I'm a grown up, show me those Advanced Options!</a>
    <div class="soundcloudMMAdvancedSettingsPanels">
        <?php 
foreach ($soundcloudIsGoldAdvancedPlayer as $topKey => $advancePlayerOptions) {
    ?>
        <ul class="subSettings <?php 
    echo $topKey;
    ?>
">
            <?php 
    foreach ($advancePlayerOptions as $key => $advancePlayerOption) {
        ?>
                
                <!-- ColorPicker Field -->
                <?php 
        if (isset($advancePlayerOption['type']) && $advancePlayerOption['type'] == 'colorPicker') {
            ?>
                <li>
                    <label for="soundcloudMM<?php 
            echo $advancePlayerOption['slug'];
            ?>
"><?php 
Exemplo n.º 3
0
             $prefix = "IFLOONIX ";
         } else {
             if ($os == "natives-windows") {
                 $prefix = "IFWIN ";
             } else {
                 printl("Skipping {$os} in {$lib["name"]}...\n");
                 continue;
             }
         }
         printl("Downloading library {$lib["name"]} for {$os}...\n");
         $file = tempnam(sys_get_temp_dir(), "mclib");
         file_put_contents($file, file_get_contents($natives["url"]));
         $filelist = explode("\n", shell_exec("unzip -Z1 {$file}"));
         unlink($file);
         if (!count($filelist)) {
             printl("ERROR: Filelist is empty, something wrong perhaps?\n");
             die;
         }
         $lib["name"] = str_replace(":", "-", $lib["name"]);
         // Dumb windows
         echo "{$prefix}OVERRIDE \"templib_{$lib["name"]}\" \"{$natives["url"]}\"\n";
         echo "{$prefix}ADD \"templib_{$lib["name"]}\" \"{$natives["sha1"]}\"\n";
         foreach ($filelist as $file) {
             if (substr($file, 0, 8) == "META-INF" || !$file) {
                 continue;
             }
             echo "{$prefix}EXTRACT \"templib_{$lib["name"]}\" \"{$file}\" \"{$dir_prefix}{$file}\"\n";
         }
         echo "{$prefix}DEL \"templib_{$lib["name"]}\"\n";
     }
 }