팝업쪽 그냥 간단한팁
개발하다보면 개발자도구를 자주보잖아요
그러다보면 팝업이 없어도 개발자도구 소스보는쪽에
팝업레이어 시작 이러고 나오는 부분이 보기 싫더라구요
그래서 팝업이 있을때만 소스가 나오게 수정했습니다
<?php
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
$sql = " select * from {$g5['new_win_table']}
where '".G5_TIME_YMDHIS."' between nw_begin_time and nw_end_time
and nw_device IN ( 'both', 'pc' )
order by nw_id asc ";
$result = sql_query($sql, false);
if(sql_fetch_array($result) == null){} //팝업이 없다면 공백
else{
?>
<!-- 팝업레이어 시작 { -->
<div id="hd_pop">
<h2>팝업레이어 알림</h2>
<?php
for ($i=0; $nw=sql_fetch_array($result); $i++)
{
// 이미 체크 되었다면 Continue
if ($_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">
<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 }
if ($i == 0) echo '<span class="sound_only">팝업레이어 알림이 없습니다.</span>';
?>
</div>
<script>
$(function() {
$(".hd_pops_reject").click(function() {
var id = $(this).attr('class').split(' ');
var ck_name = id[1];
var exp_time = parseInt(id[2]);
$("#"+id[1]).css("display", "none");
set_cookie(ck_name, 1, exp_time, g5_cookie_domain);
});
$('.hd_pops_close').click(function() {
var idb = $(this).attr('class').split(' ');
$('#'+idb[1]).css('display','none');
});
$("#hd").css("z-index", 1000);
});
</script>
<!-- } 팝업레이어 끝 -->
<?php }?>
그러다보면 팝업이 없어도 개발자도구 소스보는쪽에
팝업레이어 시작 이러고 나오는 부분이 보기 싫더라구요
그래서 팝업이 있을때만 소스가 나오게 수정했습니다
<?php
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
$sql = " select * from {$g5['new_win_table']}
where '".G5_TIME_YMDHIS."' between nw_begin_time and nw_end_time
and nw_device IN ( 'both', 'pc' )
order by nw_id asc ";
$result = sql_query($sql, false);
if(sql_fetch_array($result) == null){} //팝업이 없다면 공백
else{
?>
<!-- 팝업레이어 시작 { -->
<div id="hd_pop">
<h2>팝업레이어 알림</h2>
<?php
for ($i=0; $nw=sql_fetch_array($result); $i++)
{
// 이미 체크 되었다면 Continue
if ($_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">
<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 }
if ($i == 0) echo '<span class="sound_only">팝업레이어 알림이 없습니다.</span>';
?>
</div>
<script>
$(function() {
$(".hd_pops_reject").click(function() {
var id = $(this).attr('class').split(' ');
var ck_name = id[1];
var exp_time = parseInt(id[2]);
$("#"+id[1]).css("display", "none");
set_cookie(ck_name, 1, exp_time, g5_cookie_domain);
});
$('.hd_pops_close').click(function() {
var idb = $(this).attr('class').split(' ');
$('#'+idb[1]).css('display','none');
});
$("#hd").css("z-index", 1000);
});
</script>
<!-- } 팝업레이어 끝 -->
<?php }?>
댓글 1개
6년 전
감사합니다
게시판 목록
그누보드5 팁자료실
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 2575 | 9개월 전 | 549 | ||
| 2574 | 9개월 전 | 924 | ||
| 2573 |
두리삼촌v
|
9개월 전 | 597 | |
| 2572 | 9개월 전 | 545 | ||
| 2571 | 9개월 전 | 590 | ||
| 2570 |
두리삼촌v
|
9개월 전 | 627 | |
| 2569 |
두리삼촌v
|
9개월 전 | 656 | |
| 2568 |
두리삼촌v
|
9개월 전 | 451 | |
| 2567 |
두리삼촌v
|
9개월 전 | 433 | |
| 2566 | 9개월 전 | 729 | ||
| 2565 | 9개월 전 | 656 | ||
| 2564 | 9개월 전 | 463 | ||
| 2563 | 10개월 전 | 1017 | ||
| 2562 |
|
10개월 전 | 666 | |
| 2561 | 10개월 전 | 908 | ||
| 2560 | 10개월 전 | 645 | ||
| 2559 |
|
10개월 전 | 495 | |
| 2558 | 10개월 전 | 648 | ||
| 2557 | 10개월 전 | 944 | ||
| 2556 | 10개월 전 | 1323 | ||
| 2555 | 10개월 전 | 740 | ||
| 2554 |
|
10개월 전 | 735 | |
| 2553 | 10개월 전 | 663 | ||
| 2552 | 10개월 전 | 854 | ||
| 2551 | 10개월 전 | 753 | ||
| 2550 |
|
10개월 전 | 707 | |
| 2549 | 10개월 전 | 1015 | ||
| 2548 | 10개월 전 | 660 | ||
| 2547 | 10개월 전 | 1192 | ||
| 2546 | 10개월 전 | 651 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기