카테고리 부분을 바꾸고 싶습니다...

http://www.kcbio.co.kr/shop/list.php?ca_id=20

http://www.kcbio.co.kr/shop/list.php?ca_id=2030

카테고리를 클릭하면 해당 카테고리로 연결 되면서
타이틀 부분엔 해당 카테고리 제목이 나오도록 되 있습니다.

이부분을 찾아보니 shop/list.php 에 $himg 부분이더군여...

해당 카테고리로 들어가서도 분류별로 다른 카테고리명이 나오게 하려면
어떤걸 만지작거려야 될까요..?

이거 왜 하지도 못하는 나한테 시키는건지..ㅠ_ㅠ 살려주세여!!!!!!!!

수시로 들락거리면서 확인후에 바로 포인트 드리겠습니다

에고......
|

댓글 4개

어떤 카테고리로 들어가도 항상
살충제 (1) 살균제 (1) 제초제 (2) 생장조정제 (1)
이런 부분이 나오게 한다는 뜻인가요?

그럼 링크를 확인해보세요
소스를 보지 못하니 어떻게 해결방법을 알려드리지 못하겠네요.
네.. 맞는데 소스릉 보니
<?
include_once("./_common.php");

$sql = " select *
from $g4[yc4_category_table]
where ca_id = '$ca_id'
and ca_use = '1' ";
$ca = sql_fetch($sql);
if (!$ca[ca_id])
alert("등록된 분류가 없습니다.");

$g4[title] = $ca[ca_name] . " 상품리스트";

if ($ca[ca_include_head])
@include_once($ca[ca_include_head]);
else
include_once("./_head.php");

// 스킨을 지정했다면 지정한 스킨을 사용함 (스킨의 다양화)
//if ($skin) $ca[ca_skin] = $skin;

$nav_ca_id = $ca_id;
include "$g4[shop_path]/navigation1.inc.php";



########################################요부분~!!!!!!!!!!!!!!!!!!!!!#####################################
$himg = "$g4[path]/data/category/{$ca_id}_h";
##############################################################################################

if (file_exists($himg)) {
include_once "$g4[shop_path]/listcategory.inc.php";
echo "<img src='$himg' border=0><br>";
}




// 상단 HTML
echo stripslashes($ca[ca_head_html]);

if ($is_admin)
echo "<p align=center><a href='$g4[shop_admin_path]/categoryform.php?w=u&ca_id=$ca_id'><img src='$g4[shop_img_path]/btn_admin_modify.gif' border=0></a></p>";

include_once "$g4[shop_path]/listcategory.inc.php"; <--얘가 카테고리 부분입니다.
?>

<table width=100% cellpadding=0 cellspacing=0>
<tr>
<td><table width="595" height="40" border="0" cellpadding="0" cellspacing="0">
<tr>
<td align="right" valign="top"><img src="img/pro.gif" width="588" height="32" /></td>
</tr>
</table>


카테고리.inc를 보니깐

<?
$str = "";
$exists = false;

$ca_id_len = strlen($ca_id);
$len2 = $ca_id_len + 2;
$len4 = $ca_id_len + 4;

// 차차기 분류의 건수를 얻음
$sql = " select count(*) as cnt from $g4[yc4_category_table]
where ca_id like '$ca_id%'
and length(ca_id) = $len4
and ca_use = '1' ";
$row = sql_fetch($sql);
$cnt = $row['cnt'];
if (!$cnt)
$str .= "<tr><td width=11 background='$g4[shop_img_path]/ca_bg02.gif'></td><td>";

$sql = " select ca_id, ca_name from $g4[yc4_category_table]
where ca_id like '$ca_id%'
and length(ca_id) = $len2
and ca_use = '1'
order by ca_id ";
$result = sql_query($sql);
$str .= "<tr><td width=11 background='$g4[shop_img_path]/ca_bg02.gif'></td>";
$str .= "<td><table width=100% border=0><tr><td>";
while ($row=sql_fetch_array($result)) {

//$row2 = sql_fetch(" select count(*) as cnt from $g4[yc4_category_table] where ca_id like '$row[ca_id]%' ");
$row2 = sql_fetch(" select count(*) as cnt from $g4[yc4_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 .= "<a href='./list.php?ca_id=$row[ca_id]'>$row[ca_name] ($row2[cnt])</a> &nbsp; ";
$exists = true;
}
$str .= "</td></tr></table></td><td width=11 background='$g4[shop_img_path]/ca_bg03.gif'></td>";

if ($exists) {
echo "
<br>
<table width=98% cellpadding=0 cellspacing=0 align=center border=0>
<colgroup width=11>
<colgroup width=''>
<colgroup width=11>
<tr>
<td width=11><img src='$g4[shop_img_path]/ca_box01.gif'></td>
<td background='$g4[shop_img_path]/ca_bg01.gif'></td>
<td width=11><img src='$g4[shop_img_path]/ca_box02.gif'></td>
</tr>
$str
<tr>
<td width=11><img src='$g4[shop_img_path]/ca_box03.gif'></td>
<td background='$g4[shop_img_path]/ca_bg04.gif'></td>
<td width=11><img src='$g4[shop_img_path]/ca_box04.gif'></td>
</tr>
</table><br>";
}
?>

이렇게 되있네요.. 초보라,, 잘은 모르겠고 $len4, $len2 이부분이 의심스러운데
고쳐도 별 변화가 없으니..ㅠ_ㅠ
하루종일 이걸로 삽질하고 있습니다...

힘없는 평민좀 구제 해 주세요~
$sql = " select ca_id, ca_name from $g4[yc4_category_table]
where ca_id like '$ca_id%'
and length(ca_id) = $len2
and ca_use = '1'
order by ca_id ";

$ca_id 는 위에 전달 받은 카테고리 값 입니다. 이 값을 20이 되도록 수정해 보세요

$ca_id = substr($ca_id,0,2); 이런식으로 두자로 만들면 하위 모두 검색이 되겠지요~
감사합니다~^^ 그부분이 의심은 됐는데 어떻게 만질줄을 몰라서 ㅎ
나갈일이 있어서 수정은 못해봤지만,
맞는 거 같애요. 감사합니다~^^
댓글을 작성하시려면 로그인이 필요합니다. 로그인

그누4 질문답변

그누보드4 관련 질문은 QA 로 이전됩니다. QA 그누보드4 바로가기 기존 게시물은 열람만 가능합니다.

+
제목 글쓴이 날짜 조회
16년 전 조회 1,514
16년 전 조회 3,744
16년 전 조회 842
16년 전 조회 1,518
16년 전 조회 1,508
16년 전 조회 3,093
16년 전 조회 1,508
16년 전 조회 1,666
16년 전 조회 1,160
16년 전 조회 1,536
16년 전 조회 3,296
16년 전 조회 1,539
16년 전 조회 1,928
16년 전 조회 1,022
16년 전 조회 1,522
16년 전 조회 1,511
16년 전 조회 953
16년 전 조회 836
16년 전 조회 1,400
16년 전 조회 861
🐛 버그신고