<?php
 $RA272EED39CFB584BB555165E3C9AA882 = dirname( dirname( dirname( dirname( dirname(__FILE__))))); if ( file_exists($RA272EED39CFB584BB555165E3C9AA882 . '/wp-load.php') ) { require_once($RA272EED39CFB584BB555165E3C9AA882 . '/wp-load.php'); } if ( function_exists('current_user_can') && !current_user_can('manage_options') ) die(); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />

<title><?php _e("Edit Game", MYARCADE_TEXT_DOMAIN); ?></title>

<link rel='stylesheet' href='<?php bloginfo('url'); ?>/wp-admin/css/global.css' type='text/css' />
<link rel='stylesheet' href='<?php bloginfo('url'); ?>/wp-admin/css/colors-fresh.css' type='text/css' />
<link rel='stylesheet' href='<?php echo MYARCADE_CORE_URL; ?>/myarcadeplugin.css' type='text/css' />

<script type="text/javascript" src="<?php echo MYARCADE_CORE_URL; ?>/js/jquery-1.3.2.min.js"></script>


</head>
<body>
<?php  F94EBD7C16769D03E06E16136FFE5F944(); ?>

<?php
 if ( isset($_POST['editgame']) && $_POST['editgame'] == 'edit') { ?>
  <script type="text/javascript">
  $(document).ready(function() { 
    $("#closelink").click(function() {
      $("#gstatus_<?php if (isset($_POST['gameid']) ) echo $_POST['gameid']; ?>", top.document).html('<div style="color:red;">updated</div>');
    });
  });
  </script>    
  <?php
 $REAA6191C2FA9B633A100C34B5C0CFB41 = $_POST['gameid']; if ( isset($_POST['leaderenable']) ) $R5DA8BF25D28FC85D49F243ED80AA4725 = $_POST['leaderenable']; else $R5DA8BF25D28FC85D49F243ED80AA4725 = ''; if ( isset($_POST['highscoretype']) ) $RDE4020E832E17B73EE5E23F0583C82CA = $_POST['highscoretype']; else $RDE4020E832E17B73EE5E23F0583C82CA = 'high'; if ( isset($_POST['gametag']) ) $RA6B610A19706344D5E105EFEAE8E8E44 = $_POST['gametag']; else $RA6B610A19706344D5E105EFEAE8E8E44 = ''; if ($_POST['published'] == '1') { $RE91192A00FF990477EE414AD5D708F08 = "UPDATE ".MYARCADE_GAME_TABLE." SET 
      leaderboard_enabled = '$R5DA8BF25D28FC85D49F243ED80AA4725',
      highscore_type = '$RDE4020E832E17B73EE5E23F0583C82CA',
      game_tag = '$RA6B610A19706344D5E105EFEAE8E8E44'
     WHERE id = '".$REAA6191C2FA9B633A100C34B5C0CFB41."'"; } else { $R9B395079675C6A66FF23EA9C6C4A668E = mysql_escape_string(esc_attr($_POST['gamename'])); $RC5934A886BA9823EDE289AB2FD67CED1 = $_POST['gamedescr']; $RB8D54B4D3B9A1438304CEB19E759A7FA = $_POST['gameinstr']; $R115B951F4B0F140780CED3281D158F85 = $_POST['gamecontrols']; $R88A33D29429F80B24F150A7737FAA03B = $_POST['gametype']; $R3FA8DA3402B9B24298B2CE820E453C70 = mysql_escape_string($_POST['gametags']); $RE20CE5055B79A7BAB6298F5BE3573071 = intval($_POST['gamewidth']); $RF5639FC8BF2E2FDBCEBD9F1553EA8EB0 = intval($_POST['gameheight']); $R302D75657AB570D80AEE01AE14ED28B9 = array(); foreach ($_POST['gamecategs'] as $RA1ED191365ABDD5CF62F138014E57648) { $R302D75657AB570D80AEE01AE14ED28B9[] = get_cat_name($RA1ED191365ABDD5CF62F138014E57648); } $R30E38C1F8EC85F8EE8DF620FF3267157 = implode(",", $R302D75657AB570D80AEE01AE14ED28B9); $RE91192A00FF990477EE414AD5D708F08 = "UPDATE ".MYARCADE_GAME_TABLE." SET 
      name          = '$R9B395079675C6A66FF23EA9C6C4A668E',
      game_tag      = '$RA6B610A19706344D5E105EFEAE8E8E44',
      game_type     = '$R88A33D29429F80B24F150A7737FAA03B',
      categories    = '$R30E38C1F8EC85F8EE8DF620FF3267157',
      description   = '$RC5934A886BA9823EDE289AB2FD67CED1',
      tags          = '$R3FA8DA3402B9B24298B2CE820E453C70',
      instructions  = '$RB8D54B4D3B9A1438304CEB19E759A7FA',
      controls      = '$R115B951F4B0F140780CED3281D158F85',
      width         = '$RE20CE5055B79A7BAB6298F5BE3573071',
      height        = '$RF5639FC8BF2E2FDBCEBD9F1553EA8EB0',
      leaderboard_enabled = '$R5DA8BF25D28FC85D49F243ED80AA4725',
      highscore_type = '$RDE4020E832E17B73EE5E23F0583C82CA'
     WHERE id = '".$REAA6191C2FA9B633A100C34B5C0CFB41."'"; } $R679E9B9234E2062F809DBD3325D37FB6 = $wpdb->query($RE91192A00FF990477EE414AD5D708F08); if ($R679E9B9234E2062F809DBD3325D37FB6) { echo '<div id="message" class="updated fade">'.__("Game has been updated!", MYARCADE_TEXT_DOMAIN).'</div>'; } else { echo '<div id="message" class="myerror fade">'.__("Can't update the game!", MYARCADE_TEXT_DOMAIN).'</div>'; } } else { $REAA6191C2FA9B633A100C34B5C0CFB41 = $_GET['gameid']; } $R69F05BD3024E3A18B29F11DF8A3E8C79 = $wpdb->get_row("SELECT * FROM ".MYARCADE_GAME_TABLE." WHERE id = '$REAA6191C2FA9B633A100C34B5C0CFB41' LIMIT 1", ARRAY_A); $R849D693C62DFE15394A642123C1599C8 = ''; ?>


<?php ?>
<!-- <div style="float:right"><button class="button-secondary" id="closelink" onclick="self.parent.tb_remove();">Close</button></div> -->
<div id="myabp_import">
  <form enctype="multipart/form-data" class="niceform" method="post" name="FormEditGame" onsubmit="return myarcade_chkGameFields(this.FormEditGame)">
    <input type="hidden" name="gameid" value="<?php echo $_GET['gameid']; ?>" />
    <input type="hidden" name="editgame" value="edit" />
    <input type="hidden" name="published" value="<?php if ($R69F05BD3024E3A18B29F11DF8A3E8C79['status'] == 'published') echo "1"; else echo "0" ?>" />
    
    <h2><?php _e("Edit Game", MYARCADE_TEXT_DOMAIN); ?></h2>

    <div class="container">
      <div class="block">
        <table class="optiontable" width="100%">
          <?php if ($R69F05BD3024E3A18B29F11DF8A3E8C79['status'] == 'published') : ?>
          <?php $R849D693C62DFE15394A642123C1599C8 = ' disabled'; ?>
          <tr>
            <td colspan="2"><div class="myerror fade"><?php _e("You are about to edit a published game. Thereby, will only be able to change the score settings.", MYARCADE_TEXT_DOMAIN); ?></div></td>
          </tr>
          <?php endif; ?>
          <tr>
            <td><h3><?php _e("Name", MYARCADE_TEXT_DOMAIN); ?> <small>(<?php _e("required", MYARCADE_TEXT_DOMAIN); ?>)</small></h3></td>
          </tr>
          <tr>
            <td>
              <input name="gamename" size="50" type="text" value="<?php echo stripslashes($R69F05BD3024E3A18B29F11DF8A3E8C79['name']); ?>" <?php echo $R849D693C62DFE15394A642123C1599C8; ?>/>
            </td>
          </tr>
        </table>            
      </div>
    </div> 
    
  <div class="container">
    <div class="block">
      <table class="optiontable" width="100%">
        <tr>
          <td colspan="2"><h3><?php _e("Game Dimensions", MYARCADE_TEXT_DOMAIN); ?></h3></td>
        </tr>
        <tr>
          <td>
            <?php _e("Game width (px)", MYARCADE_TEXT_DOMAIN); ?>: <input id="gamewidth" name="gamewidth" type="text" size="20" value="<?php echo $R69F05BD3024E3A18B29F11DF8A3E8C79['width']; ?>" />
          </td>
          <td>
            <?php _e("Game height (px)", MYARCADE_TEXT_DOMAIN); ?>: <input id="gameheight" name="gameheight" type="text" size="20" value="<?php echo $R69F05BD3024E3A18B29F11DF8A3E8C79['height']; ?>" />
          </td>
        </tr>
      </table>
    </div>
  </div>    
    
    <div class="container">
      <div class="block">
        <table class="optiontable" width="100%">
          <tr>
            <td><h3><?php _e("Game Description", MYARCADE_TEXT_DOMAIN); ?> <small>(<?php _e("required", MYARCADE_TEXT_DOMAIN); ?>)</small></h3></td>
          </tr>
          <tr>
            <td>
              <textarea rows="6" cols="80" name="gamedescr" <?php echo $R849D693C62DFE15394A642123C1599C8; ?>><?php echo stripslashes($R69F05BD3024E3A18B29F11DF8A3E8C79['description']); ?></textarea>
            </td>
          </tr>
        </table>            
      </div>
    </div>
    
    <div class="container">
      <div class="block">
        <table class="optiontable" width="100%">
          <tr>
            <td><h3><?php _e("Game Instructions", MYARCADE_TEXT_DOMAIN); ?></h3></td>
          </tr>
          <tr>
            <td>
              <textarea rows="6" cols="80" name="gameinstr" <?php echo $R849D693C62DFE15394A642123C1599C8; ?>><?php echo stripslashes($R69F05BD3024E3A18B29F11DF8A3E8C79['instructions']); ?></textarea>
            </td>
          </tr>
        </table>            
      </div>
    </div>
    
    <div class="container">
      <div class="block">
        <table class="optiontable" width="100%">
          <tr>
            <td><h3><?php _e("Game Controls", MYARCADE_TEXT_DOMAIN); ?></h3></td>
          </tr>
          <tr>
            <td>
              <textarea rows="6" cols="80" name="gamecontrols" <?php echo $R849D693C62DFE15394A642123C1599C8; ?>><?php echo $R69F05BD3024E3A18B29F11DF8A3E8C79['controls']; ?></textarea>
            </td>
          </tr>
        </table>            
      </div>
    </div>
    
    <div class="container">
      <div class="block">
        <table class="optiontable" width="100%">
          <tr>
            <td><h3><?php _e("Tags", MYARCADE_TEXT_DOMAIN); ?></h3></td>
          </tr>
          <tr>
            <td>
              <input name="gametags" type="text" size="50" value="<?php echo $R69F05BD3024E3A18B29F11DF8A3E8C79['tags']; ?>" <?php echo $R849D693C62DFE15394A642123C1599C8; ?>/>
            </td>
          </tr>
        </table>            
      </div>
    </div>
    
    <div class="container">
      <div class="block">
        <table class="optiontable" width="100%">
          <tr>
            <td><h3><?php _e("Category", MYARCADE_TEXT_DOMAIN); ?> <small>(<?php _e("required", MYARCADE_TEXT_DOMAIN); ?>)</small></h3></td>
          </tr>
          <tr>
            <td>
            <?php  $R324992E1D908AE64E82FC7E5043BAFCC = get_all_category_ids(); $RE18A12DB8A8EFE79457F9479CCB42428 = explode (',', $R69F05BD3024E3A18B29F11DF8A3E8C79['categories']); $RA16D2280393CE6A2A5428A4A8D09E354 = count($R324992E1D908AE64E82FC7E5043BAFCC); foreach ($R324992E1D908AE64E82FC7E5043BAFCC as $RA1ED191365ABDD5CF62F138014E57648) { foreach ($RE18A12DB8A8EFE79457F9479CCB42428 as $R43CB7DE4CF52CFD74952A10702266570) { if ($R43CB7DE4CF52CFD74952A10702266570 == get_cat_name($RA1ED191365ABDD5CF62F138014E57648)) { $R581012B834CEFEDA9835E1E9CF08F396 = 'checked'; break; } else { $R581012B834CEFEDA9835E1E9CF08F396 = ''; } } $RA16D2280393CE6A2A5428A4A8D09E354--; $R53DBA466EE435BF798AB2C931C135018 = ''; if ($RA16D2280393CE6A2A5428A4A8D09E354 > 0) $R53DBA466EE435BF798AB2C931C135018 = '<br />'; echo '<input type="checkbox" name="gamecategs[]" value="'.$RA1ED191365ABDD5CF62F138014E57648.'" '.$R581012B834CEFEDA9835E1E9CF08F396.' '.$R849D693C62DFE15394A642123C1599C8.'/><label class="opt">&nbsp;'.get_cat_name($RA1ED191365ABDD5CF62F138014E57648).'</label>'.$R53DBA466EE435BF798AB2C931C135018; } ?>
            </td>
          </tr>
        </table>            
      </div>
    </div>
    
    <div class="container">
      <div class="block">
        <table class="optiontable" width="100%">
          <tr>
            <td><h3><?php _e("Highscore Settings", MYARCADE_TEXT_DOMAIN); ?></h3></td>
          </tr>
          <tr>
            <td>
              <input type="checkbox" name="leaderenable" value="1" <?php if ($R69F05BD3024E3A18B29F11DF8A3E8C79['leaderboard_enabled'] == '1') echo 'checked'; ?> /><label class="opt">&nbsp;<?php _e("Yes - This game is able to submit scores", MYARCADE_TEXT_DOMAIN); ?></label>
            </td>
          </tr>
          <tr>
            <td>
              <?php _e("Score Order (Highscore Type)", MYARCADE_TEXT_DOMAIN); ?> 
              <select size="1" name="highscoretype" id="highscoretype">
                <option value="high" <?php if ($R69F05BD3024E3A18B29F11DF8A3E8C79['highscore_type'] == 'high') echo "selected"; ?>>High</option>
                <option value="low" <?php if ($R69F05BD3024E3A18B29F11DF8A3E8C79['highscore_type'] == 'low') echo "selected"; ?>>Low</option>
              </select>
            </td>
          </tr>
        </table>            
      </div>
    </div>
    
    <div class="container">
      <div class="block">
        <table class="optiontable" width="100%">
          <tr>
            <td><h3><?php _e("Game Type", MYARCADE_TEXT_DOMAIN); ?></h3></td>
          </tr>
          <tr>
            <td>
              <select size="1" name="gametype" id="gametype">
                <option value="mochi" <?php if ($R69F05BD3024E3A18B29F11DF8A3E8C79['game_type'] == 'mochi') echo "selected"; ?>>Mochi</option>
                <option value="playtomic" <?php if ($R69F05BD3024E3A18B29F11DF8A3E8C79['game_type'] == 'playtomic') echo "selected"; ?>>Playtomic</option>
                <option value="kongregate" <?php if ($R69F05BD3024E3A18B29F11DF8A3E8C79['game_type'] == 'kongregate') echo "selected"; ?>>Kongregate</option>
                <option value="fgd" <?php if ($R69F05BD3024E3A18B29F11DF8A3E8C79['game_type'] == 'fgd') echo "selected"; ?>>FlashGameDistribution</option>
                <option value="fog" <?php if ($R69F05BD3024E3A18B29F11DF8A3E8C79['game_type'] == 'fog') echo "selected"; ?>>FreeGamesForYourWebsite</option>
                <option value="spilgames" <?php if ($R69F05BD3024E3A18B29F11DF8A3E8C79['game_type'] == 'spilgames') echo "selected"; ?>>Spilgames</option>
                <option value="dcr" <?php if ($R69F05BD3024E3A18B29F11DF8A3E8C79['game_type'] == 'drc') echo "selected"; ?>>DCR Game</option>
                <option value="custom" <?php if ($R69F05BD3024E3A18B29F11DF8A3E8C79['game_type'] == 'custom') echo "selected"; ?>>SWF Game</option>
                <option value="ibparcade" <?php if ($R69F05BD3024E3A18B29F11DF8A3E8C79['game_type'] == 'ibparcade') echo "selected"; ?>>IBPArcade Game</option>
                <option value="phpbb" <?php if ($R69F05BD3024E3A18B29F11DF8A3E8C79['game_type'] == 'phpbb') echo "selected"; ?>>PHPBB Game</option>
                <option value="embed" <?php if ($R69F05BD3024E3A18B29F11DF8A3E8C79['game_type'] == 'embed') echo "selected"; ?>>Embed / Iframe Game</option>
                <option value="phpbb" <?php if ($R69F05BD3024E3A18B29F11DF8A3E8C79['game_type'] == 'phpbb') echo "selected"; ?>>PHPBB Game</option>
              </select>
              <br />
            </td>
          </tr>          
        </table>            
      </div>
    </div>

    <div class="container">
      <div class="block">
        <table class="optiontable" width="100%">
          <tr>
            <td><h3><?php _e("Game Tag", MYARCADE_TEXT_DOMAIN); ?></h3></td>
          </tr>        
          <tr>
            <td>
              <input type="text" name="gametag" value="<?php echo $R69F05BD3024E3A18B29F11DF8A3E8C79['game_tag']; ?>" /><label class="opt">&nbsp;<?php _e("Unique Game Tag (like Mochi game tag)", MYARCADE_TEXT_DOMAIN); ?></label>
            </td>
          </tr>
        </table>            
      </div>
    </div>     
    
    <div class="container">
      <div class="block">
        <input class="button-secondary" id="submit" type="submit" name="submit" value="<?php _e("Save Changes", MYARCADE_TEXT_DOMAIN); ?>" /> 
        <div style="float:right">
          <button class="button-secondary" id="closelink" onclick="self.parent.tb_remove();return false;">Close</button>
        </div>           
      </div>
    </div>                             
  </form>
</div>
</div><!-- wrap -->
 </body>
</html>