영카트 분류 관리 순서
관련링크
본문
$sql = "SELECT it_id, ca_id, ca_id2, it_name, it_en_name FROM g5_shop_item WHERE it_use=1 ORDER BY ca_id ASC, it_order asc, ca_id2 ASC ";
사용해서 왼쪽 메뉴의 순서를 변경 했습니다.
그런데 왼쪽 메뉴의 순서에 맞게 오른쪽의 상세페이지의 분류 순서가 변경 되지 않습니다.
어떤 코드를 수정해야 될까요?ㅠㅠ
해당부분에 해당되는 코드와 혹시몰라 전체 코드도 적어드립니다ㅠ
[해당 부분 소스코드]
<td colspan="2" height="25" align="center">
<?
$ca_2ndinfo = get_ca_name($it['ca_id2']);
if ($_SESSION['site'] == 'e')
{
if ($ca_2ndinfo['ca_en_name'])
echo "<div style='text-align:left;padding-left:10px;font-size:14px;font-weight:bold; margin-bottom:20px; font-family:'맑은고딕''>{$ca_2ndinfo['ca_en_name']}</div>";
else
echo "<div style='text-align:left;padding-left:10px;font-size:14px;font-weight:bold; margin-bottom:20px;font-family:'맑은고딕''>{$ca_2ndinfo['ca_name']}</div>";
}
else
echo "<div style='text-align:left;padding-left:10px;font-size:14px;font-weight:bold; margin-bottom:20px;font-family:'맑은고딕''>{$ca_2ndinfo['ca_name']}</div>";
$ca_list = get_ca_goods($it['ca_id'], $it['ca_id2']);
echo '<span class="style5" style="display:inline-block; margin-bottom:20px; font-size:16px"><strong>[</strong>';
for ($i=1; $row=sql_fetch_array($ca_list); $i++)
{
if ($i > 1)
echo " <strong>|</strong> ";
$ca_1stinfo = get_ca_name($row['ca_id']);
if ( $_SESSION['site'] == "e")
{
$t_caname = ($ca_1stinfo['ca_en_name']) ? $ca_1stinfo['ca_en_name']:$ca_1stinfo['ca_name'];
$t_itname = ($row['it_en_name']) ? $row['it_en_name']:$row['it_name'];
echo "<a href='/yc5/shop/product.php?ca_name={$t_caname}&it_id={$row['it_id']}'>{$t_itname}</a>";
}
else
echo "<a href='/yc5/shop/product.php?ca_name={$ca_1stinfo['ca_name']}&it_id={$row['it_id']}'>{$row['it_name']}</a>";
if ($it_id == $row['it_id'])
{
if ( $_SESSION['site'] == "e")
$sel_it_name = $i.". ".$t_itname;
else
$sel_it_name = $i.". ".$row['it_name'];
}
}
echo "<strong>]</strong></span>";
echo "<div style='text-align:left;padding-left:10px;font-size:14px;font-weight:bold;'><strong>{$sel_it_name} </strong></div>";
$img_cnt = 0;
for($k = 1; $k <= 10; $k++)
{
$it_img = G5_DATA_PATH.'/item/'.$it['it_img'.$k];
if(is_file($it_img) && $it['it_img'.$k])
{
$img_cnt++;
}
}
?>
[전체 소스코드]
<?php
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
if(defined('G5_THEME_PATH')) {
require_once(G5_THEME_SHOP_PATH.'/shop.head.php');
return;
}
include_once(G5_PATH.'/head.sub.php');
include_once(G5_LIB_PATH.'/outlogin.lib.php');
include_once(G5_LIB_PATH.'/poll.lib.php');
include_once(G5_LIB_PATH.'/visit.lib.php');
include_once(G5_LIB_PATH.'/connect.lib.php');
include_once(G5_LIB_PATH.'/popular.lib.php');
include_once(G5_LIB_PATH.'/latest.lib.php');
if ($site =='e' || $site == 'en' || $_SESSION['site'] == 'e')
{
$t = '';
$me = "_e";
$bot = "_en";
}
else {
$t = '_k';
$me = "";
$bot = "";
}
?>
<style type="text/css">
@import url(http://fonts.googleapis.com/earlyaccess/nanumgothic.css);
@import url(http://fonts.googleapis.com/earlyaccess/nanummyeongjo.css);
.Wrap_pro {}
.Wrap_pro h4{font-size:16px; font-family:dotum; font-weight:bold}
ul, li {list-style:none;}
img {border:0;}
#product {width:690px; background:#f5f5f5; height:290px;padding:15px; border:solid 1px #d1d1d1}
#product ul{float:left}
#nav{width:200px; float:left; width:220px; margin-top:0px; margin-left:25px;}
#nav li {float:left; width:108px;}
#nav img {width:108px; height:70px}
#nav a{display:block; border:1px solid #bbb;-webkit-border-radius:5px;}
#nav a.active {border:1px solid #fff;}
#window{width:439px; float:left}
#window img {width:439px; height:286px;}
</style>
<table border="0" width="924" cellpadding="0" cellspacing="0" align="center">
<tr>
<td width="924" height="50" colspan="3" align="right"><?include "../../topmenu{$t}.html";?></td>
</tr>
<tr>
<td width="924" colspan="2"><?include "../../menu{$me}.html";?></td>
</tr>
<tr>
<td width="190" valign="top"><p><img src="http://skinc.co.kr/img/title_left_products.gif" width="190" height="65">
<div id="left">
<style>
#left ul li {border-bottom:1px solid #dcdcdc; color:#515151; padding:12px 0 12px 10px; font-size:12px;}
#left ul li a {width:100% ; height:100%; display:block; color:#424242; font-family:'맑은고딕' !important; font-size:12px !important;}
#left ul li a:hover {color:#295f9f; background: url(/img/left_bul.png) no-repeat 170px 0px; }
#left ul li a.on {color:#295f9f; background:url(/img/left_bul.png) no-repeat 170px 0px; font-weight:bold }
ul.topnav ul {display: none;}
ul.sec {margin-left:15px; }
ul.sec li a{font-size:12px; color:#333}
ul.sec li a:hover{color:#000 !important; background:none !important;}
ul.sec li:last-child {border-bottom:none !important; padding-bottom:0 !important; }
</style>
<script type="text/javascript" src="./scriptbreaker-multiple-accordion-1.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$(".topnav").accordion({
accordion:true,
speed: 500,
closedSign: '',
openedSign: ''
});
});
</script>
<?php
$sql = "SELECT it_id, ca_id, ca_id2, it_name, it_en_name FROM g5_shop_item WHERE it_use=1 ORDER BY ca_id ASC, it_order asc, ca_id2 ASC ";
$result = sql_query($sql);
?>
<ul class="topnav">
<?php
for ($i=0; $row=sql_fetch_array($result); $i++) {
if(!$it_id && $i === 0) {
$it_id = $row['it_id'];
$view_ca_id = ($view_ca_id) ? $view_ca_id : '';
}
if($temp_ca_id != substr($row['ca_id'], 0, 2)) {
$no = 0;
$temp_ca_id = substr($row['ca_id'], 0, 2);
$ca_row = sql_fetch("SELECT ca_name, ca_en_name FROM g5_shop_category WHERE ca_use=1 AND ca_id='{$temp_ca_id}'");
$_ca_name = ($_SESSION['site'] == 'e') ? $ca_row['ca_en_name'] : $ca_row['ca_name'];
if($i !== 0 && $no === 0) {
echo '</ul>'.PHP_EOL;
echo '</li>'.PHP_EOL;
}
echo '<li>'.PHP_EOL;
echo '<a href="#"><strong>'.$_ca_name.'</strong></a>'.PHP_EOL;
}
$_it_name = ($_SESSION['site'] == 'e') ? $row['it_en_name'] : $row['it_name'];
if($no == 0) {
if($view_ca_id == $temp_ca_id) {
echo '<ul class="sec" style="display:block">'.PHP_EOL;
}
else {
echo '<ul class="sec">'.PHP_EOL;
}
}
echo '<li><a href="/yc5/shop/product.php?ca_name='.$_ca_name.'&view_ca_id='.$temp_ca_id.'&it_id='.$row['it_id'].'">'.$_it_name.'</a></li>'.PHP_EOL;
$no++;
}
?>
</ul>
<p style="padding-top:15px;">
<a href="/catalog.pdf" style=" font-size:16px; font-weight:600; color:#5F67AE;font-family:Nanum Gothic, 나눔고딕" target="_blank"><?php echo ($_SESSION['site'] == 'e') ? 'Catalog' : '카다로그' ?></a>
</p>
<p><img src="/img/service.gif" align="bottom"></p>
</div>
</p></p>
</td>
<?php
$sql = " select a.*, b.ca_name, b.ca_en_name, b.ca_use from {$g5['g5_shop_item_table']} a, {$g5['g5_shop_category_table']} b where a.it_id = '$it_id' and a.ca_id = b.ca_id ";
$it = sql_fetch($sql);
?>
<td width="734" valign="top"><table border="0" align="center" cellpadding="0" cellspacing="0" height="166">
<tr>
<td width="364" height="43" background="title_a1.gif" style="padding-left:15px; font-weight:bold; font-size:18px; font-family:'맑은고딕'">
<?php
if ($_SESSION['site'] == 'e')
echo ($it['ca_en_name']) ? $it['ca_en_name']:$it['ca_name'];
else
echo $it['ca_name']
?>
</td>
<td width="370" height="66" valign="middle" bgcolor="#ededed">
<p align="right" class="style1"><span style="font-size:9pt;"><span style="font-size:9pt;"><a href="/index.html">HOME</a><span style="font-size:9pt;"> <img src="http://skinc.co.kr/img/e_img/icon2.gif"> </span><span style="font-size:9pt;"><span style="font-size:9pt;"><span style="font-size:9pt;"> </span><a href="/kp1-1.html"><?=($_SESSION['site'] == 'e') ? 'Products':'제품소개'?></a><span style="font-size:9pt;"><img src="http://skinc.co.kr/img/e_img/icon2.gif"></span></span></span>
<?
if ($_SESSION['site'] == 'e')
echo ($it['it_en_name']) ? $it['it_en_name']:$it['it_name'];
else
echo $it['it_name']
?>
</td>
</tr>
<tr>
<td colspan="2" height="25" align="center">
<?
$ca_2ndinfo = get_ca_name($it['ca_id2']);
if ($_SESSION['site'] == 'e')
{
if ($ca_2ndinfo['ca_en_name'])
echo "<div style='text-align:left;padding-left:10px;font-size:14px;font-weight:bold; margin-bottom:20px; font-family:'맑은고딕''>{$ca_2ndinfo['ca_en_name']}</div>";
else
echo "<div style='text-align:left;padding-left:10px;font-size:14px;font-weight:bold; margin-bottom:20px;font-family:'맑은고딕''>{$ca_2ndinfo['ca_name']}</div>";
}
else
echo "<div style='text-align:left;padding-left:10px;font-size:14px;font-weight:bold; margin-bottom:20px;font-family:'맑은고딕''>{$ca_2ndinfo['ca_name']}</div>";
$ca_list = get_ca_goods($it['ca_id'], $it['ca_id2']);
echo '<span class="style5" style="display:inline-block; margin-bottom:20px; font-size:16px"><strong>[</strong>';
for ($i=1; $row=sql_fetch_array($ca_list); $i++)
{
if ($i > 1)
echo " <strong>|</strong> ";
$ca_1stinfo = get_ca_name($row['ca_id']);
if ( $_SESSION['site'] == "e")
{
$t_caname = ($ca_1stinfo['ca_en_name']) ? $ca_1stinfo['ca_en_name']:$ca_1stinfo['ca_name'];
$t_itname = ($row['it_en_name']) ? $row['it_en_name']:$row['it_name'];
echo "<a href='/yc5/shop/product.php?ca_name={$t_caname}&it_id={$row['it_id']}'>{$t_itname}</a>";
}
else
echo "<a href='/yc5/shop/product.php?ca_name={$ca_1stinfo['ca_name']}&it_id={$row['it_id']}'>{$row['it_name']}</a>";
if ($it_id == $row['it_id'])
{
if ( $_SESSION['site'] == "e")
$sel_it_name = $i.". ".$t_itname;
else
$sel_it_name = $i.". ".$row['it_name'];
}
}
echo "<strong>]</strong></span>";
echo "<div style='text-align:left;padding-left:10px;font-size:14px;font-weight:bold;'><strong>{$sel_it_name} </strong></div>";
$img_cnt = 0;
for($k = 1; $k <= 10; $k++)
{
$it_img = G5_DATA_PATH.'/item/'.$it['it_img'.$k];
if(is_file($it_img) && $it['it_img'.$k])
{
$img_cnt++;
}
}
?>
<div class="Wrap_pro" style="padding-top:20px;">
<div id="product" style="<?=($img_cnt > 8) ? 'height:360px;':''?>">
<div id="window"><img src="<?php echo G5_DATA_URL; ?>/item/<?php echo $it['it_img1']; ?>" alt="" width=439 height=286 alt="" /></div>
<ul id="nav">
<?php
for($k = 1; $k <= 10; $k++)
{
$it_img = G5_DATA_PATH.'/item/'.$it['it_img'.$k];
if(is_file($it_img) && $it['it_img'.$k])
{
$size = @getimagesize($it_img);
$thumb = get_it_thumbnail($it['it_img'.$k], 25, 25);
?>
<li><a href="<?php echo G5_DATA_URL; ?>/item/<?php echo $it['it_img'.$k]; ?>" class="<?=($k == 1)? 'active':''?>"><img src="<?php echo G5_DATA_URL; ?>/item/<?php echo $it['it_img'.$k]; ?>" alt="" width=108 height=70/></a></li>
<?php
}
else
{
?>
<?php
}
}
?>
</ul>
</div>
<script type="text/javascript">
$(document).ready(function(){
$('#nav a').mouseover(function(e){
e.preventDefault();
$('#nav a').removeClass('active');
$(this).addClass('active');
img_url = $(this).attr('href');
$('#window img').attr('src',img_url);
});
})
</script>
<p>
<?php
if ($_SESSION['site'] == "e")
//echo nl2br($it['it_en_explan']);
echo $it['it_en_explan'];
else
//echo nl2br($it['it_explan']);
echo $it['it_explan'];
답변 3
아이고 머리얌--;;; 정리부터 좀 해주세요;;;
그리고 여기에는 메뉴의 정의 가된부분이 않보이고 상품에 대한 정의만 보이는것 같은데요
여기서 좌측메뉴와 우측메뉴가 어디인가요?
그누기본에 정의하자면 보통 좌측과 우측에 대한 메뉴정의는 tail.php 파일에서 정의 해야 할거에요.
사이드메뉴 그리고 .본페지 상단에 좌측메뉴에 대한 2차메뉴를가지고올려면 해당탑에다 정의하던 하는데 현재 여기서는 나는 안보이는데요?
소스가 길어서 다 살펴보지는 못했지만 메뉴 불러올때 order by 를 사용하셔서 원하시는 순서대로 정렬을 하셔야 할거 같습니다.
답변을 작성하시기 전에 로그인 해주세요.