게시판을 팝업창으로 띠우는 방법문의 입니다. > 그누4 질문답변

매출이 오르면 내리는 수수료! 지금 수수료센터에서 전자결제(PG)수수료 비교견적 신청해 보세요!

그누4 질문답변

그누보드4 관련 질문은 QA 로 이전됩니다. QA 그누보드4 바로가기
기존 게시물은 열람만 가능합니다.

게시판을 팝업창으로 띠우는 방법문의 입니다. 정보

게시판을 팝업창으로 띠우는 방법문의 입니다.

본문

홈페이지에 팝업창을 띠우라는 주문이 많아서 통합공지창을 만들어 이용중입니다..
 
head.sub.php 에 아래와 같은 내용은 넣고
 

<SCRIPT LANGUAGE="JavaScript"> 
<!-- 
function getCookie( name ){ 
var nameOfCookie = name + "="; 
var x = 0; 
while ( x <= document.cookie.length ) 

var y = (x+nameOfCookie.length); 
if ( document.cookie.substring( x, y ) == nameOfCookie ) { 
if ( (endOfCookie=document.cookie.indexOf( ";", y )) == -1 ) 
endOfCookie = document.cookie.length; 
return unescape( document.cookie.substring( y, endOfCookie ) ); 

x = document.cookie.indexOf( " ", x ) + 1; 
if ( x == 0 ) 
break; 

return ""; 
//폼의 체크 박스를 체그 하면 새창이 나타나지 않으며, 체크 하지 않았을 경우, 계속 나타납니다. 
if ( getCookie( "Notice" ) != "done" ) { 
//새창으로 열릴 페이지의 경로 및 크기와 위치를 지정해 주세요. 
noticeWindow  =  window.open('http://www.cjseowon.ms.kr/g411/popup.php','_blank','width=400,height=500,top=50,left=150,scrollbars=yes'); 
noticeWindow.opener = self; } 
// --> 
</SCRIPT>
 
popup.php 를 아래와 같이 하였습니다..
 
<?
include_once("./_common.php");
$g4['title'] = "";
?>
<html>
<html>
<head>
<title>무제-1</title>
<meta http-equiv="Content-Type" content="text/html; charset=euc-kr">
<link rel="stylesheet" href="<?=$g4['path']?>/style_pop.css" type="text/css">
<script language="JavaScript">
<!--
function OpenWin(url,intWidth,intHeight){
      window.open(url, "ReadSlideShow", "scrollbars=yes resizable=yes, width="+intWidth+",height="+intHeight+" ");
      return;
}
//-->
</script>
<SCRIPT language="JavaScript"> 
<!-- 
function setCookie( name, value, expiredays ) 

var todayDate = new Date(); 
todayDate.setDate( todayDate.getDate() + expiredays ); 
document.cookie = name + "=" + escape( value ) + "; path=/; expires=" + todayDate.toGMTString() + ";" 
function closeWin() 

if ( document.pop.Notice.checked ) 
setCookie( "Notice", "done" , 1);//1은 하루동안 새창을 열지 않게 합니다. 
window.close(); 

// --> 
</SCRIPT> 
</head>
<body onunload="closeWin()" bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<!-- ImageReady Slices (무제-1) -->
<table id="__01" width="377" height=500 border="0" cellpadding="0" cellspacing="0">
 <tr>
  <td valign=top width="27" height="94">
   <img src="images/popup_01.gif" width="27" height="94" alt=""></td>
  <td>
   <img src="images/popup_02.gif" width="24" height="94" alt=""></td>
  <td>
   <img src="images/popup_03.gif" width="310" height="94" alt=""></td>
  <td valign=top width="16" height="94">
   <img src="images/popup_04.gif" width="16" height="94" alt=""></td>
 </tr>
 <tr><td colspan=4 valign=top align=left background="images/bg.gif" width="377">
 
 
 <table id="__01" width="377" border="0" cellpadding="0" cellspacing="0">
 <!--여기부터복사하여 계속 추가-->
 <tr>
  <td width="27">
   </td>
  <td>
   <img src="images/popup_06.gif" width="24" height="35" alt=""></td>
  <td width="310" height="35">
   <a style="vertical-align: middle;cursor:pointer;"onClick="OpenWin('http://www.cjseowon.ms.kr/g411/popup/event_20070331.html',720,600); return false;">청소년 지킴이 서비스 안내</a></td>
  <td width="16">
   </td>
 </tr>
 <!--여기까지 추가 복사끝-->
 <!--여기부터복사하여 계속 추가-->
 <tr>
  <td width="27">
  </td>
  <td align=center valign=middle>
   <img src="images/popup_06.gif" width="24" height="35" alt=""></td>
  <td>
   <a style="vertical-align: middle;cursor:pointer;"onClick="OpenWin('http://www.cjseowon.ms.kr/g411/popup/pp4.html',420,340); return false;">학교폭력 자진신고 및 집중단속기간</a></td>
  <td width="16">
  </td>
 </tr>
 <!--여기까지 추가 복사끝-->
 <!--여기부터복사하여 계속 추가-->
 <tr>
  <td width="27">
  </td>
  <td align=center valign=middle>
   <img src="images/popup_06.gif" width="24" height="35" alt=""></td>
  <td>
   <a style="vertical-align: middle;cursor:pointer;"onClick="OpenWin('http://www.cjseowon.ms.kr/g411/popup/break.html',490,300); return false;">학교폭력 캠페인</a></td>
  <td width="16">
  </td>
 </tr>
 <!--여기까지 추가 복사끝-->
 <!--여기부터복사하여 계속 추가-->
 <tr>
  <td width="27">
   </td>
  <td>
   <img src="images/popup_06.gif" width="24" height="35" alt=""></td>
  <td width="310" height="35">
   <a style="vertical-align: middle;cursor:pointer;"onClick="OpenWin('http://www.cjseowon.ms.kr/g411/popup/infor.php',470,430); return false;">오늘은 개인정보 보호의 날</a></td>
  <td width="16">
   </td>
 </tr>
 <!--여기까지 추가 복사끝-->
 <!--여기부터복사하여 계속 추가-->
 <tr>
  <td width="27">
   </td>
  <td>
   <img src="images/popup_06.gif" width="24" height="35" alt=""></td>
  <td width="310" height="35">
   <a style="vertical-align: middle;cursor:pointer;"onClick="OpenWin('http://www.cjseowon.ms.kr/g411/gnusr/doc/contents.html',670,677); return false;">[부총리 서한문] 2008 입시관련 국민 여러분께 드리는 글
 
</a></td>
  <td width="16">
   </td>
 </tr>
 <!--여기까지 추가 복사끝-->
 
 <!--여기부터복사하여 계속 추가-->
 <tr>
  <td width="27">
  </td>
  <td align=center valign=middle>
   <img src="images/popup_06.gif" width="24" height="35" alt=""></td>
  <td>
   <a style="vertical-align: middle;cursor:pointer;"onClick="OpenWin('http://www.cjseowon.ms.kr/g411/popup/event.html',360,380); return false;">주민등록번호 부정사용 안내문</a></td>
  <td width="16">
  </td>
 </tr>
 <!--여기까지 추가 복사끝-->
 <!--여기부터복사하여 계속 추가-->
 <tr>
  <td width="27">
  </td>
  <td align=center valign=middle>
   <img src="images/popup_06.gif" width="24" height="35" alt=""></td>
  <td >
   <a style="vertical-align: middle;cursor:pointer;"onClick="OpenWin('http://www.cjseowon.ms.kr/g411/popup/4.gif',660,500); return false;">부당발전기금 신고 안내</a></td>
  <td width="16">
  </td>
 </tr>
 <!--여기까지 추가 복사끝-->
 <!--여기부터복사하여 계속 추가-->
 <tr>
  <td width="27">
  </td>
  <td align=center valign=middle>
   <img src="images/popup_06.gif" width="24" height="35" alt=""></td>
  <td >
   <a style="vertical-align: middle;cursor:pointer;"onClick="OpenWin('http://www.cjseowon.ms.kr/g411/popup/p.html',380,400); return false;">과학의날/과학주간축제한마당</a></td>
  <td width="16">
  </td>
 </tr>
 <!--여기까지 추가 복사끝-->
 
 </table>
 
 </td></tr>
 
 <tr>
  <td valign=bottom width="27" height="67">
   <img src="images/popup_13.gif" width="27" height="67" alt=""></td>
  <td valign=bottom width="24" height="67">
   <img src="images/popup_14.gif" width="24" height="67" alt=""></td>
  <td>
   <img src="images/popup_15.gif" width="310" height="67" alt=""></td>
  <td valign=bottom width="16" height="67">
   <img src="images/popup_16.gif" width="16" height="67" alt=""></td>
 </tr>   
 <tr>
  <td>
   <img src="images/popup_17.gif" width="27" height="41" alt=""></td>
  <td>
   <img src="images/popup_18.gif" width="24" height="41" alt=""></td>
  <td background="images/popup_19.gif" width="310" height="41">
  <form name=pop> 
<input type=checkbox name="Notice" value="">다음부터 띄우지 않음<a href="javascript:history.onclick=closeWin()"><img src="images/close1.gif"  alt="" align="absmiddle"></a>   
  </td>
  <td>
   <img src="images/popup_20.gif" width="16" height="41" alt=""></td>
 </tr>
</table>
</form>
<!-- End ImageReady Slices -->
</body>
</html>
 
홈페이지에 입장하면 현재는 잘 작동하고 있습니다...
 
그런데 매번 popup.php 를 수정해야해서.....poup.php  대신에 게시판을 띠우고 게시판은 리스트를 클릭하면 글보기화면이 새창으로 뜨게하려고 합니다...
 
그러네데 popup.php 의 주소 대신에 게시판주소로만 바꾸어서는 안되네요..
팝업창이 수도 없이 뜨네요..
 
어찌하면 되나요

댓글 전체

아하...
게시판을 쓰면되겠군요^^,

위에서 연속으로 팝업이 뜨는이유는,
head.sub.php파일에 팝업관련 스크립트를 넣었기 때문입니다^^
head.sub.php파일은, 보드 본체에도, 삽입이되기때문에
무한창이 뜨는것이지요^^

그러지마시고^^ 메인 페이지에다가 해당스크립트를 넣으시고,
아까 처럼 게시판을 삽입해보시면 무한창으로 안뜰겁니다^^
예...답변감사합니다..

그래서 index.php 에 head.sub.php 에 넣어던 소스를 넣으니 무한창은 뜨지 않는데..

하단의 클릭하면 다음부터 창을 띠우지 않음...요것은 어디에 넣어야하나요..

게시판의상단파일과  하단파일 넣는곳에 넣었더디 작동을 하지 않는군요
하하^^ 게시판에 넣지 마시구, 보드용 tail 파일을 따로 만들어 보세요^^
그리고 보드스킨의 tail파일을 연결해주시면 해결될듯하네요^^
전체 66,558 |RSS
그누4 질문답변 내용 검색

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1404호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT