<!DOCTYPE html>
<html class="no-js" lang="zh-CN">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0">
<meta content="IE=edge,chrome=1" http-equiv="X-UA-Compatible" />
<meta content="webkit" name="renderer" />
<title><?php wp_title( '-', true, 'right' ); ?></title>
<?php monkey_keywords();monkey_description();$options = get_option('monkey-options');?>
<link rel="shortcut icon" href="<?php echo $options['favicon'];?>">
<link href="<?php bloginfo("template_url")?>/style.css" media="all" rel="stylesheet" />
<script>window._MBT = {uri: '<?php echo get_bloginfo("template_url") ?>',ajax: '<?php echo $options['ajaxpage'];?>'}</script>
<script src="<?php bloginfo("template_url")?>/static/js/jquery.min.js"></script>
<!--[if lt IE 9]>
<script src="<?php bloginfo("template_url")?>/static/js/html5shiv.js"></script>
<![endif]-->
<?php wp_head();?>
<style type="text/css">
<?php echo $options['css'];?>
<?php if($options['fixtop']){ ?>body {padding-top: 62px;}<?php }?>
<?php if($options['ajaxpage']){?>.ias_pagination{display:none}<?php }?>
</style>
</head>
<body <?php body_class();?>>
<header class="common-header J_commonHeaderWrapper header-wrap">
  <div class="container"> <a class="logo" href="<?php bloginfo('url')?>"> <img src="<?php echo $options['logo']?$options['logo']:get_bloginfo("template_url").'/static/img/logo.png'?>" alt="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>"> </a>
    <div class="triggers"> <a class="headericon-header-search J_searchTrigger" href="javascript:void(0)"></a> <a class="headericon-header-menu J_menuTrigger" href="javascript:void(0)"></a> </div>
    <nav>
      <ul class="J_navList">
        <?php echo str_replace("</ul></div>", "", ereg_replace("<div[^>]*><ul[^>]*>", "", wp_nav_menu(array('theme_location' => 'header', 'echo' => false)) )); ?>
        <li class="mobile-show"> </li>
      </ul>
    </nav>
    <div class="right-col J_rightNavWrapper">
      <ul class="sub-nav">
        <?php if($options['touurl']){?>
        <li class="tougao-item">
        	<a href="<?php echo $options['touurl'];?>"><i class="headericon-header-msg"></i> 投稿</a>
        </li>
        <?php }?>
        <li class="search-item"> <a href="javascript:void(0)"><i class="headericon-header-search"></i> 搜索</a>
          <div class="search-wrap pop-up">
            <div class="searchbar">
              <form action="<?php echo esc_url( home_url( '/' ) ); ?>" class="J_searchForm">
                <input type="text" placeholder="输入关键字" ng-model="keyword" name="s">
                <button class="headericon-header-search search-icon" type="submit"></button>
                <button class="headericon-close close-icon" type="button"></button>
              </form>
            </div>
          </div>
        </li>
        <?php if($options['apps']){?>
        <li class="app-download"> <a href="#"><i class="headericon-header-app"></i> 客户端</a>
          <div class="mobile-wrap pop-up"> <img class="qr" src="<?php if($options['app']){ echo $options['app'];} else{ echo get_bloginfo("template_url").'/static/img/qrcode-app.jpg'; }?>" alt="扫一扫下载">
            <div class="btns"> <span>客户端下载</span> <a href="<?php echo $options['appi'];?>"><i class="headericon-apple"></i> App Store</a> <a href="<?php echo $options['appa'];?>"><i class="headericon-android"></i> Android</a> </div>
          </div>
        </li>
        <?php }?>
        <?php if(!is_user_logged_in()){ if(get_option('users_can_register')==1) $register = 'on'; else $register = 'off'; ?>
        <li class="login-actions" id="login-reg"> <a href="javascript:void(0)" data-sign="0" id="user-login" class="user-login login-link J_login <?php if($register == 'off') echo 'only-login'; ?>"><i class="headericon-header-user"></i> 登录/注册</a> </li>
        <?php }else{
			$current_user = wp_get_current_user();
		?>
        <li class="user-menu"> <a href="<?php echo get_permalink(get_page_id_from_template('page-user.php'));?>" class="head-avatar"> <img src="<?php echo MBT_monkey_get_avatar(get_current_user_id());?>" alt="<?php echo $current_user->display_name;?>"> </a>
          <div class="menu-wrap pop-up"> <a class="brief" href="<?php echo get_permalink(get_page_id_from_template('page-user.php'));?>"> <img src="<?php echo MBT_monkey_get_avatar(get_current_user_id());?>" alt="<?php echo $current_user->display_name;?>"> <span><?php echo $current_user->display_name;?></span> </a>
            <div class="menu">
              <?php $menuParameters = array('theme_location' => 'user',  'container' => false,'echo' => false,'items_wrap' => '%3$s','depth' => 0,); echo strip_tags(wp_nav_menu( $menuParameters ), '<a>' );?>
              <a href="<?php echo wp_logout_url(get_bloginfo('siteurl'));?>" class="J_logout">退出</a> </div>
          </div>
        </li>
        <?php }?>
      </ul>
    </div>
  </div>
</header>
<div class="mobile-nav J_mobileNav">
  <ul>
    <?php echo str_replace("</ul></div>", "", ereg_replace("<div[^>]*><ul[^>]*>", "", wp_nav_menu(array('theme_location' => 'mobile', 'echo' => false)) )); ?>
  </ul>
</div>
<?php if($options['tips']){echo '<div class="sitetips">'.$options['tips'].'</div>';}?>
