쿠폰존을 bbs로
본문
쿠폰존 기능은 필요해서 그누+영카트+아미나빌더 깔린 상태입니다.
쇼핑몰테마는 운영하지 않아서..
쿠폰존을 /shop에서 /BBS로 옮기고 싶습니다.
couponzone.php 파일만 옮겨서 수정하면 될까요?..
---------------------------------------------------------
<?php
include_once('./_common.php');
if(USE_G5_THEME && defined('G5_THEME_PATH')) {
require_once(G5_SHOP_PATH.'/yc/couponzone.php');
return;
}
// Page ID
$pid = ($pid) ? $pid : 'couponzone';
$at = apms_page_thema($pid);
include_once(G5_LIB_PATH.'/apms.thema.lib.php');
$skin_row = array();
$skin_row = apms_rows('cz_'.MOBILE_.'skin, cz_'.MOBILE_.'set');
$skin_name = $skin_row['cz_'.MOBILE_.'skin'];
// 스킨설정
$wset = array();
if($skin_row['cz_'.MOBILE_.'set']) {
$wset = apms_unpack($skin_row['cz_'.MOBILE_.'set']);
}
// 데모
if($is_demo) {
@include ($demo_setup_file);
}
$skin_path = G5_SKIN_PATH.'/apms/couponzone/'.$skin_name;
$skin_url = G5_SKIN_URL.'/apms/couponzone/'.$skin_name;
// 스킨 체크
list($skin_path, $skin_url) = apms_skin_thema('shop/couponzone', $skin_path, $skin_url);
// 설정값 불러오기
$is_couponzone_sub = false;
@include_once($skin_path.'/config.skin.php');
$g5['title'] = '쿠폰존';
if($is_couponzone_sub) {
include_once(G5_PATH.'/head.sub.php');
if(!USE_G5_THEME) @include_once(THEMA_PATH.'/head.sub.php');
} else {
include_once('./_head.php');
}
$list = array();
$plist = array();
$sql_common = " from {$g5['g5_shop_coupon_zone_table']}
where cz_start <= '".G5_TIME_YMD."'
and cz_end >= '".G5_TIME_YMD."' ";
$sql_order = " order by cz_id desc ";
// List
$sql = " select * $sql_common and cz_type = '0' $sql_order ";
$result = sql_query($sql);
for($i=0; $row=sql_fetch_array($result); $i++) {
$list[$i] = $row;
$list[$i]['cz_img'] = ($row['cz_file'] && is_file(G5_DATA_PATH.'/coupon/'.$row['cz_file'])) ? G5_DATA_URL.'/coupon/'.$row['cz_file'] : '';
$list[$i]['cz_subject'] = get_text($row['cz_subject']);
switch($row['cp_method']) {
case '0':
$sql3 = " select it_id, it_name from {$g5['g5_shop_item_table']} where it_id = '{$row['cp_target']}' ";
$row3 = sql_fetch($sql3);
$list[$i]['it_id'] = $row3['it_id'];
$list[$i]['it_name'] = get_text($row3['it_name']);
break;
case '1':
$sql3 = " select ca_id, ca_name from {$g5['g5_shop_category_table']} where ca_id = '{$row['cp_target']}' ";
$row3 = sql_fetch($sql3);
$list[$i]['ca_id'] = $row3['ca_id'];
$list[$i]['ca_name'] = get_text($row3['ca_name']);
break;
}
$list[$i]['disabled'] = (is_coupon_downloaded($member['mb_id'], $row['cz_id'])) ? ' disabled' : '';
}
// PList
$sql = " select * $sql_common and cz_type = '1' $sql_order ";
$result = sql_query($sql);
for($i=0; $row=sql_fetch_array($result); $i++) {
$plist[$i] = $row;
$plist[$i]['cz_img'] = ($row['cz_file'] && is_file(G5_DATA_PATH.'/coupon/'.$row['cz_file'])) ? G5_DATA_URL.'/coupon/'.$row['cz_file'] : '';
$plist[$i]['cz_subject'] = get_text($row['cz_subject']);
switch($row['cp_method']) {
case '0':
$sql3 = " select it_id, it_name from {$g5['g5_shop_item_table']} where it_id = '{$row['cp_target']}' ";
$row3 = sql_fetch($sql3);
$plist[$i]['it_id'] = $row3['it_id'];
$plist[$i]['it_name'] = get_text($row3['it_name']);
break;
case '1':
$sql3 = " select ca_id, ca_name from {$g5['g5_shop_category_table']} where ca_id = '{$row['cp_target']}' ";
$row3 = sql_fetch($sql3);
$plist[$i]['ca_id'] = $row3['ca_id'];
$plist[$i]['ca_name'] = get_text($row3['ca_name']);
break;
}
$plist[$i]['disabled'] = (is_coupon_downloaded($member['mb_id'], $row['cz_id'])) ? ' disabled' : '';
}
// 셋업
$setup_href = '';
if (is_file($skin_path.'/setup.skin.php') && ($is_demo || $is_designer)) {
$setup_href = './skin.setup.php?skin=cz&name='.urlencode($skin_name).'&ts='.urlencode(THEMA);
}
// 관리
$admin_href = ($is_admin) ? G5_ADMIN_URL.'/shop_admin/couponzonelist.php' : '';
// 스크립트
add_javascript('<script src="'.G5_JS_URL.'/shop.couponzone.js"></script>', 100);
include_once($skin_path.'/couponzone.skin.php');
if($is_couponzone_sub) {
if(!USE_G5_THEME) @include_once(THEMA_PATH.'/tail.sub.php');
include_once(G5_PATH.'/tail.sub.php');
} else {
include_once('./_tail.php');
}
?>
-------------------------------------------------------------------------------------------------
bbs로 적용할려면 어디부분을 수정해야할까요..
지금 수정 중인데 잘 안되네요..
답변 1
쿠폰존을 옮기려는 이유가 그누보드 쪽하고
상단 및 하단을 같은 모양으로 유지하고 싶어서 그러는 것이라면,
/shop/shop_head.php 와 shop_tail.php 를 수정하시는 것이 빠릅니다.
shop_head.php 에 head.php 를 인클루드 해주고,
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');
include_once(G5_PATH.'/head.php');
?>
shop_tail.php 에는 tail.php 를 인클루드 해줍니다.
<?php
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
?>
</div>
</div>
<? include_once(G5_PATH.'/tail.php'); ?>