메인배너 스킨화 작업 중
This commit is contained in:
@ -1110,11 +1110,16 @@ function date_conv($date, $case=1)
|
||||
|
||||
|
||||
// 배너출력
|
||||
function display_banner($position, $num="")
|
||||
function display_banner($position, $skin='')
|
||||
{
|
||||
global $g5;
|
||||
|
||||
if (!$position) $position = '왼쪽';
|
||||
if (!$skin) $skin = 'boxbanner.skin.php';
|
||||
|
||||
// 배너 출력
|
||||
$sql = " select * from {$g5['g5_shop_banner_table']} where '".G5_TIME_YMDHIS."' between bn_begin_time and bn_end_time and bn_position = '$position' order by bn_order, bn_id desc ";
|
||||
$result = sql_query($sql);
|
||||
|
||||
include G5_SHOP_SKIN_PATH.'/boxbanner'.$num.'.skin.php';
|
||||
}
|
||||
|
||||
@ -13,7 +13,7 @@ include_once(G5_SHOP_PATH.'/shop.head.php');
|
||||
|
||||
<!-- 메인이미지 시작 { -->
|
||||
<div id="sidx_img">
|
||||
<img src="<?php echo G5_DATA_URL; ?>/common/main_img" alt="">
|
||||
<?php echo display_banner('메인', 'mainbanner.10.skin.php'); ?>
|
||||
</div>
|
||||
<!-- } 메인이미지 끝 -->
|
||||
|
||||
@ -146,10 +146,6 @@ include_once(G5_SHOP_PATH.'/shop.head.php');
|
||||
|
||||
<?php echo visit('shop_basic'); // 접속자 ?>
|
||||
|
||||
<!-- 메인배너 시작 { -->
|
||||
<?php echo display_banner('메인'); ?>
|
||||
<!-- } 메인배너 끝 -->
|
||||
|
||||
<?php
|
||||
include_once(G5_SHOP_PATH.'/shop.tail.php');
|
||||
?>
|
||||
@ -1,10 +1,6 @@
|
||||
<?php
|
||||
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
|
||||
|
||||
// 배너 출력
|
||||
$sql = " select * from {$g5['g5_shop_banner_table']} where '".G5_TIME_YMDHIS."' between bn_begin_time and bn_end_time and bn_position = '$position' order by bn_order, bn_id desc ";
|
||||
$result = sql_query($sql);
|
||||
|
||||
// add_stylesheet('css 구문', 출력순서); 숫자가 작을 수록 먼저 출력됨
|
||||
add_stylesheet('<link rel="stylesheet" href="'.G5_SHOP_SKIN_URL.'/style.css">', 0);
|
||||
?>
|
||||
@ -12,8 +8,7 @@ add_stylesheet('<link rel="stylesheet" href="'.G5_SHOP_SKIN_URL.'/style.css">',
|
||||
<?php
|
||||
for ($i=0; $row=sql_fetch_array($result); $i++)
|
||||
{
|
||||
if ($row['bn_position'] == '메인') $bn_position = 'idx';
|
||||
else $bn_position = 'side';
|
||||
$bn_position = 'side';
|
||||
|
||||
if ($i==0) echo '<aside id="sbn_'.$bn_position.'" class="sbn"><h2>쇼핑몰 배너</h2><ul>'.PHP_EOL;
|
||||
//print_r2($row);
|
||||
|
||||
37
skin/shop/basic/mainbanner.10.skin.php
Normal file
37
skin/shop/basic/mainbanner.10.skin.php
Normal file
@ -0,0 +1,37 @@
|
||||
<?php
|
||||
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
|
||||
|
||||
// add_stylesheet('css 구문', 출력순서); 숫자가 작을 수록 먼저 출력됨
|
||||
add_stylesheet('<link rel="stylesheet" href="'.G5_SHOP_SKIN_URL.'/style.css">', 0);
|
||||
?>
|
||||
|
||||
<?php
|
||||
for ($i=0; $row=sql_fetch_array($result); $i++)
|
||||
{
|
||||
$bn_position = 'idx';
|
||||
|
||||
if ($i==0) echo '<section id="sbn_'.$bn_position.'" class="sbn"><h2>쇼핑몰 배너</h2><ul>'.PHP_EOL;
|
||||
//print_r2($row);
|
||||
// 테두리 있는지
|
||||
$bn_border = ($row['bn_border']) ? ' sbn_border' : '';;
|
||||
// 새창 띄우기인지
|
||||
$bn_new_win = ($row['bn_new_win']) ? ' target="'.$row['bn_new_win'].'"' : '';
|
||||
|
||||
$bimg = G5_DATA_PATH.'/banner/'.$row['bn_id'];
|
||||
if (file_exists($bimg))
|
||||
{
|
||||
$size = getimagesize($bimg);
|
||||
echo '<li>'.PHP_EOL;
|
||||
if ($row['bn_url'][0] == '#')
|
||||
echo '<a href="'.$row['bn_url'].'">';
|
||||
else if ($row['bn_url'] && $row['bn_url'] != 'http://') {
|
||||
echo '<a href="'.G5_SHOP_URL.'/bannerhit.php?bn_id='.$row['bn_id'].'&url='.urlencode($row['bn_url']).'"'.$bn_new_win.'>';
|
||||
}
|
||||
echo '<img src="'.G5_DATA_URL.'/banner/'.$row['bn_id'].'" alt="'.$row['bn_alt'].'" width="'.$size[0].'" height="'.$size[1].'" class="'.$bn_border.'">';
|
||||
if($row['bn_url'])
|
||||
echo '</a>'.PHP_EOL;
|
||||
echo '</li>'.PHP_EOL;
|
||||
}
|
||||
}
|
||||
if ($i>0) echo '</ul></section>'.PHP_EOL;
|
||||
?>
|
||||
Reference in New Issue
Block a user