<?php
if ( class_exists('WP_Widget') ) {
  // Include Widgets
  include_once 'widgets/widget_most_played.php';
  include_once 'widgets/widget_most_rated.php';
  include_once 'widgets/widget_user_panel.php';
  include_once 'widgets/widget_youtube_video.php';
  include_once 'widgets/widget_ads125.php';
  include_once 'widgets/widget_recent_games.php';
  include_once 'widgets/widget_random_games.php';
  include_once 'widgets/widget_advertisement.php';
  include_once 'widgets/widget_info.php';
  include_once 'widgets/widget_most_popular.php';

  if ( !function_exists('myabp_register_widgets') ) {
    function myabp_register_widgets() {
      register_widget('WP_Widget_MABP_Youtube_Video');
      register_widget('WP_Widget_MABP_User_Login');
      register_widget('WP_Widget_MABP_Recent_Games');
      register_widget('WP_Widget_MABP_Random_Games');
      register_widget('WP_Widget_MABP_Most_Rated');
      register_widget('WP_Widget_MABP_Most_Played');
      register_widget('WP_Widget_MABP_Banner_125');
      register_widget('WP_Widget_MABP_Advertisement');
      register_widget('WP_Widget_MABP_Info');
      register_widget('WP_Widget_MABP_Most_Popular');
    }
  }

  add_action('widgets_init', 'myabp_register_widgets');
}

add_action('widgets_init', 'myarcadetheme_widgets_init');

function myarcadetheme_widgets_init() {

  register_sidebar(
    array('name'          => __('Main Sidebar', 'myarcadetheme'),
        'id'            =>'others-sidebar',
        'description'   => __('This is the sidebar that gets shown on the home page.', 'myarcadetheme'),
        'before_widget' => '<div id="%1$s" class="blk-cn %2$s">',
        'after_widget'  => '</div>',
        'before_title'  => '<div class="titl">',
        'after_title'   => '</div>',
    )
  );

  register_sidebar(
    array('name'          => __('Single Sidebar', 'myarcadetheme'),
        'id'            =>'single-sidebar',
        'description'   => __('This is your sidebar that gets shown on the game or blog pages.', 'myarcadetheme'),
        'before_widget' => '<div id="%1$s" class="blk-cn %2$s">',
        'after_widget'  => '</div>',
        'before_title'  => '<div class="titl">',
        'after_title'   => '</div>',
    )
  );

  register_sidebar(
    array('name'          => __('Page Sidebar', 'myarcadetheme'),
        'id'            =>'page-sidebar',
        'description'   => __('This is your sidebar that gets shown on most of your pages.', 'myarcadetheme'),
        'before_widget' => '<div id="%1$s" class="blk-cn %2$s">',
        'after_widget'  => '</div>',
        'before_title'  => '<div class="titl">',
        'after_title'   => '</div>',
    )
  );

  register_sidebar(
    array('name'          => __('Category Sidebar', 'myarcadetheme'),
        'id'            =>'category-sidebar',
        'description'   => __('This is your sidebar that gets shown on the category pages.', 'myarcadetheme'),
        'before_widget' => '<div id="%1$s" class="blk-cn %2$s">',
        'after_widget'  => '</div>',
        'before_title'  => '<div class="titl">',
        'after_title'   => '</div>',
    )
  );

  register_sidebar(
    array('name'          => __('Footer Sidebar', 'myarcadetheme'),
        'id'            =>'footer-sidebar',
        'description'   => __('This is your sidebar that gets shown on the footer.', 'myarcadetheme'),
        'before_widget' => '<div id="%1$s" class="blk-cn ftblk cols-n3 %2$s">',
        'after_widget'  => '</div>',
        'before_title'  => '<div class="titl">',
        'after_title'   => '</div>',
    )
  );
}