lib/shop.lib.php 의302 번째 정도의 라인을 수정합니다.
정상 소스
============================
// 분류별 출력
// 스킨파일번호, 1라인이미지수, 총라인수, 이미지폭, 이미지높이 , 분류번호
function display_category($no, $list_mod, $list_row, $img_width, $img_height, $ca_id="")
{
global $member, $g4;
// 스킨파일번호, 1라인이미지수, 총라인수, 이미지폭, 이미지높이 , 분류번호
function display_category($no, $list_mod, $list_row, $img_width, $img_height, $ca_id="")
{
global $member, $g4;
// 상품의 갯수
$items = $list_mod * $list_row;
$items = $list_mod * $list_row;
$sql = " select * from $g4[yc4_item_table] where it_use = '1'";
if ($ca_id)
$sql .= " and ca_id LIKE '{$ca_id}%' ";
$sql .= " order by it_order, it_id desc limit $items "; <---이 줄을 수정하는 것임
$result = sql_query($sql);
if (!mysql_num_rows($result)) {
return false;
}
if ($ca_id)
$sql .= " and ca_id LIKE '{$ca_id}%' ";
$sql .= " order by it_order, it_id desc limit $items "; <---이 줄을 수정하는 것임
$result = sql_query($sql);
if (!mysql_num_rows($result)) {
return false;
}
$file = "$g4[shop_path]/maintype{$no}.inc.php";
if (!file_exists($file)) {
echo "<span class=point>{$file} 파일을 찾을 수 없습니다.</span>";
} else {
$td_width = (int)(100 / $list_mod);
include $file;
}
}
if (!file_exists($file)) {
echo "<span class=point>{$file} 파일을 찾을 수 없습니다.</span>";
} else {
$td_width = (int)(100 / $list_mod);
include $file;
}
}
<--- 이부분 수정
========================
========================
수정소스
========================
// 분류별 출력
// 스킨파일번호, 1라인이미지수, 총라인수, 이미지폭, 이미지높이 , 분류번호
function display_category($no, $list_mod, $list_row, $img_width, $img_height, $ca_id="")
{
global $member, $g4;
// 스킨파일번호, 1라인이미지수, 총라인수, 이미지폭, 이미지높이 , 분류번호
function display_category($no, $list_mod, $list_row, $img_width, $img_height, $ca_id="")
{
global $member, $g4;
// 상품의 갯수
$items = $list_mod * $list_row;
$items = $list_mod * $list_row;
$sql = " select * from $g4[yc4_item_table] where it_use = '1'";
if ($ca_id)
$sql .= " and ca_id LIKE '{$ca_id}%' ";
// 카테고리 아이디별 랜덤 출력 수정소스 시작
if ($ca_id == 10||$ca_id == 20||$ca_id == 30||$ca_id == 40||$ca_id == 50) {
$sql .= " order by rand() limit $items ";
} else {
$sql .= " order by it_order, it_id desc limit $items ";
}
// 카테고리 아이디별 랜덤 출력 수정소스 끝
$result = sql_query($sql);
if (!mysql_num_rows($result)) {
return false;
}
if ($ca_id)
$sql .= " and ca_id LIKE '{$ca_id}%' ";
// 카테고리 아이디별 랜덤 출력 수정소스 시작
if ($ca_id == 10||$ca_id == 20||$ca_id == 30||$ca_id == 40||$ca_id == 50) {
$sql .= " order by rand() limit $items ";
} else {
$sql .= " order by it_order, it_id desc limit $items ";
}
// 카테고리 아이디별 랜덤 출력 수정소스 끝
$result = sql_query($sql);
if (!mysql_num_rows($result)) {
return false;
}
$file = "$g4[shop_path]/maintype{$no}.inc.php";
if (!file_exists($file)) {
echo "<span class=point>{$file} 파일을 찾을 수 없습니다.</span>";
} else {
$td_width = (int)(100 / $list_mod);
include $file;
}
}
if (!file_exists($file)) {
echo "<span class=point>{$file} 파일을 찾을 수 없습니다.</span>";
} else {
$td_width = (int)(100 / $list_mod);
include $file;
}
}
=============================
if ($ca_id == 10||$ca_id == 20||$ca_id == 30||$ca_id == 40||$ca_id == 50) 이 부분을 자신의 카테고리에 맞게 수정하여 사용하면, 카테고리 별로 랜덤으로 할지 램던으로 하지 않을지 선택할 수 있습니다.
p.s
카테고리 출력하는 소스를 모르시는 분(이런분이 있을까 생각하지만 제가 그랬습니다.)을 위해 소스도 올립니다.
카테고리 10에 해당하는 제품을 노출 할 경우 입니다.
<?
display_category('10', 4, 1, 100, 100, '10');
?>
display_category('10', 4, 1, 100, 100, '10');
?>
댓글 3개
게시글 목록
| 번호 | 제목 |
|---|---|
| 1440 | |
| 1434 | |
| 1433 | |
| 1428 | |
| 1421 | |
| 1397 | |
| 1396 | |
| 1388 | |
| 1379 | |
| 1378 | |
| 1377 | |
| 1367 | |
| 1365 | |
| 1362 | |
| 1348 | |
| 1343 | |
| 1335 | |
| 1318 | |
| 1311 | |
| 1310 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기