<?php

/*
=====================================================================

  프로젝트 이름 : 피리 카페 For 그누보드5.5 순정

  만든사람 : 피리 PIREE ( tosports@naver.com )

  홈페이지 : https://piree.kr/nett_dev

  작성날짜 : 2024년 05월 03일 금요일 오전 0시 00분 / 맑음, 13.9, 일교차 주의, 25, 9, 0%, 0%, 0.9ms / 보통, 43, 21

  저 작 권 : Copyright ⓒ 2024 피리 piree.kr All right reserved
              그누보드 외에 추가된 소스는~
              만든사람의 허락없이 무단으로 사용할수 없습니다.
              사용하고자 할 경우 만든사람의 허락을 받아야 합니다.
              http://www.piree.kr 에 문의해 주세요.

=====================================================================
 피리 카페 For 그누보드5.5 순정 > 프로그램 > 피리 카페 관리 > 내 카페 > 스킨 > LAYOUT > 모바일 > HEAD > SKIN
=====================================================================

*/

  IF ( !defined('_GNUBOARD_') )                             EXIT;

  include_once(G5_LIB_PATH.'/outlogin.lib.php');

?>

<header id="hd">
    <h1 id="hd_h1"><?php echo $g5['title'] ?></h1>

    <div class="to_content"><a href="#container">본문 바로가기</a></div>

    <?php
    if(defined('_INDEX_')) {// index에서만 실행
        include G5_MOBILE_PATH.'/newwin.inc.php';// 팝업레이어
    } ?>

    <div id="hd_wrapper">

        <div id="logo">
            <a href="<?php echo G5_URL ?>"><img src="<?php echo G5_IMG_URL ?>/m_logo.png" alt="<?php echo $config['cf_title']; ?>"></a>
        </div>

        <button type="button" id="gnb_open" class="hd_opener"><i class="fa fa-bars" aria-hidden="true"></i><span class="sound_only"> 메뉴열기</span></button>

        <div id="gnb" class="hd_div">
            <button type="button" id="gnb_close" class="hd_closer"><span class="sound_only">메뉴 닫기</span><i class="fa fa-times" aria-hidden="true"></i></button>
			<?php echo outlogin('theme/basic');// 외부 로그인 ?>
            <ul id="gnb_1dul">

<?php

/*

	@@ PIREE_SOSS

	* 피리 PIREE
	* 2023년 01월 29일 일요일 오후 13시 09분 - 날씨 흐림, 0.5, 3, -7, 30%, 5.5ms, 16% / 양호, 39, 12
	* 편리하게 로그인 할수 있는 코드 추가
	* 
*/

?>
                <li class="gnb_1dli">
                  <a href="<?php echo G5_BBS_URL ?>/login_check.php?user_div=admin&url=<?php echo $urlencode; ?>" class="gnb_1da str_ff3333_bold_12">♥♥ 관리자로 로그인</a>
                </li>
                <li class="gnb_1dli">
                  <a href="<?php echo G5_BBS_URL ?>/login_check.php?user_div=member&url=<?php echo $urlencode; ?>" class="gnb_1da str_ff3333_bold_12">♥♥ 일반회원으로 로그인</a>
                </li>

<?php

/*

	@@ PIREE_SOSS

	* 피리 PIREE
	* 2024년 05월 04일 토요일 오후 09시 29분 / 맑음, 18.2, 일교차 주의, 27, 11, 8%, 0%, 2.1ms / 상당히 나쁨, 65, 43, 0.014
	* 카페 관련 메뉴
*/

              IF ( piree_cafe_auth_get() )
              {
?>
                <li class="gnb_1dli">
                    <a href="<?php echo PIREE_CAFE_MANAGE_URL .'?piree_cafe_n='. $piree_cafe_n; ?>" class="gnb_1da str_222_11">★ 카페 관리</a>
                </li>
<?php
              }

            IF ( $board_cate_all_t > 0 )
            {

              $ok_style_a = array();
              $ok_style_a[0] = 'str_3334dd_bold_11';
              $ok_style_a[1] = 'str_4466ff_bold_11';
              $ok_style_a[2] = 'str_4466ff_11';

              $no_style_a = array();
              $no_style_a[0] = 'str_222_bold_10';
              $no_style_a[1] = 'str_333_10';
              $no_style_a[2] = 'str_555_9';

              $left_image_a = array();
              $left_image_a[0] = piree__url($piree_prog_a[770100]['num'], '/images/trans_1_1.gif');
              $left_image_a[1] = piree__url($piree_prog_a[770100]['num'], '/images/trans_1_1.gif');
              $left_image_a[2] = piree__url($piree_prog_a[770100]['num'], '/images/icon_reply.gif');

              $left_padd_a = array();
              $left_padd_a[0] = 1;
              $left_padd_a[1] = 1;
              $left_padd_a[2] = 30;

              FOREACH ( $board_cate_list_a AS $key=>$val )
              {

                IF ( $board_cate_n == $val['bca_cate_n'] && !$page_code_c )
                {
                  $loop_style_c  = $ok_style_a[$val['bca_depth_n']];
                  $loop_choice_s = G5_IMG_URL .'/btn_next.gif';
                  $loop_choice_s = G5_IMG_URL .'/require.png';
                }
                ELSE
                {
                  $loop_style_c  = $no_style_a[$val['bca_depth_n']];
                  $loop_choice_s = piree__url($piree_prog_a[770100]['num'], '/images/trans_1_1.gif');
                }

?>
                <li class="gnb_1dli">
                  <a href="<?php echo go_piree_cafe_board('', $piree_cafe_n, $val['bca_cate_n']); ?>" class="gnb_1da <?php echo $loop_style_c; ?>">
                    <?php  IF ( $val['bca_depth_n'] > 0 ) { ?><img src="<?php echo piree__url($piree_prog_a[770100]['num'], '/images/trans_1_1.gif'); ?>" width="<?php echo $left_padd_a[$val['bca_depth_n']]; ?>"><?php }  ?>
                    <img src="<?php echo $left_image_a[$val['bca_depth_n']]; ?>">
                    <img src="<?php echo $loop_choice_s; ?>">
                    <?php echo $val['bca_cate_s']; ?>
                    <span class="font_777" style="float:right; margin-right:20px;"><?php  IF ( $val['bca_count_write'] > 0 ) { echo number_format($val['bca_count_write']); }  ?></span>
                  </a>
                </li>
<?php
              }

            }

                $loop_style_a = array();
                $loop_style_a['member.list.view'] = 'str_555_9';
                $loop_style_a['member.join.form'] = 'str_555_9';
                $loop_style_a['member.withdraw']  = 'str_555_9';
                $loop_style_a['cafe.make.form']   = 'str_555_9';

                $loop_choice_a = array();
                $loop_choice_a['member.list.view'] = piree__url($piree_prog_a[770100]['num'], '/images/trans_1_1.gif');
                $loop_choice_a['member.join.form'] = piree__url($piree_prog_a[770100]['num'], '/images/trans_1_1.gif');
                $loop_choice_a['member.withdraw']  = piree__url($piree_prog_a[770100]['num'], '/images/trans_1_1.gif');
                $loop_choice_a['cafe.make.form']   = piree__url($piree_prog_a[770100]['num'], '/images/trans_1_1.gif');

                SWITCH ( $page_code_c )
                {

                  CASE 'member.list.view' :
                    $loop_style_a['member.list.view']  = 'str_4466ff_bold_11';
                    $loop_choice_a['member.list.view'] = G5_IMG_URL .'/require.png';
                  BREAK;

                  CASE 'member.join.form' :
                    $loop_style_a['member.join.form']  = 'str_4466ff_bold_11';
                    $loop_choice_a['member.join.form'] = G5_IMG_URL .'/require.png';
                  BREAK;

                  CASE 'member.withdraw' :
                    $loop_style_a['member.withdraw']  = 'str_4466ff_bold_11';
                    $loop_choice_a['member.withdraw'] = G5_IMG_URL .'/require.png';
                  BREAK;

                }

?>
                <li class="gnb_1dli">
                  <a href="<?php echo piree__url($piree_prog_a[770100]['num'], 'member.list.php') .'?piree_cafe_n='. $piree_cafe_n; ?>" class="gnb_1da <?php echo $loop_style_a['member.list.view']; ?>">
                    <img src="<?php echo $loop_choice_a['member.list.view']; ?>">
                    회원 목록
                    <span class="font_777" style="float:right;"><?php  IF ( $piree_cafe_a['cafe_member_t'] > 0 ) { echo number_format($piree_cafe_a['cafe_member_t']); }  ?> 명</span>
                  </a>
                </li>

                <li class="gnb_1dli">
<?php

                IF ( $cafe_member_a['member_n'] > 0 && $cafe_member_a['mem_id'] )
                {
?>
                  <a href="<?php echo piree__url($piree_prog_a[770100]['num'], 'member.info.view.php') .'?piree_cafe_n='. $piree_cafe_n; ?>" class="gnb_1da <?php echo $loop_style_a['member.join.form']; ?>">
                    <img src="<?php echo $loop_choice_a['member.join.form']; ?>">
                    회원 정보 보기
                  </a>
<?php
                }
                ELSE
                {
?>
                  <a href="<?php echo piree__url($piree_prog_a[770100]['num'], 'member.join.form.php') .'?piree_cafe_n='. $piree_cafe_n; ?>" class="gnb_1da <?php echo $loop_style_a['member.join.form']; ?>">
                    <img src="<?php echo $loop_choice_a['member.join.form']; ?>">
                    회원 가입
                  </a>
<?php
                }

?>
                </li>

                <li class="gnb_1dli">
                  <a href="<?php echo piree__url($piree_prog_a[770100]['num'], 'member.withdraw.form.php') .'?piree_cafe_n='. $piree_cafe_n; ?>" class="gnb_1da <?php echo $loop_style_a['member.withdraw']; ?>">
                   <img src="<?php echo $loop_choice_a['member.withdraw']; ?>">
                    회원 탈퇴
                  </a>
                </li>

                <li class="gnb_1dli">
                  <a href="<?php echo piree__url($piree_prog_a[770100]['num'], 'section.cafe.make.php'); ?>" class="gnb_1da <?php echo $loop_style_a['cafe.make.form']; ?>">
                    <img src="<?php echo $loop_choice_a['cafe.make.form']; ?>">
                    ★ 카페 만들기
                  </a>
                </li>

<?php

?>

            <?php if (defined('G5_USE_SHOP') && G5_USE_SHOP) { ?>
                <li class="gnb_1dli"><a href="<?php echo G5_SHOP_URL ?>" class="gnb_1da"> 쇼핑몰</a></li>
            <?php } ?>
            </ul>

            <ul id="hd_nb">
            	<li class="hd_nb1"><a href="<?php echo G5_BBS_URL ?>/faq.php" id="snb_faq"><i class="fa fa-question" aria-hidden="true"></i>FAQ</a></li>
                <li class="hd_nb2"><a href="<?php echo G5_BBS_URL ?>/qalist.php" id="snb_qa"><i class="fa fa-comments" aria-hidden="true"></i>1:1문의</a></li>
                <li class="hd_nb4"><a href="<?php echo G5_BBS_URL ?>/new.php" id="snb_new"><i class="fa fa-history" aria-hidden="true"></i>새글</a></li>   
            </ul>
        </div>

        <button type="button" id="user_btn" class="hd_opener"><i class="fa fa-search" aria-hidden="true"></i><span class="sound_only">사용자메뉴</span></button>
        <div class="hd_div" id="user_menu">
            <button type="button" id="user_close" class="hd_closer"><span class="sound_only">메뉴 닫기</span><i class="fa fa-times" aria-hidden="true"></i></button>
            <div id="hd_sch">
                <h2>사이트 내 전체검색</h2>
                <form name="fsearchbox" action="<?php echo G5_BBS_URL ?>/search.php" onsubmit="return fsearchbox_submit(this);" method="get">
                <input type="hidden" name="sfl" value="wr_subject||wr_content">
                <input type="hidden" name="sop" value="and">
                <input type="text" name="stx" id="sch_stx" placeholder="검색어를 입력해주세요" required maxlength="20">
                <button type="submit" value="검색" id="sch_submit"><i class="fa fa-search" aria-hidden="true"></i><span class="sound_only">검색</span></button>
                </form>

                <script>
                function fsearchbox_submit(f)
                {
                    var stx = f.stx.value.trim();
                    if (stx.length < 2) {
                        alert("검색어는 두글자 이상 입력하십시오.");
                        f.stx.select();
                        f.stx.focus();
                        return false;
                    }

                    var cnt = 0;
                    for (var i = 0; i < stx.length; i++) {
                        if (stx.charAt(i) == ' ')
                            cnt++;
                    }

                    if (cnt > 1) {
                        alert("빠른 검색을 위하여 검색어에 공백은 한개만 입력할 수 있습니다.");
                        f.stx.select();
                        f.stx.focus();
                        return false;
                    }
                    f.stx.value = stx;

                    return true;
                }
                </script>
            </div>
            <div id="text_size">
            <!-- font_resize('엘리먼트id', '제거할 class', '추가할 class'); -->
                <button id="size_down" onclick="font_resize('container', 'ts_up ts_up2', '', this);" class="select"><img src="<?php echo G5_URL; ?>/img/ts01.png" width="20" alt="기본"></button>
                <button id="size_def" onclick="font_resize('container', 'ts_up ts_up2', 'ts_up', this);"><img src="<?php echo G5_URL; ?>/img/ts02.png" width="20" alt="크게"></button>
                <button id="size_up" onclick="font_resize('container', 'ts_up ts_up2', 'ts_up2', this);"><img src="<?php echo G5_URL; ?>/img/ts03.png" width="20" alt="더크게"></button>
            </div>
        </div>

        <script>
        $(function () {
            var font_resize_class = get_cookie("ck_font_resize_add_class");
            if( font_resize_class == 'ts_up' ){
                $("#text_size button").removeClass("select");
                $("#size_def").addClass("select");
            } else if (font_resize_class == 'ts_up2') {
                $("#text_size button").removeClass("select");
                $("#size_up").addClass("select");
            }

            $(".hd_opener").on("click", function() {
                var $this = $(this);
                var $hd_layer = $this.next(".hd_div");

                if($hd_layer.is(":visible")) {
                    $hd_layer.hide();
                    $this.find("span").text("열기");
                } else {
                    var $hd_layer2 = $(".hd_div:visible");
                    $hd_layer2.prev(".hd_opener").find("span").text("열기");
                    $hd_layer2.hide();

                    $hd_layer.show();
                    $this.find("span").text("닫기");
                }
            });

            $("#container").on("click", function() {
                $(".hd_div").hide();

            });

            $(".btn_gnb_op").click(function(){
                $(this).toggleClass("btn_gnb_cl").next(".gnb_2dul").slideToggle(300);
                
            });

            $(".hd_closer").on("click", function() {
                var idx = $(".hd_closer").index($(this));
                $(".hd_div:visible").hide();
                $(".hd_opener:eq("+idx+")").find("span").text("열기");
            });
        });
        </script>
        
    </div>
</header>

<div id="wrapper">

    <div id="container">
    <?php if (!defined("_INDEX_")) { ?>
    	<h2 id="container_title" class="top" title="<?php echo get_text($g5['title']); ?>">
    		<a href="<?php echo cafe_index_go($piree_cafe_n, $piree_cafe_code_c, 1); ?>" class="str_3334dd_bold_15"><i class="fa fa-chevron-left" aria-hidden="true"></i><span class="sound_only">$piree_cafe_name_s</span> <?php echo get_head_title($piree_cafe_name_s); ?></a> 
    		<span class="font_999">카페</span>
    	</h2>
    <?php } ?>

<?php

  IF ( PIREE_IS_DEMO_N == 1 )
  {
?>
    <div class="cl_bo line_h_2_4" style="margin:10px; border:3px solid #ff9966; padding:10px;">
      <p>
        <a href="http://piree.cc/0RWj" class="str_ff4444_13" target="_blank">[ 피리 카페 ] 정보 보기 & 구입하기! 여기를 터치.클릭 하세요.</a>
      </p>
    </div>
<?php
  }

?>

<?php

   IF ( $page_code_c == 'index' || $page_code_c == 'member_info_view' )
   {
?>
    	<div id="cafe_top_area" style="padding:20px 10px 10px 10px; background:#fff; overflow:hidden;">
<?php

    //
    // 시작 => 프로필_이미지__있으면
    	IF ( $piree_cafe_profile_image_url )
    	{
?>
    	  <div id="cafe_profile_image">
    	    <a href="<?php echo cafe_index_go($piree_cafe_n, $piree_cafe_code_c, 1); ?>"><img src="<?php echo $piree_cafe_profile_image_url; ?>" width="<?php echo $piree_prog_a[$piree_prog_a[770100]['num']]['profile_image_width_n']; ?>" height="<?php echo $piree_prog_a[$piree_prog_a[770100]['num']]['profile_image_height_n']; ?>"></a>
    	  </div>
<?php

    	}
    // 끝 => 프로필_이미지__있으면
    //

?>

    	  <div id="cafe_profile_box">

    	    <div id="cafe_profile_line1">
    	      <div id="cafe_owner_nick">
    	        <a href="<?php echo cafe_index_go(0, $piree_cafe_code_c, 1); ?>" class="str_222_bold_11"><?php echo $piree_cafe_a['cafe_mem_nick']; ?></a>
    	      </div>

    	      <div id="cafe_owner_domain">
    	        <a href="<?php echo cafe_index_go(0, $piree_cafe_code_c, 1); ?>" class="str_3334dd_bold_10"><?php echo get_piree_cafe_domain($piree_cafe_code_c); ?></a>
    	      </div>
    	    </div>

    	    <div id="cafe_profile_line2">
    	      <div id="cafe_owner_join">
<?php

    //
    // 시작 => 회원__이면
    	      IF ( $cafe_member_a['member_n'] > 0 && $cafe_member_a['mem_id'] )
    	      {
?>
    	        <a href="<?php echo piree__url($piree_prog_a[770100]['num'], 'member.info.view.php') .'?piree_cafe_n='. $piree_cafe_n; ?>" class="font_777_10">회원정보</a>
<?php
    	      }
    	      ELSE
    	      {
?>
    	        <a href="<?php echo piree__url($piree_prog_a[770100]['num'], 'member.join.form.php') .'?piree_cafe_n='. $piree_cafe_n; ?>" class="font_777_10">회원가입</a>
<?php
    	      }
    // 끝 => 회원__이면
    //

?>
    	      </div>
    	      <div id="cafe_owner_letter">
    	        <a href="<?php echo get_piree_cafe_page('member.face.php', 'cafe_mem_n='. $piree_cafe_a['cafe_mem_n']); ?>" class="font_777_10">쪽지</a>
    	      </div>
<?php

    //
    // 시작 => 카페_주인__이면
    	    IF ($piree_cafe_a['cafe_mem_id'] == $member['mb_id'] )
    	    {
?>
    	      <div class="cafe_owner_manage">
    	        <a href="<?php echo PIREE_CAFE_MANAGE_URL .'?piree_cafe_n='. $piree_cafe_n; ?>" class="str_37b44a_10">[관리]</a>
    	      </div>
<?php
    	    }
    // 끝 => 카페_주인__이면
    //

?>
    	    </div>

    	    <div id="cafe_profile_box_menu">
    	    </div>

    	    <div id="cafe_profile_intro">
    	      <span class="str_999"><?php echo stripslashes(nl2br($piree_cafe_a['cafe_intro_s'])); ?></span>
    	    </div>

    	  </div>

    	</div>
<?php
   }

?>
