<?php
 if ( ! defined( 'ABSPATH' ) ) { exit; } function myarcade_settings_famobi() { $famobi = F370DD774B2D974BFC80CFD42084987D1( 'famobi' ); ?>
  <h2 class="trigger"><?php _e("Famobi", '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 HTML5 games.", 'myarcadeplugin' ), '<a href="http://famobi.com" target="_blank">Famobi</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="famobi_url" value="<?php echo $famobi['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("Affiliate ID", 'myarcadeplugin'); ?></h3></td></tr>
        <tr>
          <td>
            <input type="text" size="40"  name="famobi_affiliate_id" value="<?php echo $famobi['affiliate_id']; ?>" />
          </td>
          <td><i><?php _e("Enter your Affiliate ID if available.", 'myarcadeplugin'); ?></i></td>
        </tr>

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

        <tr>
          <td>
            <select size="1" name="famobi_category" id="famobi_category">
              <option value="all" <?php FDDF3EC25B8F21FAFBFA55C25519BBBBF($famobi['category'], 'all'); ?> ><?php _e("All Games", 'myarcadeplugin'); ?></option>
              <option value="action" <?php FDDF3EC25B8F21FAFBFA55C25519BBBBF($famobi['category'], 'action'); ?> ><?php _e("Action", 'myarcadeplugin'); ?></option>
              <option value="arcade" <?php FDDF3EC25B8F21FAFBFA55C25519BBBBF($famobi['category'], 'arcade'); ?> ><?php _e("Arcade", 'myarcadeplugin'); ?></option>
              <option value="best" <?php FDDF3EC25B8F21FAFBFA55C25519BBBBF($famobi['category'], 'best'); ?> ><?php _e("Best", 'myarcadeplugin'); ?></option>
              <option value="breakout" <?php FDDF3EC25B8F21FAFBFA55C25519BBBBF($famobi['category'], 'breakout'); ?> ><?php _e("Breakout", 'myarcadeplugin'); ?></option>
              <option value="bubble-shooter" <?php FDDF3EC25B8F21FAFBFA55C25519BBBBF($famobi['category'], 'bubble-shooter'); ?> ><?php _e("Bubble Shooter", 'myarcadeplugin'); ?></option>
              <option value="cards" <?php FDDF3EC25B8F21FAFBFA55C25519BBBBF($famobi['category'], 'cards'); ?> ><?php _e("Cards", 'myarcadeplugin'); ?></option>
              <option value="cars" <?php FDDF3EC25B8F21FAFBFA55C25519BBBBF($famobi['category'], 'cars'); ?> ><?php _e("Cars", 'myarcadeplugin'); ?></option>
              <option value="cooking" <?php FDDF3EC25B8F21FAFBFA55C25519BBBBF($famobi['category'], 'cooking'); ?> ><?php _e("Cooking", 'myarcadeplugin'); ?></option>
              <option value="dress-up" <?php FDDF3EC25B8F21FAFBFA55C25519BBBBF($famobi['category'], 'dress-up'); ?> ><?php _e("Dress-up", 'myarcadeplugin'); ?></option>
              <option value="girls" <?php FDDF3EC25B8F21FAFBFA55C25519BBBBF($famobi['category'], 'girls'); ?> ><?php _e("Girls", 'myarcadeplugin'); ?></option>
              <option value="jump-and-run" <?php FDDF3EC25B8F21FAFBFA55C25519BBBBF($famobi['category'], 'jump-and-run'); ?> ><?php _e("Jump & Run", 'myarcadeplugin'); ?></option>
              <option value="make-up" <?php FDDF3EC25B8F21FAFBFA55C25519BBBBF($famobi['category'], 'make-up'); ?> ><?php _e("Make-up", 'myarcadeplugin'); ?></option>
              <option value="match-3" <?php FDDF3EC25B8F21FAFBFA55C25519BBBBF($famobi['category'], 'match-3'); ?> ><?php _e("Match-3", 'myarcadeplugin'); ?></option>
              <option value="multiplayer" <?php FDDF3EC25B8F21FAFBFA55C25519BBBBF($famobi['category'], 'multiplayer'); ?> ><?php _e("Multiplayer", 'myarcadeplugin'); ?></option>
              <option value="new" <?php FDDF3EC25B8F21FAFBFA55C25519BBBBF($famobi['category'], 'new'); ?> ><?php _e("New", 'myarcadeplugin'); ?></option>
              <option value="puzzle" <?php FDDF3EC25B8F21FAFBFA55C25519BBBBF($famobi['category'], 'puzzle'); ?> ><?php _e("Puzzle", 'myarcadeplugin'); ?></option>
              <option value="quiz" <?php FDDF3EC25B8F21FAFBFA55C25519BBBBF($famobi['category'], 'quiz'); ?> ><?php _e("Quiz", 'myarcadeplugin'); ?></option>
              <option value="racing" <?php FDDF3EC25B8F21FAFBFA55C25519BBBBF($famobi['category'], 'racing'); ?> ><?php _e("Racing", 'myarcadeplugin'); ?></option>
              <option value="sports" <?php FDDF3EC25B8F21FAFBFA55C25519BBBBF($famobi['category'], 'sports'); ?> ><?php _e("Sports", '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("Thumbnail Size", 'myarcadeplugin'); ?></h3></td></tr>

        <tr>
          <td>
            <select size="1" name="famobi_thumbsize" id="famobi_thumbsize">
              <option value="thumb_60" <?php FDDF3EC25B8F21FAFBFA55C25519BBBBF($famobi['thumbsize'], 'thumb_60'); ?> ><?php _e("Small (60x60)", 'myarcadeplugin'); ?></option>
              <option value="thumb_120" <?php FDDF3EC25B8F21FAFBFA55C25519BBBBF($famobi['thumbsize'], 'thumb_120'); ?> ><?php _e("Medium (120x120)", 'myarcadeplugin'); ?></option>
              <option value="thumb_180" <?php FDDF3EC25B8F21FAFBFA55C25519BBBBF($famobi['thumbsize'], 'thumb_180'); ?> ><?php _e("Large (180x180)", 'myarcadeplugin'); ?></option>
              <option value="thumb" <?php FDDF3EC25B8F21FAFBFA55C25519BBBBF($famobi['thumbsize'], 'thumb'); ?> ><?php _e("Extra Large (360x360)", 'myarcadeplugin'); ?></option>
            </select>
          </td>
          <td><i><?php _e("Select a thumbnail size (Default 120x120).", 'myarcadeplugin'); ?></i></td>
        </tr>

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

        <tr>
          <td>
            <select size="1" name="famobi_language" id="famobi_language">
              <option value="en_EN" <?php FDDF3EC25B8F21FAFBFA55C25519BBBBF($famobi['language'], 'en_EN'); ?> ><?php _e("English", 'myarcadeplugin'); ?></option>
              <option value="de_DE" <?php FDDF3EC25B8F21FAFBFA55C25519BBBBF($famobi['language'], 'de_DE'); ?> ><?php _e("German", 'myarcadeplugin'); ?></option>
              <option value="tr_TR" <?php FDDF3EC25B8F21FAFBFA55C25519BBBBF($famobi['language'], 'tr_TR'); ?> ><?php _e("Turkish", 'myarcadeplugin'); ?></option>
            </select>
          </td>
          <td><i><?php _e("Select a game language.", 'myarcadeplugin'); ?></i></td>
        </tr>

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

        <tr>
          <td>
            <input type="checkbox" name="famobi_cron_fetch" value="true" <?php F739F7FB06301A1E6810F08B95CC237ED($famobi['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="famobi_cron_fetch_limit" value="<?php echo $famobi['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="famobi_cron_publish" value="true" <?php F739F7FB06301A1E6810F08B95CC237ED($famobi['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="famobi_cron_publish_limit" value="<?php echo $famobi['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_famobi() { return array( 'feed' => 'http://api.famobi.com/feed', 'affiliate_id' => 'A-MYARCADEPLUGIN', 'thumbsize' => 'thumb_120', 'category' => 'all', 'language' => 'en_EN', 'cron_fetch' => false, 'cron_fetch_limit' => '1', 'cron_publish' => false, 'cron_publish_limit' => '1', ); } function myarcade_save_settings_famobi() { F7D8DBE932D4B983CB93613EE5AED34A4(); $settings = array(); $settings['feed'] = (isset($_POST['famobi_url'])) ? esc_sql($_POST['famobi_url']) : ''; $settings['affiliate_id'] = (isset($_POST['famobi_affiliate_id'])) ? $_POST['famobi_affiliate_id'] : 'A-MYARCADEPLUGIN'; $settings['category'] = (isset($_POST['famobi_category'])) ? $_POST['famobi_category'] : 'all'; $settings['thumbsize'] = (isset($_POST['famobi_thumbsize'])) ? $_POST['famobi_thumbsize'] : 'thumb_120'; $settings['language'] = (isset($_POST['famobi_language'])) ? $_POST['famobi_language'] : 'en_EN'; $settings['cron_fetch'] = (isset($_POST['famobi_cron_fetch'])) ? true : false; $settings['cron_fetch_limit'] = (isset($_POST['famobi_cron_fetch_limit']) ) ? intval($_POST['famobi_cron_fetch_limit']) : 1; $settings['cron_publish'] = (isset($_POST['famobi_cron_publish']) ) ? true : false; $settings['cron_publish_limit'] = (isset($_POST['famobi_cron_publish_limit']) ) ? intval($_POST['famobi_cron_publish_limit']) : 1; update_option('myarcade_famobi', $settings); } function myarcade_fetch_settings_famobi() { $famobi = F82A444032ECFAD47E1F81674481F6DB0(); ?>
  <div class="myarcade_border white hide mabp_680" id="famobi">
    <div style="float:left;width:150px">
      <input type="radio" name="fetchmethodfamobi" value="latest" <?php F739F7FB06301A1E6810F08B95CC237ED($famobi['method'], 'latest');?>>
    <label><?php _e("Latest Games", 'myarcadeplugin'); ?></label>
    <br />
    <input type="radio" name="fetchmethodfamobi" value="offset" <?php F739F7FB06301A1E6810F08B95CC237ED($famobi['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" name="famobi_limit" value="<?php echo $famobi['limit']; ?>" /> games <span id="offsfamobi" class="hide">from offset <input id="radiooffsfamobi" type="number" name="offsetfamobi" value="<?php echo $famobi['offset']; ?>" /> </span>
    </div>
    <div class="clear"></div>
  </div>
  <?php
} function F82A444032ECFAD47E1F81674481F6DB0() { $settings = F370DD774B2D974BFC80CFD42084987D1( 'famobi' ); if ( 'start' == filter_input( INPUT_POST, 'fetch' ) ) { $settings['method'] = filter_input( INPUT_POST, 'fetchmethodfamobi' ); $settings['offset'] = intval( filter_input( INPUT_POST, 'offsetfamobi' ) ); $settings['limit'] = intval( filter_input( INPUT_POST, 'famobi_limit' ) ); } else { $settings['method'] = 'latest'; $settings['offset'] = 0; $settings['limit'] = 100; } return $settings; } function FDE562E7CEE59BB46C67691BBCE426F7E() { return array( "Action" => "action,jump-and-run", "Adventure" => false, "Arcade" => true, "Board Game" => "cards,match-3", "Casino" => false, "Defense" => false, "Customize" => "make-up", "Dress-Up" => "dress-up,girls", "Driving" => "cars,racing", "Education" => false, "Fighting" => false, "Jigsaw" => false, "Multiplayer" => true, "Other" => "quiz,cooking", "Puzzles" => true, "Rhythm" => false, "Shooting" => false, "Sports" => true, "Strategy" => "breakout,bubble-shooter", ); } function myarcade_feed_famobi( $R9FE302BDF914868081913A22F58F9E7E = array() ) { global $wpdb; $R1C087CFC2417747F08C78E3E5D5121E5 = array( 'echo' => false, 'settings' => array(), 'method' => 'latest' ); $RAA7BB4B05FBD27DB7CA594893F166B47 = wp_parse_args( $R9FE302BDF914868081913A22F58F9E7E, $R1C087CFC2417747F08C78E3E5D5121E5 ); extract($RAA7BB4B05FBD27DB7CA594893F166B47); $R630F8C3F00ED4BE49091A902C671B200 = 0; $R7E48A94D08652CE34DE703DF9E891458 = false; $famobi = F82A444032ECFAD47E1F81674481F6DB0(); $R943521BB5DDC212E84541015A8C94158 = FDE562E7CEE59BB46C67691BBCE426F7E(); $R281A0F7BC3D849F3386A5AC36FB35807 = get_option('myarcade_categories'); $general = get_option('myarcade_general'); if ( !empty($settings) ) { $settings = array_merge($famobi, $settings); } else { $settings = $famobi; } if ( empty( $settings['affiliate_id']) ) { $settings['affiliate_id'] = 'A-MYARCADEPLUGIN'; } $settings['feed'] = add_query_arg( array("a" => $settings['affiliate_id'] ), trim( $settings['feed'] ) ); if ( $settings['limit'] > 0 ) { $settings['feed'] = add_query_arg( array("n" => intval( $settings['limit'] ) ), $settings['feed'] ); } if ( $settings['method'] == 'offset' && isset( $settings['offset'] ) ) { $settings['feed'] = add_query_arg( array( 'skip' => intval( $settings['offset'] ) ), $settings['feed'] ); } if ( $settings['category'] !== 'all' ) { $settings['feed'] = add_query_arg( array("channel" => $settings['category'] ), $settings['feed'] ); } if ( $settings['language'] != 'en_EN' ) { $settings['feed'] = add_query_arg( array( 'locale' => $settings['language'] ), $settings['feed'] ); } require_once( MYARCADE_CORE_DIR . '/fetch.php' ); $RC12AC9F8ECF1A75EF50F5C500668B033 = F720E8C77506CFC05F85A08A7EF8F1D41( array( 'url' => $settings['feed'], 'service' => 'json', 'echo' => $echo) ); if ( !empty($RC12AC9F8ECF1A75EF50F5C500668B033->games) ) { foreach ($RC12AC9F8ECF1A75EF50F5C500668B033->games as $R2CDAD6EF7D5C41B8DB9EB739620C280A) { if ( ! empty( $settings['keyword_filter'] ) ) { if ( ! preg_match( $settings['keyword_filter'], strtolower( $R2CDAD6EF7D5C41B8DB9EB739620C280A->name ) ) && ! preg_match( $settings['keyword_filter'], strtolower( $R2CDAD6EF7D5C41B8DB9EB739620C280A->description ) ) ) { continue; } } $R69F05BD3024E3A18B29F11DF8A3E8C79 = new stdClass(); $R69F05BD3024E3A18B29F11DF8A3E8C79->uuid = crc32( $R2CDAD6EF7D5C41B8DB9EB739620C280A->package_id ) . '_famobi'; $R69F05BD3024E3A18B29F11DF8A3E8C79->game_tag = md5( $R2CDAD6EF7D5C41B8DB9EB739620C280A->package_id . 'famobi' ); $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 ) { $R7E48A94D08652CE34DE703DF9E891458 = false; $R2CDAD6EF7D5C41B8DB9EB739620C280A->categories = array_diff( $R2CDAD6EF7D5C41B8DB9EB739620C280A->categories, array( 'new', 'best' ) ); $R2CDAD6EF7D5C41B8DB9EB739620C280A->categories = array_map( 'trim', $R2CDAD6EF7D5C41B8DB9EB739620C280A->categories ); $R294E407FFD0BBD22EA24DD907D5DDE58 = 'Other'; foreach( $R2CDAD6EF7D5C41B8DB9EB739620C280A->categories as $R7697B8C9FB68C249A0DBC0C50B6CFD55 ) { switch ( strtolower($R7697B8C9FB68C249A0DBC0C50B6CFD55) ) { case 'puzzle': { $R7697B8C9FB68C249A0DBC0C50B6CFD55 = 'Puzzles'; } break; } foreach ( $R281A0F7BC3D849F3386A5AC36FB35807 as $RAE9A4476893066B7B92C648E9F0FDEE8 ) { if ( $RAE9A4476893066B7B92C648E9F0FDEE8['Status'] == 'checked' ) { if ( ! empty( $R943521BB5DDC212E84541015A8C94158[ $RAE9A4476893066B7B92C648E9F0FDEE8['Name'] ] ) ) { if ( $R943521BB5DDC212E84541015A8C94158[ $RAE9A4476893066B7B92C648E9F0FDEE8['Name'] ] === true ) { $R96ED148C2F6F268FCB4CCBC4330538C7 = $RAE9A4476893066B7B92C648E9F0FDEE8['Name']; } else { $R96ED148C2F6F268FCB4CCBC4330538C7 = $R943521BB5DDC212E84541015A8C94158[ $RAE9A4476893066B7B92C648E9F0FDEE8['Name'] ]; } if ( strpos( strtolower($R96ED148C2F6F268FCB4CCBC4330538C7), strtolower($R7697B8C9FB68C249A0DBC0C50B6CFD55) ) !== false ) { $R7E48A94D08652CE34DE703DF9E891458 = true; $R294E407FFD0BBD22EA24DD907D5DDE58 = $RAE9A4476893066B7B92C648E9F0FDEE8['Name']; break 2; } } } } } if ( ! $R7E48A94D08652CE34DE703DF9E891458 ) { continue; } $RBD4076544B640033ED860F85C21C7BDE = $settings['thumbsize']; $R6B1A6F62CD0C6407D98662728E7AD4FC = $R2CDAD6EF7D5C41B8DB9EB739620C280A->$RBD4076544B640033ED860F85C21C7BDE; if ( empty( $R6B1A6F62CD0C6407D98662728E7AD4FC ) ) { $R6B1A6F62CD0C6407D98662728E7AD4FC = $R2CDAD6EF7D5C41B8DB9EB739620C280A->thumb; } $R69F05BD3024E3A18B29F11DF8A3E8C79->type = 'famobi'; $R69F05BD3024E3A18B29F11DF8A3E8C79->name = esc_sql($R2CDAD6EF7D5C41B8DB9EB739620C280A->name); $R69F05BD3024E3A18B29F11DF8A3E8C79->slug = F64A2F46BC8BAFD9163DD9691D1207278($R2CDAD6EF7D5C41B8DB9EB739620C280A->name); $R69F05BD3024E3A18B29F11DF8A3E8C79->description = esc_sql($R2CDAD6EF7D5C41B8DB9EB739620C280A->description); $R69F05BD3024E3A18B29F11DF8A3E8C79->categs = $R294E407FFD0BBD22EA24DD907D5DDE58; $R69F05BD3024E3A18B29F11DF8A3E8C79->thumbnail_url = strtok( $R6B1A6F62CD0C6407D98662728E7AD4FC, '?' ); $R69F05BD3024E3A18B29F11DF8A3E8C79->swf_url = $R2CDAD6EF7D5C41B8DB9EB739620C280A->link; if ( intval( $general['max_width'] ) > 0 ) { $RB78C806D561D0ACC17DD58893B7B9AD0 = $general['max_width']; } else { $RB78C806D561D0ACC17DD58893B7B9AD0 = 800; } if ( !isset( $R2CDAD6EF7D5C41B8DB9EB739620C280A->orientation ) ) { if ( $R2CDAD6EF7D5C41B8DB9EB739620C280A->aspect_ratio > 0 ) { $R2CDAD6EF7D5C41B8DB9EB739620C280A->orientation = 'landscape'; } else { $R2CDAD6EF7D5C41B8DB9EB739620C280A->orientation = 'portrait'; } } if ( $R2CDAD6EF7D5C41B8DB9EB739620C280A->orientation == 'landscape' ) { $R69F05BD3024E3A18B29F11DF8A3E8C79->width = $RB78C806D561D0ACC17DD58893B7B9AD0; $R69F05BD3024E3A18B29F11DF8A3E8C79->height = round($RB78C806D561D0ACC17DD58893B7B9AD0 / $R2CDAD6EF7D5C41B8DB9EB739620C280A->aspect_ratio, 2); } else { $R69F05BD3024E3A18B29F11DF8A3E8C79->height = 700; $R69F05BD3024E3A18B29F11DF8A3E8C79->width = round( $R69F05BD3024E3A18B29F11DF8A3E8C79->height * $R2CDAD6EF7D5C41B8DB9EB739620C280A->aspect_ratio, 2); } $R630F8C3F00ED4BE49091A902C671B200++; FF09D7482BA5FAADAB6D947666FFD8C43( $R69F05BD3024E3A18B29F11DF8A3E8C79, $echo ); } } } FC6BC39ED73177ED6BA0A3E5B1C3D6848( $R630F8C3F00ED4BE49091A902C671B200, $echo ); } function myarcade_embedtype_famobi() { return 'iframe'; } function myarcade_can_download_famobi() { return false; } ?>