<?php
/**
 * MyArcadePlugin Pro Theme Options helps theme developers to create MyArcadePlugin Pro compatible theme backends.
 * @package MyArcadePlugin Pro Theme Settings
 * @author Onedin Ibrocevic & Daniel Bakovic
 * @version 2.00
 */

$shortname = str_replace(' ', '_', strtolower(MYAPB_THEMENAME));

function myabp_get_theme_option($option)
{
  global $shortname;
  return stripslashes(get_option($shortname . '_' . $option));
}

function myabp_get_theme_settings($option)
{
  return stripslashes(get_option($option));
}

/** Theme  Admin  Panel **/
// Get all categories
$slidercategs_obj = get_categories('hide_empty=0');
$slidercategs = array();

foreach ($slidercategs_obj as $categ) {
  $slidercategs[$categ->cat_ID] = $categ->cat_name;
}

$blogcats = array();
$blogcats = $slidercategs;
$blogcats[] = '-- none --';

$selectOnOff = array('enable', 'disable');

$options = apply_filters('fungames_settings', array (

    // General Theme Settings
    array(  "type"     => "open"),
    array(  "name"     => "General Settings",
            "type"     => "title",
            "desc"     => "This section customizes the global theme options."),
    array(  "name"     => "Main Color Scheme",
            "desc"     => "Choose a template color scheme.",
            "id"       => $shortname."_color_scheme",
            "std"      => "Default",
            "type"     => "select",
            "options"  => array("Default", "Blue", "Red", "Pink") ),
    array(  "name"     => "Sidebar Position",
            "desc"     => "Choose a sidebar position.",
            "id"       => $shortname."_sidebar_position",
            "std"      => "right",
            "type"     => "select",
            "options"  => array('right', 'left') ),
    array(  "name"    => "Game Category Presentation",
            "desc"    => "Select how the category boxes should be displayed on the front page",
            "id"      => $shortname."_box_design",
            "std"     => "Vertical",
            "type"    => "select",
            "options" => array("Horizontal", "Full", "Half", "Miniclip", "Vertical") ),
    /*array(  "name"     => "Image Hover Effect",
            "desc"     => "Choose an image hover effect",
            "id"       => $shortname."_color_scheme",
            "std"      => "Default",
            "type"     => "select",
            "options"  => array("Default", "ZoomIn", "ZoomOut", "Grayscale") ),*/
    array(   "name"     => "Games per category box",
            "desc"     => "Set the number of games that should be shown in each category box on the front page",
            "id"       => $shortname."_box_count",
            "std"      => "6",
            "type"     => "text"),
    array(   "name"     => "Hide Category Boxes",
            "desc"     => "Select the categories which should be excluded from the front page view.",
            "id"       => $shortname."_exclude_front_cat",
            "std"      => "",
            "options"  => $slidercategs,
            "type"     => "categories_checkboxes"),
    array(  "name"    => "Blog category",
            "desc"    => "Select a category that should be used as the regular blog.",
            "id"      => $shortname."_blog_category",
            "std"     => "-- none --",
            "type"    => "select",
            "options" => $blogcats),
    array(  "name"     => "User Login Bar",
            "desc"     => "Enable or disable the user login bar.",
            "id"       => $shortname."_show_loginform",
            "std"      => "enable",
            "type"     => "select",
            "options"  => $selectOnOff ),
    array(  "name"     => "Rich Snippet",
            "desc"     => "Enable this option if you want to activate Rich Snippets for games. (Required WP-PostRatings plugin)",
            "id"       => $shortname."_rich_snippet",
            "std"      => "enable",
            "type"     => "select",
            "options"  => $selectOnOff ),
    array(   "name"     => "Load jQuery from Google CDN",
            "desc"     => "Enable this if you want to load the jQuery library from Google CDN instead from your site. This could reduce the load time of your site.",
            "id"       => $shortname."_jquery_cdn",
            "std"      => "disable",
            "type"     => "select",
            "options"  => $selectOnOff ),
    array(  "type"     => "savebutton"),
    array(  "type"    => "close"),

    // Header & Footer
    array(  "type"     => "open"),
    array(  "name"     => "Header & Footer",
            "type"     => "title"),
    /* Header */
    array(  "name"     => "Header Settings",
            "type"     => "sub-title",
            "desc"     => "Header customization options."),
    array(  "name"     => "Custom Favicon",
            "desc"     => "Enable or disable the Custom Favicon.",
            "id"       => $shortname."_custom_favicon_status",
            "std"      => "disable",
            "type"     => "select",
            "options"  => $selectOnOff),
    array(   "name"     => "",
            "desc"     => "The complete URL to your favicon.",
            "id"       => $shortname."_custom_favicon",
            "std"      => "",
            "type"     => "text"),

    array(  "name"     => "Custom Logo",
            "desc"     => "Enable or disable the Custom Logo.",
            "id"       => $shortname."_custom_logo_status",
            "std"      => "disable",
            "type"     => "select",
            "options"  => $selectOnOff ),
    array(  "name"    => "",
            "desc"    => "The complete URL to you logo. Maximum dimensions are 460x80px.",
            "id"      => $shortname."_custom_logo",
            "std"      => "",
            "type"    => "text"),

    array(  "name"    => "Description and Keywords Status",
            "desc"    => "Disable Site Description and Site Keywords if you use a SEO plugin.",
            "id"      => $shortname."_site_sitedesc_status",
            "std"     => "disable",
            "type"    => "select",
            "options" => $selectOnOff ),
    array(  "name"    => "Site Keywords",
            "desc"    => "The keywords that best describe your website seperated by a coma(,). This is a meta-tag within the HEAD tags.",
            "id"      => $shortname."_custom_site_keywords",
            "std"      => "",
            "type"    => "text"),
    array(  "name"    => "Site Description",
            "desc"    => "A small description of your site for the meta-tag",
            "id"      => $shortname."_custom_sitedesc",
            "std"      => "",
            "type"    => "textarea"),

    array(  "name"     => "Custom Header Code",
            "desc"     => "Enable or disable the Custom Header Code.",
            "id"       => $shortname."_custom_headercode_status",
            "std"      => "disable",
            "type"     => "select",
            "options"  => $selectOnOff ),
    array(   "name"     => "",
            "desc"     => "Enter special code. ( e.g.: Mochi Verification)",
            "id"       => $shortname."_custom_headercode",
            "std"      => "",
            "type"     => "textarea"),

    array(  "name"     => "Footer Settings",
            "type"     => "sub-title",
            "desc"     => "Footer customization settings"),
    array(  "name"     => "Custom Footer Code",
            "desc"     => "Enable or disable the Custom Footer Code.",
            "id"       => $shortname."_custom_footercode_status",
            "std"      => "disable",
            "type"     => "select",
            "options"  => $selectOnOff ),
    array(   "name"     => "",
            "desc"     => "Enter special code ( e.g.: Google Analytics).",
            "id"       => $shortname."_custom_footercode",
            "std"      => "",
            "type"     => "textarea"),

    array(  "name"    => "MyArcadePlugin Affiliate Link",
            "desc"    => "Enter your MyArcadePlugin affiliate link here to promote MyArcadePlugin and to earn extra money! If you do not have an affiliate account, please create one: <a href='http://myarcadeplugin.com/affiliate-program/' title='MyArcadePlugin Affiliate Program' target='_blank'>Affiliate Program</a>",
            "id"      => $shortname."_affiliate",
            "std"      => "",
            "type"    => "text"),
    array(  "name"    => "Affiliate Link Text",
            "desc"    => "You can enter a user defined Link Text for your affliate link. E.g <strong>MyArcadePlugin - Arcade Solution</strong>",
            "id"      => $shortname."_affiliate_text",
            "std"      => "",
            "type"    => "text"),
    array(  "type"     => "savebutton"),
    array(  "type"     => "close"),


    // Home Page Settings
    array(  "type"     => "open"),
    array(  "name"     => "Home Page",
            "type"     => "title",
            "desc"     => "This section customizes the front page of your site."),

    array(  "name"     => "Game Order",
            "desc"     => "Select how games should be ordered on the front page. Info: Random order may slow down your site!",
            "id"       => $shortname."_order_games",
            "std"      => "Descending",
            "type"     => "select",
            "options"  => array( 'Descending', 'Random' ) ),

    array(  "name"     => "Contest Box",
            "desc"     => "Enable or disable the contest box on the frontpage (<a href=\"http://exells.com/shop/arcade-plugins/myarcadecontest/\" target=\"_blank\">MyArcadeContest</a> required!)",
            "id"       => $shortname."_contest_box",
            "std"      => "disable",
            "type"     => "select",
            "options"  => $selectOnOff ),
    array(  "name"     => "Context Box Title",
            "level"    => "5",
            "desc"     => "Set the title for the contest promo box.",
            "id"       => $shortname."_contest_promo_title",
            "std"      => "Our Latest Contests",
            "type"     => "text"),
    array(  "name"     => "Displayed Contests",
            "level"    => "5",
            "desc"     => "Leave this field blank if you want to display two latest contest or add two contest id's (coma separated) if you want to promote specific contests.",
            "id"       => $shortname."_contest_ids",
            "std"      => "",
            "type"     => "text"),

    array(  "name"     => "Hall Of Fame",
            "desc"     => "Enable or disable the user leaderboard belt.",
            "id"       => $shortname."_hall_of_fame",
            "std"      => "disable",
            "type"     => "select",
            "options"  => $selectOnOff ),
    array(  "name"     => "Hall Of Fame Box Title",
            "level"    => "5",
            "desc"     => "Set the title for the hall of fame box.",
            "id"       => $shortname."_hall_of_fame_box_title",
            "std"      => "Hall Of Fame",
            "type"     => "text"),

    array(  "name"     => "Sortable Games Box",
            "desc"     => "Enable or disable the sortable games box.",
            "id"       => $shortname."_games_box",
            "std"      => "disable",
            "type"     => "select",
            "options"  => $selectOnOff ),
    array(  "name"     => "Sortable Games Box Title",
            "level"    => "5",
            "desc"     => "Set the title for the sortable games box.",
            "id"       => $shortname."_sortable_game_box_title",
            "std"      => "Promoted Games",
            "type"     => "text"),
    array(  "name"     => "Sortable Games Box Game Count",
            "level"    => "5",
            "desc"     => "Set how many games should be displayed on the sortable games box.",
            "id"       => $shortname."_games_box_count",
            "std"      => "24",
            "type"     => "text"),
    array(  "name"     => "Front Page Text",
            "desc"     => "Activate a custom text box on the front page.",
            "id"       => $shortname."_frontpage_text_status",
            "std"      => "disable",
            "type"     => "select",
            "options"  => $selectOnOff ),
    array(  "name"     => "",
            "desc"     => "Here you can add some text for SEO purpose or just to introduce your site.",
            "id"       => $shortname."_frontpage_text",
            "std"      => "",
            "type"     => "textarea"),
    // Step Carousel
    array(  "name"    => "Step Carousel Settings",
            "type"    => "sub-title",
            "desc"    => "Step carousel displays game thumbnails by side scrolling them left."),
    array(  "name"     => "",
            "desc"     => "Enable or disable the step carousel.",
            "id"       => $shortname."_step_carousel",
            "std"      => "enable",
            "type"     => "select",
            "options"  => $selectOnOff),
    array(  "name"    => "Categories",
            "desc"    => "Select game categories that should be displayed on the step carousel.",
            "id"      => $shortname."_step_carousel_category",
            "std"     => "",
            "type"    => "categories_checkboxes",
            "options" => $slidercategs),
    array(  "name"     => "Auto scroll",
            "desc"     => "Enable or disable auto scroll.",
            "id"       => $shortname."_step_carousel_auto",
            "std"      => "enable",
            "type"     => "select",
            "options"  => $selectOnOff ),
    array(  "name"     => "Game Order",
            "desc"     => "Select how games should be ordered on the step carousel. Info: Random order may slow down your site!",
            "id"       => $shortname."_step_carousel_order",
            "std"      => "Descending",
            "type"     => "select",
            "options"  => array( 'Descending', 'Random' ) ),
    array(  "name"     => "Game Count",
            "desc"     => "Set how many games should be displayed on the step carousel. (Default: 20)",
            "id"       => $shortname."_step_carousel_games",
            "std"      => "20",
            "type"     => "text"),
    // Nivo Slider
    array(  "name"    => "NivoSlider Settings",
            "type"    => "sub-title",
            "desc"    => "NivoSlider is a jquery slider for game screenshots."),
    array(  "name"     => "Enable / Disable",
            "desc"     => "Enable or disable NivoSlider.",
            "id"       => $shortname."_nivoslider",
            "std"      => "disable",
            "type"     => "select",
            "options"  => $selectOnOff),
    array(  "name"    => "Categories",
            "desc"    => "Select game categories that should be displayed on the NivoSlider.",
            "id"      => $shortname."_nivoslider_category",
            "std"     => "",
            "type"    => "categories_checkboxes",
            "options" => $slidercategs),
    array(  "name"     => "Auto scroll",
            "desc"     => "Enable or disable auto scroll.",
            "id"       => $shortname."_nivoslider_auto",
            "std"      => "enable",
            "type"     => "select",
            "options"  => $selectOnOff ),
    array(  "name"     => "Game Order",
            "desc"     => "Select how games should be ordered on the NivoSlider. Info: Random order may slow down your site!",
            "id"       => $shortname."_nivoslider_order",
            "std"      => "Descending",
            "type"     => "select",
            "options"  => array( 'Descending', 'Random' ) ),

    array(  "type"     => "savebutton"),
    array(  "type"    => "close"),


    // Game Page Settings
    array(  "type"     => "open"),
    array(  "name"     => "Game Page",
            "type"     => "title",
            "desc"     => "This section customizes the game presentation and play page of your site."),
    array(  "name"     => "Pre-Game Page",
            "desc"     => "Enable this if you want to display a pre-game / game landing page. User will need to click on a play button.",
            "id"       => $shortname."_pregame_page",
            "std"      => "disable",
            "type"     => "select",
            "options"  => $selectOnOff),
    array(  "name"     => "Game Play Permalink Endpoint",
            "desc"     => "Define the permalink endpoint for the game play page (Default: play). When you change this then you MUST visit the <a href='".admin_url('options-permalink.php')."' target='_blank'>Permalinks Settings</a> page once!",
            "id"       => $shortname."_endpoint_play",
            "std"      => "play",
            "type"     => "text"),
    array(  "name"     => "Game Embed Box",
            "desc"     => "Enable or disable the game embed box ('Embed this game on your site..').",
            "id"       => $shortname."_share_box",
            "std"      => "enable",
            "type"     => "select",
            "options"  => $selectOnOff ),
    array(   "name"     => "Display Game Screen Shots",
            "desc"     => "Enable this if you want to display game screenshots on single game pages (only if available).",
            "id"       => $shortname."_dispay_screens",
            "std"      => "disable",
            "type"     => "select",
            "options"  => $selectOnOff ),
    array(   "name"     => "Display Game Video",
            "desc"     => "Enable this if you want to display game video on single game pages (only if available).",
            "id"       => $shortname."_dispay_video",
            "std"      => "disable",
            "type"     => "select",
            "options"  => $selectOnOff ),
    array(   "name"     => "Fullscreen Button",
            "desc"     => "Enable this if you want to display the fullscreen button.",
            "id"       => $shortname."_button_fullscreen",
            "std"      => "enable",
            "type"     => "select",
            "options"  => $selectOnOff ),
    array(   "name"     => "Lights On / Off Button",
            "desc"     => "Enable this if you want to display the lights button.",
            "id"       => $shortname."_button_lights",
            "std"      => "enable",
            "type"     => "select",
            "options"  => $selectOnOff ),
    array(   "name"     => "Favorite Button",
            "desc"     => "Enable this if you want to display the favorite button.",
            "id"       => $shortname."_button_favorite",
            "std"      => "enable",
            "type"     => "select",
            "options"  => $selectOnOff ),
    /*array(   "name"     => "Game Zoom",
            "desc"     => "Enable this if you want to display the game zoom on the game play page.",
            "id"       => $shortname."_game_zoom",
            "std"      => "enable",
            "type"     => "select",
            "options"  => $selectOnOff ),*/
    // Progress Bar
    array(  "name"     => "Progress Bar",
            "type"     => "sub-title",
            "desc"     => "This section allows you to setup the game loading bar."),
    array(  "name"     => "Progress Bar",
            "desc"     => "Enable or disable the progress bar.",
            "id"       => $shortname."_progressbarstatus",
            "std"      => "enable",
            "type"     => "select",
            "options"  => array( 'enable', 'disable' ) ),
    array(  "name"     => "",
            "desc"     => "Select the delay in ms before the progress bar starts to load.",
            "id"       => $shortname."_progressbardelay",
            "std"     => "0",
            "type"     => "select",
            "options" => array( "0", "500", "1000", "1500", "2000", "2500", "3000", "3500", "4000", "4500", "5000", "5500", "6000", "6500", "7500", "8000", "9000" ) ),
    array(  "name"     => "",
            "desc"     => "Select the load speed index of the progress bar",
            "id"       => $shortname."_progressbarspeedindex",
            "std"     => "10",
            "type"     => "select",
            "options" => array( "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20" ) ),
    array(  "name"     => "",
            "desc"     => "Enable or disable the text under the progress bar .",
            "id"       => $shortname."_progressbartextloadstatus",
            "std"     => "enable",
            "type"    => "select",
            "options" => array('enable', 'disable') ),
    array(   "name"     => "",
            "desc"     => "Progress Bar Text",
             "id"       => $shortname."_progressbartextload",
            "std"     => "<p>Game loaded, click here to start the game!</p>",
            "type"     => "text"),
    array(   "name"     => "",
            "desc"     => "Set the limit in percent of the loading progress when the Progress Bar Text should be shown",
             "id"      => $shortname."_progressbartextloadlimit",
            "std"     => "35",
            "type"     => "select",
            "options"   => array( "0", "5", "10", "15", "20", "25", "30", "35", "40", "45", "50", "55", "60", "65", "70", "75", "80", "85", "90", "95", "100" ) ),
    array(   "name"     => "",
            "desc"     => "Define the textcolor of the percentage text.",
             "id"       => $shortname."_progressbartextcolor",
            "std"     => "#000000",
            "type"     => "text"),
    array(   "name"     => "",
            "desc"     => "Define the bordercolor of the progress bar.",
             "id"       => $shortname."_progressbarbordercolor",
            "std"      => "#000000",
            "type"     => "text"),
    array(   "name"     => "",
            "desc"     => "Define the backgroundcolor of the progress bar.",
             "id"       => $shortname."_progressbarbackgroundcolor",
            "std"     => "#ffffff",
            "type"     => "text"),
    array(   "name"     => "",
            "desc"     => "Define the loading color of the progress bar.",
             "id"       => $shortname."_progressbarloadcolor",
            "std"     => "#999999",
            "type"     => "text"),

    array(  "type"     => "savebutton"),
    array(  "type"    => "close"),


    // Advertisement Options
    array(  "type"     => "open"),
    array(  "name"    => "Advertisement Banner",
            "type"    => "title",
            "desc"    => "Manage your banner and adsense advertisement areas.",
    ),
    array(  "name"    => "Header Banner",
            "desc"    => "Put your code for 468x60 banner here",
            "id"      => $shortname."_headerad",
            "std"     => "",
            "type"    => "textarea"
    ),
    array(  "name"    => "Pre-Game Banner",
            "desc"    => "Put your code for 200x200 banner here.",
            "id"      => $shortname."_adpregame",
            "std"     => "",
            "type"    => "textarea"
    ),
    array(  "name"    => "Content Banner",
            "desc"    => "Put your code for 300x250 banner here.",
            "id"      => $shortname."_adcontent",
            "std"     => "",
            "type"    => "textarea"
    ),
    array(  "name"    => "Game Preloader Banner",
            "desc"    => "Put your advertisement code for the game preloader here.",
            "id"      => $shortname."_loadinggameadcode",
            "std"     => "",
            "type"    => "textarea"
    ),
    array(  "name"    => "Over Game Banner",
            "desc"    => "Put your code for 728x90 banner here.",
            "id"      => $shortname."_adtop",
            "std"     => "",
            "type"    => "textarea"
    ),
    array(  "name"     => "",
            "desc"     => "Enable or disable 150px space between the over game banner and the game to match Google Adsense ToS.",
            "id"       => $shortname."_150_space",
            "std"      => "disable",
            "type"     => "select",
            "options"  => $selectOnOff ),

    array(  "name"    => "Banner for Index Page",
            "desc"    => "Put your code for 200x200 banner here.",
            "id"      => $shortname."_adindex",
            "std"     => "",
            "type"    => "textarea"
    ),

    array(  "type"     => "savebutton"),
    array(  "type"     => "close" ),

    // Recommended Plugins
    array(  "type"     => "open"),
    array(  "name"     => "Recommended Plugins",
            "type"     => "title",
            "desc"     => "Here you can see a list of recommended plugins, so all themes functions will work properly. A 'X' marks a plugin which is not installed."),
    array(  "name"      => "BuddyPress",
            "function"  => "bp_init",
            "type"      => "plugincheck"),
    array(  "name"      => "Lightbox Plus",
            "function"  => "ActivateLBP",
            "type"      => "plugincheck"),
    array(   "name"     => "MyArcadePlugin Pro",
            "function"    => "get_game",
            "type"     => "plugincheck"),
    array(   "name"     => "MyGameListCreator",
            "function"    => "get_game_list",
            "type"     => "plugincheck"),
    array(   "name"     => "MyScoresPresenter",
            "function"    => "myscore_get_latest_scores",
            "type"     => "plugincheck"),
    array(   "name"     => "WP-PageNavi",
            "function"    => "wp_pagenavi",
            "type"     => "plugincheck"),
    array(   "name"     => "WP-PostRatings",
            "function"    => "the_ratings",
            "type"     => "plugincheck"),
    array(   "name"     => "WP-PostViews",
            "function"    => "the_views",
            "type"     => "plugincheck"),
    array(   "name"     => "WP Favorite Posts",
            "function"    => "wpfp_link",
            "type"     => "plugincheck"),
    array(   "name"     => "Sexy Bookmarks",
            "function"    => "selfserv_shareaholic",
            "type"     => "plugincheck"),
    array(  "type"     => "close")
));
?>