Files
firstgarden-web-gnu/shop/boxevent.inc.php
2013-06-12 10:31:01 +09:00

38 lines
1.2 KiB
PHP

<?php
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
?>
<aside id="sev">
<h2>쇼핑몰 이벤트</h2>
<ul>
<?php
$hsql = " select ev_id, ev_subject, ev_subject_strong from {$g4['shop_event_table']} where ev_use = '1' order by ev_id desc ";
$hresult = sql_query($hsql);
for ($i=0; $row=sql_fetch_array($hresult); $i++)
{
echo '<li>';
$href = G4_SHOP_URL.'/event.php?ev_id='.$row['ev_id'];
$event_img = G4_DATA_PATH.'/event/'.$row['ev_id'].'_m'; // 이벤트 이미지
if (file_exists($event_img)) { // 이벤트 이미지가 있다면 이미지 출력
echo '<a href="'.$href.'" class="sev_img"><img src="'.G4_DATA_URL.'/event/'.$row['ev_id'].'_m" alt="'.$row['ev_subject'].'"></a>'.PHP_EOL;
} else { // 없다면 텍스트 출력
echo '<a href="'.$href.'" class="sev_text">';
if ($row['ev_subject_strong']) echo '<strong>';
echo $row['ev_subject'];
if ($row['ev_subject_strong']) echo '</strong>';
echo '</a>'.PHP_EOL;
}
echo '</li>'.PHP_EOL;
}
if ($i==0)
echo '<li id="sev_empty">이벤트 없음</li>'.PHP_EOL;
?>
</ul>
</aside>