팝업 관련 파일을 하나로 통합, 레이어 적용
1. index.php 아래 부분 수정
//include "$g4[shop_path]/newwin.inc.php"; // 새창띄우기
include "$g4[shop_path]/popup.inc.php"; // 새창띄우기
2. shop/popup.inc.php 파일 생성
<?
include_once("./_common.php");
include_once("./_common.php");
$sql = " select * from $g4[yc4_new_win_table] where '$g4[time_ymdhis]' between nw_begin_time and nw_end_time order by nw_id asc ";
$result = sql_query($sql);
$result = sql_query($sql);
for ($i=0; $row_nw=sql_fetch_array($result); $i++) {
// 이미 체크 되었다면 Continue
if ($_COOKIE["ck_notice_{$row_nw[nw_id]}"])
continue;
// 이미 체크 되었다면 Continue
if ($_COOKIE["ck_notice_{$row_nw[nw_id]}"])
continue;
$j = $i + 1;
$sql = " select * from $g4[yc4_new_win_table] where nw_id = '$row_nw[nw_id]' ";
$nw = sql_fetch($sql);
$nw = sql_fetch($sql);
$nw[nw_subject] = get_text($nw[nw_subject]);
$nw[nw_content] = conv_content($nw[nw_content], 1);
?>
$nw[nw_content] = conv_content($nw[nw_content], 1);
?>
<script language="Javascript">
<!--
function setCookie_<?=$nw[nw_id]?>( name, value, expiredays ) {
var todayDate = new Date();
<!--
function setCookie_<?=$nw[nw_id]?>( name, value, expiredays ) {
var todayDate = new Date();
todayDate.setDate( todayDate.getDate() + expiredays );
document.cookie = name + "=" + escape( value ) + "; path=/; expires=" + todayDate.toGMTString() + ";"
}
document.cookie = name + "=" + escape( value ) + "; path=/; expires=" + todayDate.toGMTString() + ";"
}
function closeWin_<?=$nw[nw_id]?>() {
if ( document.notice_form_<?=$nw[nw_id]?>.chkbox.checked ){
setCookie_<?=$nw[nw_id]?>( "ck_notice_<?=$nw[nw_id]?>", "done", <?=$nw[nw_disable_hours]?>);
}
if ( document.notice_form_<?=$nw[nw_id]?>.chkbox.checked ){
setCookie_<?=$nw[nw_id]?>( "ck_notice_<?=$nw[nw_id]?>", "done", <?=$nw[nw_disable_hours]?>);
}
document.all['divpop_<?=$row_nw[nw_id]?>'].style.visibility = "hidden";
}
//-->
</script>
}
//-->
</script>
<div id="divpop_<?=$row_nw[nw_id]?>" style="position:absolute; width:<?=$nw[nw_width]?>px; height:<?=$nw[nw_height]?>px; left:<?=$nw[nw_left]?>px; top:<?=$nw[nw_top]?>px; z-index:<?=$j?>; visibility:hidden;">
<table width="<?=$nw[nw_width]?>" height="<?=($nw[nw_height]+25)?>" cellpadding="0" cellspacing="0" border="0">
<tr>
<td height="<?=$nw[nw_height]?>" bgcolor="#ffffff" style="border:1px #eeeeee solid" align="center"><?=conv_content($nw[nw_content], $nw[nw_content_html]);?></td>
</tr>
<form name="notice_form_<?=$nw[nw_id]?>">
<tr>
<td height="25" align="right" bgcolor="#dddddd"><input type="checkbox" name="chkbox" value="checkbox">오늘 하루 이 창을 열지 않음 <a href="javascript:closeWin_<?=$nw[nw_id]?>();"><b>[닫기]</b></a> </td>
</tr>
</form>
</table>
</div>
<table width="<?=$nw[nw_width]?>" height="<?=($nw[nw_height]+25)?>" cellpadding="0" cellspacing="0" border="0">
<tr>
<td height="<?=$nw[nw_height]?>" bgcolor="#ffffff" style="border:1px #eeeeee solid" align="center"><?=conv_content($nw[nw_content], $nw[nw_content_html]);?></td>
</tr>
<form name="notice_form_<?=$nw[nw_id]?>">
<tr>
<td height="25" align="right" bgcolor="#dddddd"><input type="checkbox" name="chkbox" value="checkbox">오늘 하루 이 창을 열지 않음 <a href="javascript:closeWin_<?=$nw[nw_id]?>();"><b>[닫기]</b></a> </td>
</tr>
</form>
</table>
</div>
<script language="Javascript">
cookiedata = document.cookie;
cookiedata = document.cookie;
if ( cookiedata.indexOf("ck_notice_<? echo $nw[nw_id] ?>=done") < 0 ){
document.all['divpop_<?=$row_nw[nw_id]?>'].style.visibility = "visible";
} else {
document.all['divpop_<?=$row_nw[nw_id]?>'].style.visibility = "hidden";
}
</script>
document.all['divpop_<?=$row_nw[nw_id]?>'].style.visibility = "visible";
} else {
document.all['divpop_<?=$row_nw[nw_id]?>'].style.visibility = "hidden";
}
</script>
<?
}
?>
}
?>
댓글 6개
게시글 목록
| 번호 | 제목 |
|---|---|
| 1534 | |
| 1526 | |
| 1518 | |
| 1516 | |
| 1515 | |
| 1501 | |
| 1498 | |
| 1496 | |
| 1491 | |
| 1488 | |
| 1487 | |
| 1481 | |
| 1473 | |
| 1472 | |
| 1466 | |
| 1462 | |
| 1450 | |
| 1449 | |
| 1447 | |
| 1446 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기