테스트 사이트 - 개발 중인 베타 버전입니다

브레스웹님의 팝업(POPUP)창 게시판에서 팝업 여러개 띄우기

· 19년 전 · 6555 · 18
브레스웹님의 팝업창 게시판을 너무나 고맙게 쓰던 중 부득이 하게 여러개의 팝업창을 띄워야만 해서 고쳐 보았습니다.

원본 파일 및 설치 방법은 아래 브레스웹님의 원글을 참조하시고...
http://www.sir.co.kr/bbs/board.php?bo_table=g4_skin&wr_id=4084&sca=&sfl=wr_subject%7C%7Cwr_content&stx=%C6%CB%BE%F7&sop=and&page=2


브레스웹님의 첨부파일을 다운로드 받아 설치 하신 후에
./skin/latest/popup_latest/latest.skin.php 파일을 아래 소스로 바꾸시기 바랍니다.

많이 고친 것은 아니고 레이어창의 이름과 쿠키명을 글의 고유번호로 서로 구분하게 하였습니다.
이리저리 고치다가 지우다가 해서 원본과 얼마나 다른지 몰라 있는 소스를 모두 올립니다.

다만, 모든 레이어에 대한 드래그&드롭이 하나만 되고 다른 것은 잘 안되는 것이 흠이라면 흠입니다.
이 부분도 알게 되면 다시 올리겠습니다.

소스

<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
?>

<?
for ($i=0; $i<count($list); $i++)
{
if ($i > 0)
$title = get_text($list[$i][wr_subject]);
$content = nl2br($list[$i][wr_content]);
$wr_id = "pop".$list[$i][wr_id] ;
$ileft = $i +$i +$i +$i +$i +$i +$i +$i + 50;
$itop = $i +$i +$i +$i +$i +$i +$i +$i + 300;
$img = "$g4[path]/data/file/$bo_table/".urlencode($list[$i][file][0][file]);

if (!file_exists($img) || !$list[$i][file][0][file])
echo "";
if ($list[$i][wr_1] == "실행")
{

?>

<SCRIPT language=javascript>
<!--
clicked = false;

function startDrag<?=$wr_id?>(cx,cy) {
clicked = true;
pleft=parseInt(document.getElementById("<?=$wr_id?>").style.left);
ptop=parseInt(document.getElementById("<?=$wr_id?>").style.top);
dragxcoor=cx;
dragycoor=cy;
}

function stopDrag<?=$wr_id?>() {
clicked = false;
}

function dragBox<?=$wr_id?>(evt) {
e = evt || event;
if (clicked == true) {
newx = pleft+e.clientX-dragxcoor;
newy = ptop+e.clientY-dragycoor;
document.getElementById("<?=$wr_id?>").style.left=newx;
document.getElementById("<?=$wr_id?>").style.top=newy;
// return false;
}
}
document.onmousemove = dragBox<?=$wr_id?>;
-->
</SCRIPT>

<script language="JavaScript">
<!--
function setCookie<?=$wr_id?>( name, value, expiredays ) {
var todayDate = new Date();
todayDate.setDate( todayDate.getDate() + expiredays );
document.cookie = name + "=" + escape( value ) + "; path=/; expires=" + todayDate.toGMTString() + ";"
}

function closeWin<?=$wr_id?>() {
if ( document.notice_form<?=$wr_id?>.chkbox.checked ){
setCookie<?=$wr_id?>( "<?=$wr_id?>", "done" , 1 );
}

document.all['<?=$wr_id?>'].style.visibility = "hidden";
}
//-->
</script>


<div id="<?=$wr_id?>" style="position:absolute; left:<?=$ileft?>px; top:<?=$ileft?>; z-index:200; visibility:visible; display:table; cursor:move" onmousedown="startDrag<?=$wr_id?>(event.clientX,event.clientY)" onmouseup="stopDrag<?=$wr_id?>()">

<table border='0' cellspacing='0' cellpadding='0' bgcolor="#FFFFFF">
<tr>
<td width='7'><img src='<?=$latest_skin_path?>/img/bg_01.gif' width='7' height='31'></td>
<td background='<?=$latest_skin_path?>/img/bg_04.gif'><img src='<?=$latest_skin_path?>/img/bg_02.gif' width='97' height='31'></td>
<td background='<?=$latest_skin_path?>/img/bg_04.gif'><div align='right'><img src='<?=$latest_skin_path?>/img/bg_06.gif' width='114' height='31'></div></td>
<td width='7'><img src='<?=$latest_skin_path?>/img/bg_07.gif' width='7' height='31'></td>
</tr>
<tr>
<td background='<?=$latest_skin_path?>/img/bg_22.gif'><img src='<?=$latest_skin_path?>/img/bg_22.gif' width='7' height='1'></td>
<td colspan='2' valign='top'>
<?
if ($list[$i][file][0][file])
{
echo "<a href={$list[$i][wr_link1]} target={$list[$i][wr_2]}><img src='{$img}' border='0'></a>";
}
else
{
echo "<table width='367' border='0' cellspacing='0' cellpadding='0'>";
echo "<tr>";
echo "<td width='23'><img src='{$latest_skin_path}/img/bg_09.gif' width='23' height='27'></td>";
echo "<td width='320' background='{$latest_skin_path}/img/bg_11.gif'><div align='center'><img src='{$latest_skin_path}/img/bg_11.gif' width='1' height='27'></div></td>";
echo "<td width='24'><img src='{$latest_skin_path}/img/bg_13.gif' width='24' height='27'></td>";
echo "</tr>";
echo "<tr>";
echo "<td background='{$latest_skin_path}/img/bg_23.gif'><img src='{$latest_skin_path}/img/bg_23.gif' width='23' height='1'></td>";
echo "<td valign='top'>";
echo "<table width=100% border=0 cellspacing=0 cellpadding=0 align=center>";
echo "<tr><td height=25><font color=#416B01>♣&nbsp;<b>{$list[$i][wr_subject]}</b></font></td><td align=right>{$list[$i][datetime]}</td></tr>";
echo "<tr><td height=1 colspan=2 bgcolor=#cccccc></td></tr>";
echo "<tr><td height=2 colspan=2 bgcolor=#efefef></td></tr>";
echo "<td valign=top colspan=2 style=padding-top:10px;>{$content}</td>";
echo "</tr>";
echo "</table>";
echo "</td>";
echo "<td background='{$latest_skin_path}/img/bg_19.gif'><img src='{$latest_skin_path}/img/bg_19.gif' width='24' height='8'></td>";
echo "</tr>";
echo "<tr>";
echo "<td><img src='{$latest_skin_path}/img/bg_26.gif' width='23' height='66'></td>";
echo "<td background='{$latest_skin_path}/img/bg_28.gif'><img src='{$latest_skin_path}/img/bg_27.gif' width='320' height='66'></td>";
echo "<td><img src='{$latest_skin_path}/img/bg_29.gif' width='24' height='66'></td>";
echo "</tr>";
echo "</table>";
}
?>
</td>
<td background='<?=$latest_skin_path?>/img/bg_18.gif'><img src='<?=$latest_skin_path?>/img/bg_18.gif' width='7' height='1'></td>
</tr>
<tr>
<td><img src='<?=$latest_skin_path?>/img/bg_30.gif' width='7' height='31'></td>
<td colspan='2' background='<?=$latest_skin_path?>/img/bg_32.gif'>
<form name="notice_form<?=$wr_id?>">
<table width='256' border='0' cellspacing='0' cellpadding='0' align='right'>
<tr>
<td width="20"><a href="#"><input type="checkbox" name="chkbox" value="checkbox" onclick="closeWin<?=$wr_id?>();"></a></td>
<td width="167">24시간 동안 이 창을 열지 않음</td>
<td width="67"><a href="javascript:closeWin<?=$wr_id?>();"><img src='<?=$latest_skin_path?>/img/bg_34.gif' width='67' height='31' align='absmiddle' border='0'></a></td>
</tr>
</table>
</form>
</td>
<td>
<img src='<?=$latest_skin_path?>/img/bg_35.gif' width='7' height='31'>
</td>
</tr>
</table>

</div>

<script language="Javascript">
cookiedata = document.cookie;
if ( cookiedata.indexOf("<?=$wr_id?>=done") < 0 ){
document.all['<?=$wr_id?>'].style.visibility = "visible";
}
else {
document.all['<?=$wr_id?>'].style.visibility = "hidden";
}
</script>


<?
}
?>

<?
}
?>

댓글 작성

댓글을 작성하시려면 로그인이 필요합니다.

로그인하기

댓글 18개

19년 전
팝업창관련
18년 전
감사합니다.
좋습니다.
18년 전
좋네요 ^^
17년 전
언젠가는 필요할듯....일단 스크랩
17년 전
감사해요
어렵다..
감사합니다.

게시글 목록

번호 제목
2771
2767
2763
2762
2758
2752
2751
2736
2728
2718
2707
2703
2679
2675
2664
2663
2647
2639
2615
2608