분류 탭 메뉴가 사라지는, 없어지는 문제 채택완료
< 문제점 >
**************

하위 카테고리(분류메뉴?)를 누르면 자체가 사라지는(없어지는) 문제.
구글링도 많이 해보고 이거저거 수정해봐도 해결이 안돼서 도움을 구합니다..
다른 테마를 써도 그렇습니다. 써본 테마 buzinga, bread 둘 다 똑같은 문제를 겪는 중입니다.***********
< 알아본 내용, 시도한 내용 >
① https://sir.kr/qa/291956 category.skin.php 파일이 없어서 listcategory.skin.php에다가 수정해보았었음.


/* 상품 목록 카테고리 목록 */
.sct_ct {text-align:center;width:100%;border-bottom:1px solid #e9e9e9; margin-bottom:35px; margin-top:35px}
.sct_ct h2 {position:absolute;font-size:0;text-indent:-9999em;line-height:0;overflow:hidden}
.sct_ct ul {list-style:none;display:inline-block;margin:0;padding:0px 0; }
.sct_ct ul:after {display:block;visibility:hidden;clear:both;content:""}
.sct_ct ul li {display:inline-block;background:url(img/sbmn_bg.gif) no-repeat left 50%; width:60px; height:20px;letter-spacing:0em;font-size:1.2em;font-weight:bold}
.sct_ct ul li:first-child{background:none}
.sct_ct a {text-decoration:none;color:#;}
.sct_ct a:hover {text-decoration:none;color:#F00;}
.sct_ct_parent {font-weight:bold}
.sct_ct_here {background:#0066CC; width:60px; height:30px; color:#ff3600 !important}
#sct_ct_1 li {float:left;margin:0 10px 10px 0;width:120px}
#sct_ct_2 li {margin:0 0 10px}
#sct_ct_2 a {display:inline-block;width:120px}
#sct_ct_3 li {float:left;margin:0 15px 15px 0;width:120px}s
/* 상품 정렬 리스트 스타일 선택 공통 */
#sct_sortlst {zoom:1}
#sct_sortlst:after {display:block;visibility:hidden;clear:both;content:""}
위치를 확신하지 못해서 하나하나 다 넣어봤음 근데 안됐음.
C:\Users\NCF01\Desktop\buzinga\skin\shop\basic/style.css가 경로가 확실한 듯 했지만 역시나 .
┌ ③ https://gnustudy.com/bbs/board.php?bo_table=yc_tip&wr_id=103
3. 분류 탭 메뉴

분류 탭 스킨 파일 : skin/shop/basic/listcategory.skin.php
페이지상에서 출력 코드 :
$cate_skin = $skin_dir.'/listcategory.skin.php';
if(!is_file($cate_skin))
$cate_skin = G5_SHOP_SKIN_PATH.'/listcategory.skin.php';
include $cate_skin;
skin/shop/basic/listcategory.skin.php 경로에 아까 첫링크의 소스를 넣었었지만 역시 실패..
도움 주시면 감사하겠습니다.
답변 4개
https://demo.sir.kr/gnuboard5/shop/list.php?ca_id=20101010
영카트 데모도 하위분류 마지막에 도달하면 사라지는데요 이거 계속 나오게 하려면
listcategory.skin.php 상단에
쿼리문 중에 length(ca_id) 길이 체크하는 부분있을건데 이거 만져보면서 수정하면 될듯싶네용
아니면 listcategory.skin.php 이거 2 , 3 번도 있을건데 스킨 이름을 바꿔보는것도 좋을듯 싶어요
답변에 대한 댓글 1개
댓글을 작성하려면 로그인이 필요합니다.
</b></p>
<p>echo $sql = " select ca_id, ca_name from {$g5['g5_shop_category_table']} where ca_id like '$ca_id%' and length(ca_id) = $len2 and ca_use = '1' order by ca_order, ca_id ";</p>
<p><strong>
제가 아예 코딩을 볼줄도 할 줄도 몰라서 ㅜ echo $sql; 하라는 말이 뭔지 몰라서 검색해보니까
"$sql= "select * from 테이블명";
이런 쿼리문이 있으면....
echo "$sql";
하면 찍힙니다." 래서
$sql= 앞에 echo 붙이는건 알았는데
분류가 있을때 없을때를 비교해보라는게 어떻게 해야하는지 모르겠고
또 비교쿼리문을 작성해냈다 하더라도 볼 줄을 모르기에 ... ^^;
도와주시는데 통 이해를 못해서 죄송합니다...
답변에 대한 댓글 1개
$result = sql_query($sql); 요기 다음줄에 넣고 하시면 될듯합니다
echo $sql; 이걸 넣으면 위 select * ~~~~ 이 쿼리문이 상단에 텍스트로 노출이 되실건데
분류명 단계별로 눌러서 나오는 ca_id 에대한 값, 길이 등을 비교해보시라는 의미로 해보시란거였습니다 ^^
댓글을 작성하려면 로그인이 필요합니다.
답변에 대한 댓글 1개
이부분 echo $sql; 하셔서 분류있을때 없을때 쿼리문 비교해보세용 댓글남겨주시거나
댓글을 작성하려면 로그인이 필요합니다.
소스보시면
홈페이지 주소 링크뒤에
https://demo.sir.kr/gnuboard5/shop/list.php?ca_id=20101010" rel="nofollow noreferrer noopener" target="_blank">list.php?ca_id=20101010 ca_id 값이 따라오실거에요
이값으로
$ca_id_len = strlen($ca_id);
길이 구하고 여기에
$len2 = $ca_id_len + 2;
$len4 = $ca_id_len + 4;
2, 4 씩 더해서
$len2, $len4 이렇게 길이를 만들잖아요?
그럼 쿼리문 보시면
ca_id like '$ca_id%' # 주소창에 따라온 ca_id로 시작하는 거 찾고
and length(ca_id) = $len2 # ca_id 라는 필드에서 ca_id길이가 $len2 와 같은 걸 찾고요
and ca_use = '1' # 분류 사용중인것
and length(ca_id) = $len2 이부분을 빼거나
ca_id like '$ca_id%' 이부분을 현재 분류값에 윗단계 분류명으로 수정하시거나 하면 될듯한데요..
Ex) ca_id 가 https://demo.sir.kr/gnuboard5/shop/list.php?ca_id=20101010" rel="nofollow noreferrer noopener" target="_blank">20101010 인경우 https://demo.sir.kr/gnuboard5/shop/list.php?ca_id=20101010" rel="nofollow noreferrer noopener" target="_blank">201010 뒷자리 좀 잘라서 검색되게요
스킨변경은 오타로 안되시는거 아닌지요?
listcategory2.skinn.php
댓글을 작성하려면 로그인이 필요합니다.
답변을 작성하려면 로그인이 필요합니다.
로그인
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
$str = '';
$exists = false;
$ca_id_len = strlen($ca_id);
$len2 = $ca_id_len + 2;
$len4 = $ca_id_len + 4;
$sql = " select ca_id, ca_name from {$g5['g5_shop_category_table']} where ca_id like '$ca_id%' and length(ca_id) = $len2 and ca_use = '1' order by ca_order, ca_id ";
$result = sql_query($sql);
while ($row=sql_fetch_array($result)) {
$row2 = sql_fetch(" select count(*) as cnt from {$g5['g5_shop_item_table']} where (ca_id like '{$row['ca_id']}%' or ca_id2 like '{$row['ca_id']}%' or ca_id3 like '{$row['ca_id']}%') and it_use = '1' ");
$str .= '<li><a href="'.shop_category_url($row['ca_id']).'">'.$row['ca_name'].' <span class="prd_cnt">'.$row2['cnt'].'</span></a></li>';
$exists = true;
}
if ($exists) {
// add_stylesheet('css 구문', 출력순서); 숫자가 작을 수록 먼저 출력됨
add_stylesheet('<link rel="stylesheet" href="'.G5_SHOP_CSS_URL.'/style.css">', 0);
?>
<!-- 상품분류 1 시작 { -->
<aside id="sct_ct_1" class="sct_ct">
<h2>현재 상품 분류와 관련된 분류</h2>
<ul>
<?php echo $str; ?>
</ul>
</aside>
<!-- } 상품분류 1 끝 -->
<?php } ?>
--------------------------------------------------------------------------------------------------
C:\Users\NCF01\Desktop\buzinga\mobile\skin\shop\basic/listcategory.skin.php
위에 보이는 length(ca_id) 부분에 숫자만 변경해봤는데 카테고리가 아예 사라졌습니다.
도무지 어떻게 수정해야할지 감이 안와서 더 자세히 설명 부탁드립니다.
그리고 listcategory.skin.php 이거 2 , 3 번 스킨 이름 바꿔보라시길래 무슨 말씀인지 잘 몰라서
listcategory2.skinn.php , listcategory3.skinnn.php 식으로 파일명을 바꿔 봤었는데 아무 변화없길래 되돌려놨습니다
답변 주시면 감사하겠습니다ㅠㅠ