Пример #1
0
       if ($_POST['vote_item_name'] != '' && trim($_POST['vote_item_id']) != '' && trim($_POST['vote_item_count']) != '' && trim($_POST['vote_item_enchant']) != '' && trim($_POST['vote_item_price']) != '') {
           $items_ids = preg_split('/[\\s,]+/', trim($_POST['vote_item_id']));
           $GLOBALS['CONFIG_SHOP_VOTE'][] = array($_POST['vote_item_name'], $items_ids, trim($_POST['vote_item_count']), trim($_POST['vote_item_price']), trim($_POST['vote_item_enchant']));
           Configs::update_configs(array('CONFIG_SHOP_VOTE' => Configs::remake_array($GLOBALS['CONFIG_SHOP_VOTE'])), 'shop');
       } else {
           $template_vars['val_vote_item_name'] = $_POST['vote_item_name'];
           $template_vars['val_vote_item_id'] = trim($_POST['vote_item_id']);
           $template_vars['val_vote_item_count'] = trim($_POST['vote_item_count']);
           $template_vars['val_vote_item_enchant'] = trim($_POST['vote_item_enchant']);
           $template_vars['val_vote_item_price'] = trim($_POST['vote_item_price']);
       }
   } elseif (isset($_POST['donate_item_name']) && isset($_POST['donate_item_id']) && isset($_POST['donate_item_count']) && isset($_POST['donate_item_price']) && isset($_POST['add_donate'])) {
       if ($_POST['donate_item_name'] != '' && trim($_POST['donate_item_id']) != '' && trim($_POST['donate_item_count']) != '' && trim($_POST['donate_item_enchant']) != '' && trim($_POST['donate_item_price']) != '') {
           $items_ids = preg_split('/[\\s,]+/', trim($_POST['donate_item_id']));
           $GLOBALS['CONFIG_SHOP_DONATE'][] = array($_POST['donate_item_name'], $items_ids, trim($_POST['donate_item_count']), trim($_POST['donate_item_price']), trim($_POST['donate_item_enchant']));
           Configs::update_configs(array('CONFIG_SHOP_DONATE' => Configs::remake_array($GLOBALS['CONFIG_SHOP_DONATE'])), 'shop');
       } else {
           $template_vars['val_donate_item_name'] = $_POST['donate_item_name'];
           $template_vars['val_donate_item_id'] = trim($_POST['donate_item_id']);
           $template_vars['val_donate_item_count'] = trim($_POST['donate_item_count']);
           $template_vars['val_donate_item_enchant'] = trim($_POST['donate_item_enchant']);
           $template_vars['val_donate_item_price'] = trim($_POST['donate_item_price']);
       }
   }
   $template_vars['system_status'] = $GLOBALS['CONFIG_SHOP_ENABLED'] ? '<option value="1">Enabled</option><option value="0">Disabled</option>' : '<option value="0">Disabled</option><option value="1">Enabled</option>';
   $template_vars['refer_shop_status'] = $GLOBALS['CONFIG_SHOP_REFER_ENABLED'] ? '<option value="1">Enabled</option><option value="0">Disabled</option>' : '<option value="0">Disabled</option><option value="1">Enabled</option>';
   $template_vars['vote_shop_status'] = $GLOBALS['CONFIG_SHOP_VOTE_ENABLED'] ? '<option value="1">Enabled</option><option value="0">Disabled</option>' : '<option value="0">Disabled</option><option value="1">Enabled</option>';
   $template_vars['donate_shop_status'] = $GLOBALS['CONFIG_SHOP_DONATE_ENABLED'] ? '<option value="1">Enabled</option><option value="0">Disabled</option>' : '<option value="0">Disabled</option><option value="1">Enabled</option>';
   $template_vars['reward_settings'] = $GLOBALS['CONFIG_SERVER_TYPE'] == 1 ? <<<SETTINGS
t<tr><th>Cached IP:</th><td><input type="text" name="cached_ip" tabindex="23" value="[config_shop_cached_ip]" /></td></tr>
t<tr><th>Cached Port:</th><td><input type="text" name="cached_port" tabindex="24" value="[config_shop_cached_port]" /></td></tr>