<header class="bg-black header header-md navbar navbar-fixed-top box-shadow">
  <div class="container">
    <div class="navbar-header aside-sm">
      <a class="btn btn-link visible-xs" data-toggle="class:nav-off-screen" data-target="#nav">
        <i class="icon-list"></i>
      </a>
      <a href="/{$languageURL}" class="navbar-brand" title="{$domain}">
        <img src="/mbthemes/images/logo/logo.png" class="logo_c m-r-sm" alt="">
        <img src="/mbthemes/images/logo/logo_w.png" class="logo_w m-r-sm" alt="">
      </a>
      <a class="btn btn-link visible-xs" data-toggle="dropdown" data-target=".user">
        <i class="icon-user"></i>
      </a>
    </div>
    <ul class="nav navbar-nav hidden-xs">
      <li class="myDropi hidden-sm">
        <a href="#" class="dropdown-toggle hover" data-toggle="dropdown" aria-expanded="true">
          <i class="icon-grid hover-rotate"></i>
        </a>
      </li>
      <li class="myDropi dropdown hidden-sm">
        <a href="#" class="hover">
          <i class="icon-wallet hover-rotate"></i>
        </a>
      </li>
      <li class="myDropi dropdown visible-lg">
        <a href="#" class="dropdown-toggle hover" data-toggle="class:opens" data-target="#changeskins">
          <i class="icon-settings hover-rotate"></i>
        </a>
      </li>
      <div class="nav-v-line hidden-sm"></div>



      {if $mainCategories}
      {foreach from=$mainCategories item=c}
      <li class="myDrop myDropc">
        <a href="/{$languageURL}categories/{$c.id}" class="navbg">{$c.name}</a>
        {if isset($allCats[$c.id])}
        <ul class="dropdown-menu">
          <li><a href="/{$languageURL}categories/{$c.id}?sort_by=sales_count&order=desc" class="hover-info">热门作品</a></li>
          {foreach from=$allCats[$c.id] item=s}
          <li><a href="/{$languageURL}categories/{$s.id}" class="hover-info">{$s.name}</a></li>
          {/foreach}
        </ul>
        {/if}
      </li>
      {/foreach}
      {/if}
    </ul>
    <ul class="nav navbar-nav navbar-right m-n hidden-xs nav-user user">
      {if check_login_bool()}
      <li class="myDrop">
        {if $smarty.session.user.quiz == 'true'}
        <a href="/{$languageURL}author_dashboard/">
        {else}
        <a href="/{$languageURL}user/{$smarty.session.user.username}">
        {/if}
          <span class="thumb-sm avatar pull-left">
            {if $smarty.session.user.avatar != ''}
            <img alt="{$user.username}" src="{$data_server}uploads/users/{$smarty.session.user.user_id}/A_{$smarty.session.user.avatar}" />
            {else}
            <img alt="{$smarty.session.user.username}" src="{$template_data}img/default-user.jpg" />
            {/if}
          </span>
          <span class="hidden-md hidden-sm">{$smarty.session.user.username} <b class="caret"></b></span>
        </a>

        <section class="dropdown-menu no-padder popover-shadow aside-xl bg-white on">
          <div class="arrow top" style="left: 82%;top:-8px;"></div>
          <div class="row">
            <div class="col-xs-12 pos-rlt">
              <div class="clear wrapper-md userinfo-bg">
                <span class="thumb-slg avatar pull-left">
                  {if $smarty.session.user.avatar != ''}
                  <img class="b-2x b-light b-style" alt="{$user.username}" src="{$data_server}uploads/users/{$smarty.session.user.user_id}/A_{$smarty.session.user.avatar}" />
                  {else}
                  <img class="b-2x b-light b-style" alt="{$smarty.session.user.username}" src="{$template_data}img/default-user.jpg" />
                  {/if}
                </span>
                <span class="clear">
                  <span class="h3 block text-left m-t-xs m-b-xs">
                    {if $smarty.session.user.quiz == 'true'}
                    <a href="/{$languageURL}author_dashboard/" class="text-white">
                      {else}
                      <a href="/{$languageURL}user/{$smarty.session.user.username}" class="text-white">
                        {/if}
                      {$smarty.session.user.username}
                    </a>
                  </span>
                  <small class="text-gray text-left csshidden">
                    {if $smarty.session.user.profile_title != ''}{$smarty.session.user.profile_title}{else}您太懒了，未填写签名哦{/if}
                  </small>
                  <p>
                  </p>
                </span>
              </div>
              <form action="/{$languageURL}users/logout/" method="post" class="pos-abt" style="left:140px; bottom:20px;">
                <button type="submit" class="btn btn-default btn-rounded btn-sm no-border" id="sign-out-button">
                  <i class="icon-power hover-rotate m-r-xs"></i> 退出登录
                </button>
              </form>
              {if $smarty.session.user.access}
              <a href="/{$languageURL}admin/" class="pos-abt btn btn-default btn-rounded btn-sm no-border" style="left:250px; bottom:20px;"><i class="i i-gauge m-r-sm text-imuted"></i>管理面板</a>
              {/if}
            </div>
          </div>
          <div class="row">
            <div class="col-xs-12 b-b pos-rlt">
              <div class="clear hover bg-light text-center">
                <p class="block m-t-sm m-b-sm text-lg">
                  <small>我的余额：{$currency.symbol}</small>{$smarty.session.user.total|string_format:"%.2f"}
                </p>
              </div>
            </div>
          </div>
          <div class="row m-l-none m-r-none text-center">
            <div class="col-xs-4 b-r b-b">
              <div class="padder-v">
                <a href="/{$languageURL}download/" target="_blank">
                  <span class="m-b-xs block">
                    <i class="icon-inbox i-2x text-success-lt"></i>
                  </span>
                  <small class="text-muted">
                    我的下载
                  </small>
                </a>
              </div>
            </div>
            <div class="col-xs-4 b-r b-b">
              <div class="padder-v">
                <a href="/{$languageURL}user/bookmarks/">
                  <span class="m-b-xs block">
                    <i class="icon-heart i-2x text-muted"></i>
                  </span>
                  <small class="text-muted">
                    书签
                  </small>
                </a>
              </div>
            </div>
            <div class="col-xs-4 b-b">
              <div class="padder-v">
                {if $smarty.session.user.quiz == 'true'}
                <a href="/{$languageURL}author_dashboard/" target="_blank">
                  <span class="m-b-xs block">
                    <i class="icon-cloud-upload i-2x text-muted"></i>
                  </span>
                  <small class="text-muted">
                    发布作品
                  </small>
                </a>
                {else}
                <a href="/{$languageURL}author_dashboard/">
                  <span class="m-b-xs block">
                    <i class="icon-user-following i-2x text-primary-lt"></i>
                  </span>
                  <small class="text-muted">
                    成为作者
                  </small>
                </a>
                {/if}
              </div>
            </div>



            <div class="col-xs-4 b-r">
              <div class="padder-v">
                <a href="#">
                  <span class="m-b-xs block">
                    <i class="icon-share-alt i-2x text-muted"></i>
                  </span>
                  <small class="text-muted">
                    推广赚钱
                  </small>
                </a>
              </div>
            </div>
            <div class="col-xs-4 b-r">
              <div class="padder-v">
                <a href="/{$languageURL}deposit/" target="_blank">
                  <span class="m-b-xs block">
                    <i class="icon-server i-2x text-danger-lt"></i>
                  </span>
                  <small class="text-muted">
                    充值
                  </small>
                </a>
              </div>
            </div>
            <div class="col-xs-4">
              <div class="padder-v">
                <a href="/{$languageURL}edit/">
                  <span class="m-b-xs block">
                    <i class="icon-wrench i-2x text-muted"></i>
                  </span>
                  <small class="text-muted">
                    设置
                  </small>
                </a>
              </div>
            </div>
          </div>
        </section>
      </li>
      {else}
      <li class="dropdown">
        <a href="#" class="dropdown-toggle" data-toggle="dropdown">
          <span class="thumb-sm avatar pull-left">
            <img alt="{$smarty.session.user.username}" src="{$template_data}img/default-user.jpg" />
          </span>
          登录 <i class="i i-arrow-down4"></i>
        </a>
        <ul class="dropdown-menu animated fadeInRight">
          <li><span class="arrow top"></span><a href="/{$languageURL}sign_up/"><span>创建账号</span></a></li>
          <li><a href="/{$languageURL}sign_in/" rel="nofollow">登录</a></li>
        </ul>
      </li>
      {/if}
    </ul>

    <form id="search" action="/{$languageURL}search/" method="GET" class="navbar-form navbar-right input-s-lg m-t m-r-lg visible-lg-block" role="search">
      <div class="form-group w-full">
        <div class="input-group w-full">
          <input type="text" class="form-control input-sm bg-black lter no-border" name="term" value="在所有作品中搜索" onfocus="this.value=='在所有作品中搜索'?this.value='':false;" onblur="this.value==''?this.value='在所有作品中搜索':false;" />
          <span class="input-group-btn">
            <button type="submit" class="btn lter btn-icon btn-sm btn-search"><i class="icon-magnifier" style="font-size:14px;"></i></button>
          </span>
        </div>
      </div>
    </form>


  </div>
</header>