<?php

/*

 * Header Template

 *

 * ArmorThemes.com

 * 

 * GameKing Theme v1.0

 */

?><!DOCTYPE html>

<!--[if IE 6]>

<html class="ie ie6" <?php language_attributes(); ?>>

<![endif]-->

<!--[if IE 7]>

<html class="ie ie7" <?php language_attributes(); ?>>

<![endif]-->

<!--[if IE 8]>

<html class="ie ie8" <?php language_attributes(); ?>>

<![endif]-->

<!--[if !(IE 6) | !(IE 7) | !(IE 8)  ]><!-->

<html <?php language_attributes(); ?>>

<!--<![endif]-->

<head>



<!-- Meta -->

<meta charset="<?php bloginfo('charset'); ?>" />

<meta name="viewport" content="width=device-width" />

<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">



<title><?php wp_title('-'); ?></title>



<link rel="profile" href="http://gmpg.org/xfn/11" />

<?php if($favic = get_option('armor_favicon')) echo '<link rel="shortcut icon" href="'.$favic.'" />'."\n"; ?>

<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>" />



<!-- Styles ans Scripts -->

<link href='http://fonts.googleapis.com/css?family=Oswald:400,700,300' rel='stylesheet' type='text/css'>

<link href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css" rel="stylesheet">

<link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="all" />

<?php if(get_option('armor_responsive')) { ?>

<link rel="stylesheet" href="<?php echo get_template_directory_uri(); ?>/responsive.css" type="text/css" media="all" />

<?php } ?>

<?php wp_head(); ?>

<?php

// CSS Style based on user's settings on Theme Options page

$css = '';



$headcolor = get_option('armor_headbgcolor');

$menubarcolor = get_option('armor_mainnavbgcolor');

$activemenubut = get_option('armor_activenavbutbg');

$hovermenubut = get_option('armor_hovernavbutbg');

$textmenubut = get_option('armor_textnavbut');

$acttextmenubut = get_option('armor_acttextnavbut');

$midbgcolor = get_option('armor_middlebgcolor');

$actmidbg = get_option('armor_actmidbutbg');

$textmid = get_option('armor_textmid');

$boxtitcolor = get_option('armor_boxtit');

$boxtitcolorhover = get_option('armor_boxtithover');

$boxtitbord = get_option('armor_boxtitborder');

$homemoretext = get_option('armor_homemoretext');

$homemorebg = get_option('armor_homemorebg');

$homemorehoverbg = get_option('armor_homemorehoverbg');

$carousbg = get_option('armor_carousbg');

$themedir = get_template_directory_uri();

$caroushoverbg = get_option('armor_caroushoverbg');

$posttitle = get_option('armor_posttitle');

$posttitlehover = get_option('armor_posttitlehover');

$thumbborder = get_option('armor_thumbborder');

$thumbborderhover = get_option('armor_thumbborderhover');

$tagstext = get_option('armor_tagstext');

$tagsbg = get_option('armor_tagsbg');

$tagsbghover = get_option('armor_tagsbghover');

$inthead = get_option('armor_inthead');

$intheadtext = get_option('armor_intheadtext');

$intbuttext = get_option('armor_intbuttext');

$intbuttexth = get_option('armor_intbuttexth');

$intbutcolor = get_option('armor_intbutcolor');

$intbutcolorh = get_option('armor_intbutcolorh');

$posttextcolor = get_option('armor_posttextcolor');

$linkstextcolor = get_option('armor_linkstextcolor');

$linkstextcolorh = get_option('armor_linkstextcolorh');

$footback = get_option('armor_footback');

$footbacktop = get_option('armor_footbacktop');

$footmenutext = get_option('armor_footmenutext');

$footmenutexth = get_option('armor_footmenutexth');

$footcredits = get_option('armor_footcredits');



$bgpat = get_option('dp_bgpat');

$bgcolor = get_option('dp_bgcolor');



if(!empty($headcolor))

	$css .= "header{background-color:$headcolor;}\n";

if(!empty($menubarcolor))

	$css .= "#main-nav{background-color:$menubarcolor;}\n";	

if(!empty($activemenubut))

	$css .= "#main-nav .menu>li.current-menu-item>a{background-color:$activemenubut;}\n";

if(!empty($hovermenubut))

	$css .= "#main-nav .menu>li>a:hover{background-color:$hovermenubut;}\n";

if(!empty($textmenubut))

	$css .= "#main-nav .menu > li > a{color:$textmenubut;}\n";

if(!empty($acttextmenubut))

	$css .= "#main-nav .menu>li.current-menu-item>a{color:$acttextmenubut;}\n";	

if(!empty($midbgcolor))

	$css .= "#middle-nav{background-color:$midbgcolor;}\n";	

if(!empty($actmidbg))

	$css .= "#middle-nav .menu>li>a:hover{background-color:$actmidbg;}\n";

if(!empty($textmid))

	$css .= "#middle-nav .menu>li>a{color:$textmid;}\n";	

if(!empty($boxtitcolor))

	$css .= "h1,h2,h3,h4,h5,h6{color:$boxtitcolor;}\n";		

	$css .= ".box-title a{color:$boxtitcolor;}\n";

if(!empty($boxtitcolorhover))

	$css .= ".box-title a:hover{color:$boxtitcolorhover;}\n";	

if(!empty($boxtitbord))

	$css .= ".box-title,.widget-title,.loop-title,.section-title {border-bottom: 4px solid $boxtitbord;}\n";	

if(!empty($homemoretext))

	$css .= ".box-header .more-link {color:$homemoretext;}\n";		

if(!empty($homemorebg))

	$css .= ".box-header .more-link {background:$homemorebg;}\n";	

if(!empty($homemorehoverbg))

	$css .= ".box-header .more-link:hover {background:$homemorehoverbg;}\n";	

if(!empty($carousbg))

	$css .= ".fcarousel .carousel-prev {background:$carousbg url($themedir/images/scroll-left.png) no-repeat right 40px;}\n";	

	$css .= ".fcarousel .carousel-next {background:$carousbg url($themedir/images/scroll-right.png) no-repeat left 40px;}\n";	

if(!empty($caroushoverbg))

	$css .= ".fcarousel .carousel-prev:hover {background:$caroushoverbg url($themedir/images/scroll-left.png) no-repeat right 40px;}\n";	

	$css .= ".fcarousel .carousel-next:hover {background:$caroushoverbg url($themedir/images/scroll-right.png) no-repeat left 40px;}\n";

if(!empty($posttitle))

	$css .= ".item .title a {color:$posttitle;}\n";

if(!empty($posttitlehover))

	$css .= ".item .title a:hover {color:$posttitlehover;}\n";

if(!empty($thumbborder))

	$css .= ".fcarousel li,.item .thumb {border: 2px solid $thumbborder;}\n";

if(!empty($thumbborderhover))

	$css .= ".fcarousel li:hover,.item .thumb:hover {border: 2px solid $thumbborderhover;}\n";

if(!empty($tagstext))

	$css .= ".widget_tag_cloud a {color:$tagstext;}\n";

if(!empty($tagsbg))

	$css .= ".widget_tag_cloud a {background:$tagsbg;}\n";	

if(!empty($tagsbghover))

	$css .= ".widget_tag_cloud a:hover {background:$tagsbghover;}\n";

if(!empty($inthead))

	$css .= ".headgamebar {background:$inthead;}\n";

if(!empty($intheadtext))

	$css .= ".headgametitle {color:$intheadtext;}\n";

if(!empty($intbuttext))

	$css .= ".gamebut, .register-link {color:$intbuttext;}\n";	

if(!empty($intbuttexth))

	$css .= ".gamebut:hover, .register-link:hover {color:$intbuttexth;}\n";		

if(!empty($intbutcolor))

	$css .= ".gamebut, .register-link {background-color:$intbutcolor;}\n";

if(!empty($intbutcolorh))

	$css .= ".gamebut:hover, .register-link:hover {background-color:$intbutcolorh;}\n";

if(!empty($posttextcolor))

	$css .= ".entry-content {color:$posttextcolor;}\n";

if(!empty($linkstextcolor))

	$css .= "a, #account-nav .dropdown-handle .display-name {color:$linkstextcolor;}\n";

if(!empty($linkstextcolorh))

	$css .= "a:hover {color:$linkstextcolorh;}\n";

if(!empty($footback))

	$css .= "#footer {background:$footback;}\n";

if(!empty($footbacktop))

	$css .= "#footer {border-top: 4px solid $footbacktop;}\n";

if(!empty($footmenutext))

	$css .= "#colophon a {color:$footmenutext;}\n";	

if(!empty($footmenutexth))

	$css .= "#colophon a:hover, #footer-nav li a:hover {color:$footmenutexth;}\n";	

if(!empty($footcredits))

	$css .= "#colophon {color:$footcredits;}\n";	

	

if(!empty($bgcolor))

	$css .= "body{background-color:$bgcolor;}\n";

if(!empty($bgpat)) {

	$preset_bgpat = get_option('dp_preset_bgpat');

	$custom_bgpat = get_option('dp_custom_bgpat'); 

	$bgpat = !empty($custom_bgpat) ? $custom_bgpat : $preset_bgpat;

	$bgpat = apply_filters('dp_bgpat', $bgpat);

	$css .= "body{background-image:url('$bgpat');}\n";

} else {

	$css .= "body{background-image:none;}\n";

}

	

if(!empty($css)) {

	echo "\n<!-- Generated CSS BEGIN -->\n<style type='text/css'>\n";

	echo $css;

	echo "\n</style>\n<!-- Generated CSS END -->\n";

}

?>

</head>



<body <?php body_class(); ?>>



<div id="page">

<header id="header">

<div class="wrap cf">

<div id="headlogo" class="<?php echo get_option('dp_logo_type', 'text'); ?>-branding" role="banner">

		<h1 id="head-title"><a rel="home" href="<?php echo home_url(); ?>"><?php bloginfo( 'name' ); ?></a></h1>

		<?php if (get_option('dp_logo_type') == 'image' && $logo = get_option('dp_logo')) { ?>

			<a id="head-logo" rel="home" href="<?php echo home_url(); ?>"><img src="<?php echo $logo; ?>" alt="<?php bloginfo( 'name' ); ?>"/></a>

		<?php } ?>

		<h2 id="head-description"<?php if(!get_option('dp_site_description')) echo ' class="hidden"'; ?>><?php bloginfo('description'); ?></h2>

	</div><!-- end #branding -->

<?php if(is_user_logged_in()) {  

		$user_id = get_current_user_id();

		$current_user = wp_get_current_user();

		$profile_url = get_author_posts_url($user_id);

		$edit_profile_url  = get_edit_profile_url($user_id);

		$current_url = get_current_url();

		?>

		<div id="account-nav" class="user-nav">

			<a class="dropdown-handle" href="<?php echo $profile_url; ?>">

				<?php echo get_avatar( $user_id, 32 ); ?>

				<span class="display-name btn"><span class="arrow-down"><?php echo $current_user->display_name; ?></span></span>

			</a>

					

			<div class="dropdown-content">

				<ul class="dropdown-content-inner">

					<li><a class="profile-link" href="<?php echo $profile_url; ?>"><?php _e('Profile', 'dp'); ?></a></li>

					<li><a class="logout-link" href="<?php echo home_url(); ?>/my-likes/"><?php _e('My Likes', 'dp'); ?></a></li>

					<li><a class="account-link" href="<?php echo $edit_profile_url; ?>"><?php _e('Account', 'dp'); ?></a></li>

					<li><a class="logout-link" href="<?php echo esc_url(wp_logout_url($current_url)); ?>"><?php _e('Log out', 'dp'); ?></a></li>

				</ul>

			</div>

		</div><!-- end #account-nav -->

	<?php } elseif(get_option('users_can_register')) { ?>

		<div id="login-nav" class="user-nav">

			<a class="register-btn" href="<?php echo site_url('wp-login.php?action=register', 'login'); ?>"><i class="fa fa-sign-in"></i><?php _e('Sign up', 'dp'); ?></a>

				

			<div class="dropdown">

				<a class="dropdown-handle login-btn login-link" href="<?php echo wp_login_url(); ?>"><i class="fa fa-user"></i><?php _e('Log In', 'dp'); ?></a>

					

				<div class="dropdown-content"><div class="dropdown-content-inner">

					<?php wp_login_form(); ?>

				</div></div>

			</div>

		</div><!-- end #login-nav -->

	

	<?php } ?>	

<div id="nav-search">

		<?php get_search_form(); ?>

	</div><!-- end #nav-search -->

</div>

</header><!-- end #header-->

<div id="main-nav">

<div class="wrap cf">

	<?php 

		$nav_menu = wp_nav_menu(array('theme_location'=>'main', 'container'=>'', 'fallback_cb' => '', 'echo' => 0)); 

		

		// The fallback menu

		if(empty($nav_menu))

			$nav_menu = '<ul class="menu">'.wp_list_categories(array('show_option_all'=>__('Home', 'dp'), 'title_li'=>'', 'echo'=>0)).'</ul>';

		

		echo $nav_menu;

	?>

	

</div>

</div><!-- end #main-nav -->



<?php do_action( 'dp_after_header_php' ); ?>