Files
2026-06-11 18:47:38 +09:00

52 lines
2.0 KiB
PHP

<?php
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
?>
<!-- 팝업레이어 시작 { -->
<div id="hd_pop">
<?php
for ($i=0; $nw=sql_fetch_array($result); $i++)
{
// 이미 체크 되었다면 Continue
if (isset($_COOKIE["hd_pops_{$nw['nw_id']}"]) && $_COOKIE["hd_pops_{$nw['nw_id']}"])
continue;
?>
<div id="hd_pops_<?php echo $nw['nw_id'] ?>" class="hd_pops" style="top:<?php echo $nw['nw_top']?>px;left:<?php echo $nw['nw_left']?>px">
<div class="hd_pops_con" style="width:<?php echo $nw['nw_width'] ?>px;height:<?php echo $nw['nw_height'] ?>px">
<?php echo conv_content($nw['nw_content'], 1); ?>
</div>
<div class="hd_pops_footer">
<?php // 💡 [개선] '오늘 하루' 대신 관리자에서 설정한 시간으로 표시되도록 수정 ?>
<button class="hd_pops_reject hd_pops_<?php echo $nw['nw_id']; ?> <?php echo $nw['nw_disable_hours']; ?>"><strong><?php echo $nw['nw_disable_hours']; ?></strong>시간 동안 다시 열람하지 않습니다.</button>
<button class="hd_pops_close hd_pops_<?php echo $nw['nw_id']; ?>">닫기</button>
</div>
</div>
<?php
} // end for
?>
</div>
<script>
jQuery(function($) {
// "n시간 동안 다시 열람하지 않음" 버튼
$(".hd_pops_reject").click(function() {
var classes = $(this).attr('class').split(' ');
var id = classes[1]; // hd_pops_1
var hours = parseInt(classes[2]); // 24
if (hours > 0) {
set_cookie(id, 1, hours, g5_cookie_domain);
}
$("#" + id).css("display", "none");
});
// "닫기" 버튼
$('.hd_pops_close').click(function() {
var classes = $(this).attr('class').split(' ');
var id = classes[1]; // hd_pops_1
$('#' + id).css('display', 'none');
});
});
</script>
<!-- } 팝업레이어 끝 -->