묻고답하기

공지를 팝업창으로 띄우고자합니다.
공지 게시판이 두개인 관계로 따로 따로 동시애 두개를 띄우고자 합니다.

아래소스로 1개는 팝업이 되는데 두개를 동시애 띄우고자하니까 계속에로가 납니다.

두개를 동시에 띄우는 방법이 있으면 알려주시기 바랍니다.

</body>
<?include "/home/user/public_html/util/popup/popup.php";?>
</html>

=============  popup.php  ===========

<?

// 공지창을 띄울 페이지에 인클루드 시키시면 됩니다.

//////////////////////////////// 수정할 부분 ////////////////////////////////

$db_id = ""; // DB 아이디
$db_pass = ""; // DB 비밀번호
$db_name = ""; // DB 이름
$board_id = ""; // 공지사항 게시판 아이디
$zboard_url = "http://domain.com/zboard/"; // 제로보드 URL
//$win_width = 300; // 팝업창 가로(픽셀)
//$win_height = 400; // 팝업창 세로(픽셀)
$subject_cut = 50; // 제목 잘릴 길이
$memo_cut = 300; // 내용 잘릴 길이

//////////////////////////// 여기까지 수정 끝. //////////////////////////////


mysql_connect("localhost",$db_id,$db_pass) || die("sql에 연결실패");
mysql_select_db($db_name);

// 최근 게시물 하나만 팝업.(팝업 안열리게 하려면 게시물을 삭제해야 되므로 불편함)
//$result=mysql_query("select * from zetyx_board"."_$board_id order by no desc limit 1") or error(mysql_error());

// 공지사항에 체크된 최근 게시물 한개만 팝업 공지창 열리고...체크 해제하면 안 뜨게 하시려는 경우.(편리함)
$result=mysql_query("select * from zetyx_board"."_$board_id where headnum<=-2000000000 order by headnum asc limit 1") or error(mysql_error());

$rows = mysql_num_rows($result);
$notice = mysql_fetch_array($result);
$now_date_time = mktime();

function cut_text($msg,$cut_size) { // 글 자르기 함수 lib.php의 str_cut과 동일, outlogin 사용과의 충돌을 피함
        if($cut_size<=0) return $msg;
        if(ereg("[re]",$msg)) $cut_size=$cut_size+4;
        for($i=0;$i<$cut_size;$i++) if(ord($msg[$i])>127) $han++; else $eng++;
        $cut_size=$cut_size+(int)$han*0.6;
        $point=1;
        for ($i=0;$i<strlen($msg);$i++) {
                if ($point>$cut_size) return $pointtmp."...";
                if (ord($msg[$i])<=127) {
                        $pointtmp.= $msg[$i];
                        if ($point%$cut_size==0) return $pointtmp."...";
                } else {
                        if ($point%$cut_size==0) return $pointtmp."...";
                        $pointtmp.=$msg[$i].$msg[++$i];
                        $point++;
                }
                $point++;
        }
        return $pointtmp;
}

//if($rows && ($now_date_time - $notice[reg_date] <= 24*3600)){        
if($rows && ($notice[no])){        
                $no = $notice[no];                        
                $subject = stripslashes(cut_text($notice[subject],$subject_cut));
                $memo = stripslashes(cut_text($notice[memo],$memo_cut));
                $memo = stripslashes(str_replace("n","<br>",$memo));                
                $memo = stripslashes(str_replace("r","",$memo));
                $memo = addslashes($memo);
//                $memo_temp = "<a href=$zboard_url";                
//                $memo = $memo_temp."view.php?id=$board_id&no=$no target=window.opener onclick=window.close();>$memo</a>";                
//                $more = "<a href=/zboard/view.php?id=$board_id&no=$no target=opener.location.href onclick=window.close();>more</a>";        
                $more = ""/zboard/view.php?id=$board_id&no=$no";";        
                $reg_date = date("Y-m-d",$notice[reg_date]);                
                if($notice[file_name1])
                        $file1 = "<a href=$zboard_url$notice[file_name1] target=_blank>파일1</a>  ";
                if($notice[file_name2])
                        $file2 = "<a href=$zboard_url$notice[file_name2] target=_blank>파일2</a>  ";
                if($notice[sitelink1])
                        $link1 = "<a href=$notice[sitelink1] target=_blank>링크1</a>  ";
                if($notice[sitelink2])
                        $link2 = "<a href=$notice[sitelink2] target=_blank>링크2</a>  ";
                //echo("$memo");        
?>        

<script language='javascript'>

function getCookie(name)
        {
      var Found ;
      Found = false ;
      var start, end ;
      var i = 0 ;
      // cookie 문자열 전체를 검색
      
      while(i <= document.cookie.length){
            start = i ;
            end = start + name.length ;
            // name과 동일한 문자가 있다면
            if(document.cookie.substring(start, end) == name) {
                  //Found = true ;
                                  return true;
                  break ;
            }
            i++ ;
      }

      // name 문자열을 cookie에서 찾았다면
      if(Found == true)
      {
            start = end + 1 ;
            end = document.cookie.indexOf(';', start) ;
            // 마지막 부분이라는 것을 의미(마지막에는 ";"가 없다)
            if(end < start)
                  end = document.cookie.length ;
            // name에 해당하는 value값을 추출하여 리턴한다.
            return document.cookie.substring(start, end) ;
       } else {
      // 찾지 못했다면
      return '' ;
        }
        }
// $board_id,$no
if (getCookie('<?=$no?>') != true) {
        popwin = window.open('','_blank','left=0, top=0,menubar=no,toolbar=no,directories=no,location=no,status=no,scrollbars=yes,resizable=yes,width=450,height=350')
        popwin.document.write('<html><head><title>공/지/사/항 :: domain.com ::</title>n')
        popwin.document.write('<meta http-equiv="Content-Type" content="text/html; charset=euc-kr">n')
    popwin.document.write('<script>function ss_more(){opener.parent.location=<?=$more?>  window.close();}</script>n')
        popwin.document.write('<script language="javascript">n')
        popwin.document.write('function controlCookie(elemnt) {n')
        popwin.document.write('setCookie("<?=$no?>","y", 1)n')
        popwin.document.write('self.close();n')
        popwin.document.write('        }n')        
        popwin.document.write('function setCookie(name, value, expire) {n')//쿠키 생성 함수
        popwin.document.write('var expire_date = new Date()n')
        popwin.document.write('expire_date = new Date(expire_date.getTime() + 60*60*24*1000)n')
        popwin.document.write('document.cookie = name + "=" + escape(value) + "; expires=" + expire_date.toGMTString() +"; path=/"; n')
        popwin.document.write('self.close();n')
        popwin.document.write('        }n')
        popwin.document.write('function clearCookie(name) {n')//쿠키 소멸 함수
        popwin.document.write('var today = new Date()n')
        popwin.document.write('var expire_date = new Date(today.getTime() - 60*60*24*1000)n')//어제 날짜를 쿠키 소멸 날짜로 설정한다.
        popwin.document.write('document.cookie = name + "= " + "; expires=" + expire_date.toGMTString()n')
        popwin.document.write('}n')        
        popwin.document.write('</script>n')
        popwin.document.write('</head>n')                
        popwin.document.write('<body bgcolor=white text=black link=blue vlink=purple alink=red topmargin=5 marginheight=5 leftmargin=5 marginwidth=5>n')
        popwin.document.write('<table align=center cellpadding=0 cellspacing=0 width=100% height=100%><tr><td width=100% height=100%>n')
        popwin.document.write('<table align=center border=1 cellspacing=0 width=100% height=100% bordercolor=#CCCCCC bordercolordark=white bordercolorlight=#CCCCCC>n')
        popwin.document.write('<tr><td width=100% height=30 bgcolor=#E2E2C8 align=center><b><font size=3 color=blue><?=$subject?></font></b></td></tr>n')
        popwin.document.write('<tr><td width=100% height=20 valign=top align=right><span style=font-size:9pt;><font color=maroon><?=$file1?><?=$file2?><?=$link1?><?=$link2?></font>  <font color=#333333><b>Date : <?=$reg_date?></b></font></span>  </font></td></tr>n')
        popwin.document.write('<tr><td width=100% valign=top style=padding:5;><font style=font-size:11pt;><?=$memo?></font><br><br><div align=right><a href="javascript:ss_more();"><font color=#0066cc style=text-decoration:none;>☞ <b>more</b></font></a>  </div></td></tr>n')
        popwin.document.write('<tr><td width=100% height=20 align=center><font style=font-size:11pt;><b>하루 동안 이창 열지 않음</b> </font><input type=checkbox  onClick="controlCookie(this);">     <a href="#" onClick=window.close();><img src=/images/close2.gif width=62 height=22 align=absmiddle border=0></a><!--<input type=button value="닫기"  onclick=window.close();>--></td></tr>n')
        popwin.document.write('</table></td></tr></table></body></html>n')
}
</script>
<?}else{?><?}?>
글쓴이 제목 최종 글
XE 공지 글 쓰기,삭제 운영방식 변경 공지 [16] 2019.03.05 by 남기남
여기요 폼메일 전송했을 때 한글 깨짐현상  
느까끼 회원관리 가입폼 수정에 관한 요청  
이쁜쩡이 블로그에서 최근게시글이나 덧글 클릭시 해당 게시글로 링크가 가지 않습니다.  
서희웅 네이버맵 관련해서...  
blueq sub menu가 안보입니다 [4] 2007.09.13
skylish 로그인 위젯에 포인트를 표시하고 싶습니다. [1] 2007.09.14
하이트라 layout 파일에서 외부 php파일 include는 어떻게 하는지요? [1] 2007.09.14
JUNS 특정 JPG 사진화일이 첨부가 안되는 증상발생했어요~  
피아노맨 권한 설정에 관하여...  
TommyLee 최근게시물 글을 클릭했을때 브라우저 제목에 #숫자가 붙어요~ㅠㅠ [3] 2007.09.13
jmygeni [질문]제로보드 XE 설치시 PHP 5.2.2를 업그래이드  
초보 위젯사용법에 관하여..  
파파민 [완료] 위젯 특정그룹 회원출력에서 정렬 변경 방법? [4] file 2007.09.10
홍복기 제로보드 업로드가 안되요. [3] file 2007.09.14
리콜제로 게시판 작성자 안보기게 설장 방법좀 알려주세요  
공장장™ 비밀글 확장변수 문제  
경천애인 시뮬즈님께 조회수 콘트롤 관련 문의 드립니다 ( 두번째 ) [2] 2007.09.14
로로넷 답변부탁드립니다.. -.-; 도대체 xe가 뭔지..쩝 [1] 2007.09.14
evan 소스보기 방지 방법 [1] 2007.09.14
EnJI 카페24 (cafe24)에서 제로보드 XE 설치하기 [3] 2007.09.13
프프 글쓰기 권한 이거 되게 웃기네요 조언바랍니다. [3] 2007.09.13
이충성 회원검색 프로그램을 만드는 방법좀...  
트루먼 "권한이 없습니다." 메세지의 위치는? file  
매니안 첨부된 이미지 자동 리사이징 관련 문제  
복실2 최근게시물 뽑아서 marquee 테그에서 뿌려주고 싶은데~~?? [2] file 2007.09.11
:에반: GNB 1차 메뉴 삭제하면 2차 메뉴도 안나오나요? [2] 2007.09.12
제렘이 설치할때 로그인창으로 다시 돌아가는 문제  
트루먼 naver_map popup창의 크기 조절은? [2] file 2007.09.11
핀잔 팝업창 2개띄우는 방법 좀 알고 싶습니다. [1] 2007.09.13
return 최근게시판 게시물 날자