테스트 사이트 - 개발 중인 베타 버전입니다

영카트5 카테고리 출력 부분 채택완료

history 7년 전 조회 3,411

영카트5  이윰빌더 시즌3 사용중인데요

 

카테고리 출력 부분에 KAPPA123 이라고 출력이 나와서 중간에 - 이걸 넣고싶은데

소스를 보니 네비게이션을 전체로 끌어와있는것 같더라구요. 방법이 없을까요?

 

{shop->get_navigation()} 이부분이 카테고리 경로 끌어오는 부분인데... 저중간 중간에 - 이표시를 어떻게 넣어야할까요...

이미지상 보이는 부분은 KAPPA234 로보이는데 실제 해당 분류는 KAPPA-2-3-4 경로 입니다.

 

 

</p>

<p><div class="clearfix">

        <div class="headline">

            <h5><strong><i class="fa fa-ellipsis-v"></i> <span>카테고리 -</span> {shop->get_navigation()}</strong></h5>

            <!--{? _is_admin}--><a href="{C.G5_ADMIN_URL}/shop_admin/itemform.php?w=u&it_id={_it_id}" class="btn-e btn-e-xs btn-e-purple rounded pull-right">상품 관리</a><!--{/}-->

        </div>

        <!--{* 상품분류 1 시작 *}-->

        <!--{? shop->listcategory()}-->

        <aside id="sct_ct_1" class="sct_ct">

            <strong><i class="fa fa-bars"></i> 관련 카테고리 :</strong>

            <!--{@ shop->listcategory()}-->

            <a href="{.href}">{.ca_name}({.cnt})</a>

            <!--{/}-->

        </aside>

        <!--{/}-->

        <!--{* 상품분류 1 끝 *}-->

    </div></p>

<p>

댓글을 작성하려면 로그인이 필요합니다.

답변 2개

채택된 답변
+20 포인트
7년 전

21행을 하래처럼 수정 해보세요

$navigation .= $deli. "

$deli= ' - ';

로그인 후 평가할 수 있습니다
7년 전

get_navigation()<---이 함수를 올려 보세요

그래야 방법을 알려드릴 수 있습니다

 

 

 

로그인 후 평가할 수 있습니다

답변에 대한 댓글 2개

h
history
7년 전
추가로 소스 올렸습니다 확인 부탁드립니다^^
h
history
7년 전
[code]
public function get_navigation() {
global $g5, $ca_id;

if ($ca_id) {
$navigation = "";
$len = strlen($ca_id) / 2;
for ($i=1; $i<=$len; $i++) {
$code = substr($ca_id,0,$i*2);

$sql = " select ca_name from {$g5['g5_shop_category_table']} where ca_id = '$code' ";
$row = sql_fetch($sql);

$sct_here = '';
if ($ca_id == $code) // 현재 분류와 일치하면
$sct_here = 'sct_here';

if ($i != $len) // 현재 위치의 마지막 단계가 아니라면
$sct_bg = 'sct_bg';
else $sct_bg = '';

$navigation .= '<a href="./list.php?ca_id='.$code.'" class="'.$sct_here.' '.$sct_bg.'">'.$row['ca_name'].'</a>';
}
}
else $navigation = $g5['title'];

return $navigation;
}

public function get_navi($ca_id) {
global $g5;

if ($ca_id) {
$navigation = "";
$len = strlen($ca_id) / 2;
for ($i=1; $i<=$len; $i++) {
$code = substr($ca_id,0,$i*2);

$sql = " select ca_name from {$g5['g5_shop_category_table']} where ca_id = '$code' ";
$row = sql_fetch($sql);

$sct_here = '';
if ($ca_id == $code) // 현재 분류와 일치하면
$sct_here = 'active';

$navigation .= '<li class="'.$sct_here.'"><a href="./list.php?ca_id='.$code.'">'.$row['ca_name'].'</a></li>';
if($i == $len) {
$nav['title'] = $row['ca_name'];
}
}
} else {
$nav['title'] = $g5['title'];
$navigation = $g5['title'];
}
$nav['path'] = $navigation;

return $nav;
}

public function listcategory($type='') {
global $g5, $ca_id;
switch($type) {
default :
$listcategory = '';
$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);
$i=0;
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' ");

$listcategory[$i]['href'] = "./list.php?ca_id=".$row['ca_id'];
$listcategory[$i]['ca_name'] = $row['ca_name'];
$listcategory[$i]['cnt'] = $row2['cnt'];
$i++;
}
return $listcategory;
break;
}
}
[/code]

댓글을 작성하려면 로그인이 필요합니다.

답변을 작성하려면 로그인이 필요합니다.

로그인