답변 3개
채택된 답변
+20 포인트
shop/list.php 파일의 코드를 아래와 같이 수정하셔서 테스트해 보세요.
실제 테스트를 해본 코드는 아니기 때문에 오류가 있을 수 있습니다.
Copy
<?php
include_once('./_common.php');
if (G5_IS_MOBILE) {
include_once(G5_MSHOP_PATH.'/list.php');
return;
}
$g5['title'] = '전체 상품리스트';
include_once('./_head.php');
// 스킨경로
$skin_dir = G5_SHOP_SKIN_PATH;
define('G5_SHOP_CSS_URL', str_replace(G5_PATH, G5_URL, $skin_dir));
?>
<!-- 상품 목록 시작 { -->
<div id="sct">
<?php
$nav_skin = $skin_dir.'/navigation.skin.php';
if(!is_file($nav_skin))
$nav_skin = G5_SHOP_SKIN_PATH.'/navigation.skin.php';
include $nav_skin;
$cate_skin = $skin_dir.'/listcategory.skin.php';
if(!is_file($cate_skin))
$cate_skin = G5_SHOP_SKIN_PATH.'/listcategory.skin.php';
include $cate_skin;
// 상품 출력순서가 있다면
if ($sort != "")
$order_by = $sort.' '.$sortodr.' , it_order, it_id desc';
else
$order_by = 'it_order, it_id desc';
$error = '<p class="sct_noitem">등록된 상품이 없습니다.</p>';
// 리스트 스킨
$skin_file = $skin_dir.'/list.10.skin.php';
if (file_exists($skin_file)) {
echo '<div id="sct_sortlst">';
$sort_skin = $skin_dir.'/list.sort.skin.php';
if(!is_file($sort_skin))
$sort_skin = G5_SHOP_SKIN_PATH.'/list.sort.skin.php';
include $sort_skin;
echo '</div>';
$list_mod = 3;
$list_row = 5;
$img_width = 230;
$img_height = 230;
// 총몇개 = 한줄에 몇개 * 몇줄
$items = $list_mod * $list_row;
// 페이지가 없으면 첫 페이지 (1 페이지)
if ($page < 1) $page = 1;
// 시작 레코드 구함
$from_record = ($page - 1) * $items;
$sql = " select * from {$g5['g5_shop_item_table']} where it_use = '1' ";
$list = new item_list($skin_file, $list_mod, $list_row, $img_width, $img_height);
$list->set_query($sql);
$list->set_is_page(true);
$list->set_order_by($order_by);
$list->set_from_record($from_record);
$list->set_view('it_img', true);
$list->set_view('it_id', false);
$list->set_view('it_name', true);
$list->set_view('it_basic', true);
$list->set_view('it_cust_price', true);
$list->set_view('it_price', true);
$list->set_view('it_icon', true);
$list->set_view('sns', true);
echo $list->run();
// where 된 전체 상품수
$total_count = $list->total_count;
// 전체 페이지 계산
$total_page = ceil($total_count / $items);
}
else
{
echo '<div class="sct_nofile">'.str_replace(G5_PATH.'/', '', $skin_file).' 파일을 찾을 수 없습니다.<br>관리자에게 알려주시면 감사하겠습니다.</div>';
}
?>
<?php
$qstr1 .='&sort='.$sort.'&sortodr='.$sortodr;
echo get_paging($config['cf_write_pages'], $page, $total_page, $_SERVER['PHP_SELF'].'?'.$qstr1.'&page=');
?>
</div>
<!-- } 상품 목록 끝 -->
<?php
include_once('./_tail.php');
?>
답변을 작성하려면 로그인이 필요합니다.