<?php
 if ( ! defined( 'ABSPATH' ) ) { exit; } function myarcade_settings_scirra() { $scirra = F370DD774B2D974BFC80CFD42084987D1( 'scirra' ); ?>
  <h2 class="trigger"><?php _e("Scirra", 'myarcadeplugin'); ?></h2>
  <div class="toggle_container">
    <div class="block">
      <table class="optiontable" width="100%" cellpadding="5" cellspacing="5">
        <tr>
          <td colspan="2">
            <i>
              <?php printf( __( "%s distributes Flash and HTML5 games.", 'myarcadeplugin' ), '<a href="https://www.scirra.com/arcade" target="_blank">Scirra</a>' ); ?>
            </i>
            <br /><br />
          </td>
        </tr>

        <tr><td colspan="2"><h3><?php _e("Feed URL", 'myarcadeplugin'); ?></h3></td></tr>
        <tr>
          <td>
            <input type="text" size="40"  name="scirra_url" value="<?php echo $scirra['feed']; ?>" />
          </td>
          <td><i><?php _e("Edit this field only if Feed URL has been changed!", 'myarcadeplugin'); ?></i></td>
        </tr>

        <tr><td colspan="2"><h3><?php _e("Category", 'myarcadeplugin'); ?></h3></td></tr>

        <tr>
          <td>
            <select size="1" name="scirra_category" id="scirra_category">
              <option value="0" <?php FDDF3EC25B8F21FAFBFA55C25519BBBBF($scirra['category'], '0'); ?> ><?php _e("All Games", 'myarcadeplugin'); ?></option>
              <option value="3" <?php FDDF3EC25B8F21FAFBFA55C25519BBBBF($scirra['category'], '3'); ?> ><?php _e("Action", 'myarcadeplugin'); ?></option>
              <option value="2" <?php FDDF3EC25B8F21FAFBFA55C25519BBBBF($scirra['category'], '2'); ?> ><?php _e("Adventure", 'myarcadeplugin'); ?></option>
              <option value="9" <?php FDDF3EC25B8F21FAFBFA55C25519BBBBF($scirra['category'], '9'); ?> ><?php _e("Fighting", 'myarcadeplugin'); ?></option>
              <option value="10" <?php FDDF3EC25B8F21FAFBFA55C25519BBBBF($scirra['category'], '10'); ?> ><?php _e("Multiplayer", 'myarcadeplugin'); ?></option>
              <option value="4" <?php FDDF3EC25B8F21FAFBFA55C25519BBBBF($scirra['category'], '4'); ?> ><?php _e("Music", 'myarcadeplugin'); ?></option>
              <option value="1" <?php FDDF3EC25B8F21FAFBFA55C25519BBBBF($scirra['category'], '1'); ?> ><?php _e("Puzzle", 'myarcadeplugin'); ?></option>
              <option value="7" <?php FDDF3EC25B8F21FAFBFA55C25519BBBBF($scirra['category'], '7'); ?> ><?php _e("Racing", 'myarcadeplugin'); ?></option>
              <option value="11" <?php FDDF3EC25B8F21FAFBFA55C25519BBBBF($scirra['category'], '11'); ?> ><?php _e("RPG", 'myarcadeplugin'); ?></option>
              <option value="8" <?php FDDF3EC25B8F21FAFBFA55C25519BBBBF($scirra['category'], '8'); ?> ><?php _e("Shooting", 'myarcadeplugin'); ?></option>
              <option value="6" <?php FDDF3EC25B8F21FAFBFA55C25519BBBBF($scirra['category'], '6'); ?> ><?php _e("Sports", 'myarcadeplugin'); ?></option>
              <option value="5" <?php FDDF3EC25B8F21FAFBFA55C25519BBBBF($scirra['category'], '5'); ?> ><?php _e("Strategy", 'myarcadeplugin'); ?></option>
              <option value="13" <?php FDDF3EC25B8F21FAFBFA55C25519BBBBF($scirra['category'], '13'); ?> ><?php _e("Tutorial", 'myarcadeplugin'); ?></option>
              <option value="12" <?php FDDF3EC25B8F21FAFBFA55C25519BBBBF($scirra['category'], '12'); ?> ><?php _e("Other", 'myarcadeplugin'); ?></option>
            </select>
          </td>
          <td><i><?php _e("Select which games you would like to fetch.", 'myarcadeplugin'); ?></i></td>
        </tr>

        <tr><td colspan="2"><h3><?php _e("Automated Game Fetching", 'myarcadeplugin'); ?></h3></td></tr>

        <tr>
          <td>
            <input type="checkbox" name="scirra_cron_fetch" value="true" <?php F739F7FB06301A1E6810F08B95CC237ED($scirra['cron_fetch'], true); ?> /><label class="opt">&nbsp;<?php _e("Yes", 'myarcadeplugin'); ?></label>
          </td>
          <td><i><?php _e("Enable this if you want to fetch games automatically. Go to 'General Settings' to select a cron interval.", 'myarcadeplugin'); ?></i></td>
        </tr>

        <tr><td colspan="2"><h4><?php _e("Fetch Games", 'myarcadeplugin'); ?></h4></td></tr>

        <tr>
          <td>
            <input type="text" size="40"  name="scirra_cron_fetch_limit" value="<?php echo $scirra['cron_fetch_limit']; ?>" />
          </td>
          <td><i><?php _e("How many games should be fetched on every cron trigger?", 'myarcadeplugin'); ?></i></td>
        </tr>

        <tr><td colspan="2"><h3><?php _e("Automated Game Publishing", 'myarcadeplugin'); ?></h3></td></tr>

        <tr>
          <td>
            <input type="checkbox" name="scirra_cron_publish" value="true" <?php F739F7FB06301A1E6810F08B95CC237ED($scirra['cron_publish'], true); ?> /><label class="opt">&nbsp;<?php _e("Yes", 'myarcadeplugin'); ?></label>
          </td>
          <td><i><?php _e("Enable this if you want to publish games automatically. Go to 'General Settings' to select a cron interval.", 'myarcadeplugin'); ?></i></td>
        </tr>

        <tr><td colspan="2"><h4><?php _e("Publish Games", 'myarcadeplugin'); ?></h4></td></tr>

        <tr>
          <td>
            <input type="text" size="40"  name="scirra_cron_publish_limit" value="<?php echo $scirra['cron_publish_limit']; ?>" />
          </td>
          <td><i><?php _e("How many games should be published on every cron trigger?", 'myarcadeplugin'); ?></i></td>
        </tr>

      </table>
      <input class="button button-primary" id="submit" type="submit" name="submit" value="<?php _e("Save Settings", 'myarcadeplugin'); ?>" />
    </div>
  </div>
  <?php
} function myarcade_default_settings_scirra() { return array( 'feed' => 'https://www.scirra.com/arcade/api/games.json', 'category' => 0, 'cron_fetch' => false, 'cron_fetch_limit' => '1', 'cron_publish' => false, 'cron_publish_limit' => '1', ); } function myarcade_save_settings_scirra() { F7D8DBE932D4B983CB93613EE5AED34A4(); $scirra = array(); if ( isset($_POST['scirra_url'])) $scirra['feed'] = esc_url_raw($_POST['scirra_url']); else $scirra['feed'] = ''; $scirra['category'] = filter_input( INPUT_POST, 'scirra_category', FILTER_VALIDATE_INT, array( "options" => array( "default" => 0) ) ); $scirra['cron_fetch'] = (isset($_POST['scirra_cron_fetch'])) ? true : false; $scirra['cron_fetch_limit'] = (isset($_POST['scirra_cron_fetch_limit']) ) ? intval($_POST['scirra_cron_fetch_limit']) : 1; $scirra['cron_publish'] = (isset($_POST['scirra_cron_publish']) ) ? true : false; $scirra['cron_publish_limit'] = (isset($_POST['scirra_cron_publish_limit']) ) ? intval($_POST['scirra_cron_publish_limit']) : 1; update_option('myarcade_scirra', $scirra); } function myarcade_fetch_settings_scirra() { $scirra = FFAEFFAB61937A0F4FAA731A883AB7FFF(); ?>

  <div class="myarcade_border white hide mabp_680" id="scirra">
    <div style="float:left;width:150px;">
      <input type="radio" name="fetchmethodscirra" value="latest" <?php F739F7FB06301A1E6810F08B95CC237ED($scirra['method'], 'latest');?>>
    <label><?php _e("Latest Games", 'myarcadeplugin'); ?></label>
    <br />
    <input type="radio" name="fetchmethodscirra" value="offset" <?php F739F7FB06301A1E6810F08B95CC237ED($scirra['method'], 'offset');?>>
    <label><?php _e("Use Offset", 'myarcadeplugin'); ?></label>
    </div>
    <div class="myarcade_border" style="float:left;padding-top: 5px;background-color: #F9F9F9">
    Fetch <input type="number" min="1" max="100" name="limitscirra" value="<?php echo $scirra['limit']; ?>" /> games <span id="offsscirra" class="hide">from offset <input id="radiooffsscirra" type="number" name="offsetscirra" value="<?php echo $scirra['offset']; ?>" /> </span>
    </div>
    <div class="clear"></div>
    <div style="float:left;width:150px">
      <?php _e("Game Order", 'myarcadeplugin'); ?>
    </div>
    <select name="orderbyscirra" id="orderbyscirra">
      <option value="PublishDateASC" <?php FDDF3EC25B8F21FAFBFA55C25519BBBBF($scirra['orderby'], "PublishDateASC"); ?>><?php _e("Oldest games first", 'myarcadeplugin'); ?></option>
      <option value="PublishDateDESC" <?php FDDF3EC25B8F21FAFBFA55C25519BBBBF($scirra['orderby'], "PublishDateDESC"); ?>><?php _e("Newest games first", 'myarcadeplugin'); ?></option>
      <option value="NameASC" <?php FDDF3EC25B8F21FAFBFA55C25519BBBBF($scirra['orderby'], "NameASC"); ?>><?php _e("Alphabetically", 'myarcadeplugin'); ?></option>
      <option value="NameDESC" <?php FDDF3EC25B8F21FAFBFA55C25519BBBBF($scirra['orderby'], "NameDESC"); ?>><?php _e("Reverse alphabetical", 'myarcadeplugin'); ?></option>
      <option value="UniquePlayersASC" <?php FDDF3EC25B8F21FAFBFA55C25519BBBBF($scirra['orderby'], "UniquePlayersASC"); ?>><?php _e("Fewest unique players", 'myarcadeplugin'); ?></option>
      <option value="UniquePlayersDESC" <?php FDDF3EC25B8F21FAFBFA55C25519BBBBF($scirra['orderby'], "UniquePlayersDESC"); ?>><?php _e("Most unique players", 'myarcadeplugin'); ?></option>
      <option value="BestRatedGames" <?php FDDF3EC25B8F21FAFBFA55C25519BBBBF($scirra['orderby'], "BestRatedGames"); ?>><?php _e("Highest rated games first", 'myarcadeplugin'); ?></option>
      <option value="HotnessDESC" <?php FDDF3EC25B8F21FAFBFA55C25519BBBBF($scirra['orderby'], "HotnessDESC"); ?>><?php _e("Hottest games first", 'myarcadeplugin'); ?></option>
    </select>
    <p class="clear"></p>

    <div style="float:left;width:150px">
    <label for="mobilescirra"><?php _e("Only Mobile Games", 'myarcadeplugin'); ?></label>
    </div>
    <input type="checkbox" name="mobilescirra" id="mobilescirra" value="true" <?php F739F7FB06301A1E6810F08B95CC237ED( $scirra['mobile'], true) ?> /> <?php _e("Yes", 'myarcadeplugin'); ?>
    <div class="clear"></div>
  </div>
  <?php
} function FFAEFFAB61937A0F4FAA731A883AB7FFF() { $settings = F370DD774B2D974BFC80CFD42084987D1( 'scirra' ); $settings['method'] = 'latest'; $settings['offset'] = 0; $settings['limit'] = 100; $settings['orderby'] = 'PublishDateDESC'; $settings['mobile'] = false; if ( 'start' == filter_input( INPUT_POST, 'fetch' ) ) { $settings['method'] = filter_input( INPUT_POST, 'fetchmethodscirra' ); $settings['offset'] = filter_input( INPUT_POST, 'offsetscirra' ); $settings['limit'] = filter_input( INPUT_POST, 'limitscirra' ); $settings['orderby'] = filter_input( INPUT_POST, 'orderbyscirra' ); $settings['mobile'] = filter_input( INPUT_POST, 'mobilescirra', FILTER_VALIDATE_BOOLEAN ); } return $settings; } function F4E973A101495756BC85155A1DEF0034D() { return array( "Action" => "3", "Adventure" => "2", "Arcade" => false, "Board Game" => false, "Casino" => false, "Defense" => false, "Customize" => false, "Dress-Up" => false, "Driving" => "7", "Education" => "13", "Fighting" => "9", "Jigsaw" => false, "Multiplayer" => "10", "Other" => "12", "Puzzles" => "1", "Rhythm" => "4", "Shooting" => "8", "Sports" => "6", "Strategy" => "5,11", ); } function myarcade_feed_scirra( $R9FE302BDF914868081913A22F58F9E7E = array() ) { global $wpdb; $R1C087CFC2417747F08C78E3E5D5121E5 = array( 'echo' => false, 'settings' => array() ); $RAA7BB4B05FBD27DB7CA594893F166B47 = wp_parse_args( $R9FE302BDF914868081913A22F58F9E7E, $R1C087CFC2417747F08C78E3E5D5121E5 ); extract($RAA7BB4B05FBD27DB7CA594893F166B47); $R630F8C3F00ED4BE49091A902C671B200 = 0; $R7E48A94D08652CE34DE703DF9E891458 = false; $scirra = FFAEFFAB61937A0F4FAA731A883AB7FFF(); $R83DF4A4DAD8C14D1A6CA7AFD8425724C = F4E973A101495756BC85155A1DEF0034D(); $R281A0F7BC3D849F3386A5AC36FB35807 = get_option('myarcade_categories'); if ( !empty($settings) ) { $settings = array_merge($scirra, $settings); } else { $settings = $scirra; } if ( $settings['limit'] > 0 ) { $settings['feed'] = add_query_arg( array("take" => intval( $settings['limit'] ) ), $settings['feed'] ); } if ( $settings['method'] == 'offset' && isset( $settings['offset'] ) ) { $settings['feed'] = add_query_arg( array( 'skip' => intval( $settings['offset'] ) ), $settings['feed'] ); } $settings['feed'] = add_query_arg( array( 'wip' => 0 ), $settings['feed'] ); $settings['feed'] = add_query_arg( array( 'category' => intval( $settings['category'] ) ), $settings['feed'] ); $settings['feed'] = add_query_arg( array( 'orderby' => $settings['orderby'] ), $settings['feed'] ); require_once( MYARCADE_CORE_DIR . '/fetch.php' ); $R569981A9B29B5950206124A5933F6CB9 = F720E8C77506CFC05F85A08A7EF8F1D41( array('url' => $settings['feed'], 'service' => 'json', 'echo' => true) ); if ( !empty( $R569981A9B29B5950206124A5933F6CB9 ) ) { foreach ( $R569981A9B29B5950206124A5933F6CB9->games as $R2CDAD6EF7D5C41B8DB9EB739620C280A ) { if ( filter_var( $settings['mobile'], FILTER_VALIDATE_BOOLEAN ) && ! filter_var( $R2CDAD6EF7D5C41B8DB9EB739620C280A->mobileEnabled, FILTER_VALIDATE_BOOLEAN ) ) { continue; } if ( ! empty( $settings['keyword_filter'] ) ) { if ( ! preg_match( $settings['keyword_filter'], strtolower( $R2CDAD6EF7D5C41B8DB9EB739620C280A->name ) ) && ! preg_match( $settings['keyword_filter'], strtolower( $R2CDAD6EF7D5C41B8DB9EB739620C280A->longDescription ) ) ) { continue; } } $R69F05BD3024E3A18B29F11DF8A3E8C79 = new stdClass(); $R69F05BD3024E3A18B29F11DF8A3E8C79->uuid = crc32( $R2CDAD6EF7D5C41B8DB9EB739620C280A->id ) . '_scirra'; $R69F05BD3024E3A18B29F11DF8A3E8C79->game_tag = md5($R2CDAD6EF7D5C41B8DB9EB739620C280A->id . $R2CDAD6EF7D5C41B8DB9EB739620C280A->name.'scirra'); $R89FEDA984B61366DE78855CB7D5F44D1 = $wpdb->get_var("SELECT id FROM ".$wpdb->prefix . 'myarcadegames'." WHERE uuid = '".$R69F05BD3024E3A18B29F11DF8A3E8C79->uuid."' OR game_tag = '".$R69F05BD3024E3A18B29F11DF8A3E8C79->game_tag."' OR name = '".esc_sql($R2CDAD6EF7D5C41B8DB9EB739620C280A->name)."'"); if ( $R89FEDA984B61366DE78855CB7D5F44D1 ) { continue; } $R7E48A94D08652CE34DE703DF9E891458 = false; foreach ($R281A0F7BC3D849F3386A5AC36FB35807 as $RAE9A4476893066B7B92C648E9F0FDEE8) { if ( $RAE9A4476893066B7B92C648E9F0FDEE8['Status'] != 'checked' ) { continue; } if ( empty( $R83DF4A4DAD8C14D1A6CA7AFD8425724C[ $RAE9A4476893066B7B92C648E9F0FDEE8['Name'] ] ) ) { continue; } $RA722CD96C988337D96B093992530C1A7 = explode( ',', $R83DF4A4DAD8C14D1A6CA7AFD8425724C[ $RAE9A4476893066B7B92C648E9F0FDEE8['Name'] ] ); if ( ! $RA722CD96C988337D96B093992530C1A7 || ! in_array( $R2CDAD6EF7D5C41B8DB9EB739620C280A->categoryID, $RA722CD96C988337D96B093992530C1A7 ) ) { continue; } $R69F05BD3024E3A18B29F11DF8A3E8C79->categs = $RAE9A4476893066B7B92C648E9F0FDEE8['Name']; $R7E48A94D08652CE34DE703DF9E891458 = true; break; } if ($R7E48A94D08652CE34DE703DF9E891458 == false) { continue; } $R69F05BD3024E3A18B29F11DF8A3E8C79->type = 'scirra'; $R69F05BD3024E3A18B29F11DF8A3E8C79->name = esc_sql( $R2CDAD6EF7D5C41B8DB9EB739620C280A->name ); $R69F05BD3024E3A18B29F11DF8A3E8C79->slug = F64A2F46BC8BAFD9163DD9691D1207278($R69F05BD3024E3A18B29F11DF8A3E8C79->name); $R69F05BD3024E3A18B29F11DF8A3E8C79->description = esc_sql( strip_tags($R2CDAD6EF7D5C41B8DB9EB739620C280A->longDescription) ); $R69F05BD3024E3A18B29F11DF8A3E8C79->instructions = esc_sql( strip_tags($R2CDAD6EF7D5C41B8DB9EB739620C280A->instructions) ); $R69F05BD3024E3A18B29F11DF8A3E8C79->swf_url = esc_sql($R2CDAD6EF7D5C41B8DB9EB739620C280A->iframeURL); $R69F05BD3024E3A18B29F11DF8A3E8C79->thumbnail_url = esc_sql($R2CDAD6EF7D5C41B8DB9EB739620C280A->gameImageURL); $R69F05BD3024E3A18B29F11DF8A3E8C79->width = $R2CDAD6EF7D5C41B8DB9EB739620C280A->width; $R69F05BD3024E3A18B29F11DF8A3E8C79->height = $R2CDAD6EF7D5C41B8DB9EB739620C280A->height; if ( preg_match( "!width:\d+!" , $R2CDAD6EF7D5C41B8DB9EB739620C280A->iframeCode , $R2BC3A0F3554F7C295CD3CC4A57492121) ) { $RE20CE5055B79A7BAB6298F5BE3573071 = intval( str_replace( "width:", "", $R2BC3A0F3554F7C295CD3CC4A57492121[0] ) ); if ( $RE20CE5055B79A7BAB6298F5BE3573071 > $R69F05BD3024E3A18B29F11DF8A3E8C79->width ) { $R69F05BD3024E3A18B29F11DF8A3E8C79->width = $RE20CE5055B79A7BAB6298F5BE3573071; } } if ( preg_match( "!height:\d+!" , $R2CDAD6EF7D5C41B8DB9EB739620C280A->iframeCode , $R2BC3A0F3554F7C295CD3CC4A57492121) ) { $RF5639FC8BF2E2FDBCEBD9F1553EA8EB0 = intval( str_replace( "height:", "", $R2BC3A0F3554F7C295CD3CC4A57492121[0] ) ); if ( $RF5639FC8BF2E2FDBCEBD9F1553EA8EB0 > $R69F05BD3024E3A18B29F11DF8A3E8C79->height ) { $R69F05BD3024E3A18B29F11DF8A3E8C79->height = $RF5639FC8BF2E2FDBCEBD9F1553EA8EB0; } } $R630F8C3F00ED4BE49091A902C671B200++; FF09D7482BA5FAADAB6D947666FFD8C43( $R69F05BD3024E3A18B29F11DF8A3E8C79, $echo ); } } FC6BC39ED73177ED6BA0A3E5B1C3D6848( $R630F8C3F00ED4BE49091A902C671B200, $echo ); } function myarcade_embedtype_scirra() { return 'iframe'; } function myarcade_can_download_scirra() { return false; } ?>