기본 팝업레이어에 드래그 & 옵션추가(사용하기) (2017-03-24 수정) 정보
기본 팝업레이어에 드래그 & 옵션추가(사용하기) (2017-03-24 수정)관련링크
본문
그누보드5 기본 레이어 팝업의 기능 향상을 위한 팁입니다.
1. 레이어 팝업에 마우스로 드래그 기능 추가
2. 사용하기 / 사용안하기 체크기능 추가
3. 팝업레이어가 브라우저 왼쪽 상단부터 시작하기
1. 그누보드5 / bbs / newwin.inc.php 내용 수정
<!-- 팝업레이어 시작 { -->
를 아래와 같이 변경
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.3/jquery-ui.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$(".hd_pops").draggable();
});
</script>
<!-- 팝업레이어 시작 { -->
2. phpMyAdmin 에서 g5_new_win 테이블 필드 추가
nw_division 필드가 없는경우
ALTER TABLE `g5_new_win` ADD `nw_division` VARCHAR( 10 ) NOT NULL DEFAULT 'both';
nw_use 필드 추가
ALTER TABLE `g5_new_win` ADD `nw_use` CHAR( 1 ) NOT NULL DEFAULT '0';
2-1. 그누보드5 / adm / newwinlist.php 내용 추가
$g5['title'] = '팝업레이어 관리';
include_once (G5_ADMIN_PATH.'/admin.head.php');
를 아래와 같이 변경
sql_query("ALTER TABLE `g5_new_win` ADD `nw_division` VARCHAR( 10 ) NOT NULL DEFAULT 'both';");
sql_query("ALTER TABLE `g5_new_win` ADD `nw_use` CHAR( 1 ) NOT NULL DEFAULT '0';");
$g5['title'] = '팝업레이어 관리';
include_once (G5_ADMIN_PATH.'/admin.head.php');
2-2. 그누보드5 / adm / newwinlist.php
<th scope="col">제목</th>
<th scope="col">접속기기</th>
를 아래와 같이 변경
<th scope="col">제목</th>
<th scope="col">사용여부</th>
<th scope="col">접속기기</th>
2-3. 그누보드5 / adm / newwinlist.php
<td><?php echo $row['nw_subject']; ?></td>
<td class="td_device"><?php echo $nw_device; ?></td>
를 아래와 같이 변경
<td><?php echo $row['nw_subject']; ?></td>
<td class="td_num"><?php if ($row['nw_use']==1) { echo "Y"; } else { echo "N"; } ?></td>
<td class="td_device"><?php echo $nw_device; ?></td>
3. 그누보드5 / adm / newwinform.php 내용 추가
</tr>
<th scope="row">사용여부</th>
<td>
<input type="radio" name="nw_use" value="1" id="nw_use" <?php echo $nw['nw_use']==1?'checked':''; ?>>
<label for="nw_use_yes">사용</label>
<input type="radio" name="nw_use" value="0" id="nw_use_no" <?php echo $nw['nw_use']==0?'checked':''; ?>>
<label for="nw_use_no">사용중지</label>
</td>
</tr>
4. 그누보드5 / adm / newwinformupdate.php 내용 추가
nw_begin_time = '{$_POST['nw_begin_time']}',
를 아래와 같이 변경
nw_use = '{$_POST['nw_use']}',
nw_begin_time = '{$_POST['nw_begin_time']}',
5. 그누보드5 / bbs / newwin.inc.php 내용 수정
$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 ";
를 아래와 같이 변경
$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' ) and nw_use ='1'
order by nw_id asc ";
6. 그누보드5 / mobile / newwin.inc.php 내용 수정
$sql = " select * from {$g5['new_win_table']}
where '".G5_TIME_YMDHIS."' between nw_begin_time and nw_end_time
and nw_device IN ( 'both', 'mobile' )
order by nw_id asc ";
를 아래와 같이 변경
$sql = " select * from {$g5['new_win_table']}
where '".G5_TIME_YMDHIS."' between nw_begin_time and nw_end_time
and nw_device IN ( 'both', 'mobile' ) and nw_use ='1'
order by nw_id asc ";
7. 그누보드5 / theme / 테마 / css / default.css 의 26라인
#hd_pop {z-index:1000;position:relative;margin:0 auto;width:970px;height:0}
에서 width 값을 변경
#hd_pop {z-index:1000;position:relative;margin:0 auto;width:100%;height:0}
1. 레이어 팝업에 마우스로 드래그 기능 추가
2. 사용하기 / 사용안하기 체크기능 추가
3. 팝업레이어가 브라우저 왼쪽 상단부터 시작하기
1. 그누보드5 / bbs / newwin.inc.php 내용 수정
<!-- 팝업레이어 시작 { -->
를 아래와 같이 변경
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.3/jquery-ui.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$(".hd_pops").draggable();
});
</script>
<!-- 팝업레이어 시작 { -->
2. phpMyAdmin 에서 g5_new_win 테이블 필드 추가
nw_division 필드가 없는경우
ALTER TABLE `g5_new_win` ADD `nw_division` VARCHAR( 10 ) NOT NULL DEFAULT 'both';
nw_use 필드 추가
ALTER TABLE `g5_new_win` ADD `nw_use` CHAR( 1 ) NOT NULL DEFAULT '0';
2-1. 그누보드5 / adm / newwinlist.php 내용 추가
$g5['title'] = '팝업레이어 관리';
include_once (G5_ADMIN_PATH.'/admin.head.php');
를 아래와 같이 변경
sql_query("ALTER TABLE `g5_new_win` ADD `nw_division` VARCHAR( 10 ) NOT NULL DEFAULT 'both';");
sql_query("ALTER TABLE `g5_new_win` ADD `nw_use` CHAR( 1 ) NOT NULL DEFAULT '0';");
$g5['title'] = '팝업레이어 관리';
include_once (G5_ADMIN_PATH.'/admin.head.php');
2-2. 그누보드5 / adm / newwinlist.php
<th scope="col">제목</th>
<th scope="col">접속기기</th>
를 아래와 같이 변경
<th scope="col">제목</th>
<th scope="col">사용여부</th>
<th scope="col">접속기기</th>
2-3. 그누보드5 / adm / newwinlist.php
<td><?php echo $row['nw_subject']; ?></td>
<td class="td_device"><?php echo $nw_device; ?></td>
를 아래와 같이 변경
<td><?php echo $row['nw_subject']; ?></td>
<td class="td_num"><?php if ($row['nw_use']==1) { echo "Y"; } else { echo "N"; } ?></td>
<td class="td_device"><?php echo $nw_device; ?></td>
3. 그누보드5 / adm / newwinform.php 내용 추가
</tr>
<th scope="row">사용여부</th>
<td>
<input type="radio" name="nw_use" value="1" id="nw_use" <?php echo $nw['nw_use']==1?'checked':''; ?>>
<label for="nw_use_yes">사용</label>
<input type="radio" name="nw_use" value="0" id="nw_use_no" <?php echo $nw['nw_use']==0?'checked':''; ?>>
<label for="nw_use_no">사용중지</label>
</td>
</tr>
4. 그누보드5 / adm / newwinformupdate.php 내용 추가
nw_begin_time = '{$_POST['nw_begin_time']}',
를 아래와 같이 변경
nw_use = '{$_POST['nw_use']}',
nw_begin_time = '{$_POST['nw_begin_time']}',
5. 그누보드5 / bbs / newwin.inc.php 내용 수정
$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 ";
를 아래와 같이 변경
$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' ) and nw_use ='1'
order by nw_id asc ";
6. 그누보드5 / mobile / newwin.inc.php 내용 수정
$sql = " select * from {$g5['new_win_table']}
where '".G5_TIME_YMDHIS."' between nw_begin_time and nw_end_time
and nw_device IN ( 'both', 'mobile' )
order by nw_id asc ";
를 아래와 같이 변경
$sql = " select * from {$g5['new_win_table']}
where '".G5_TIME_YMDHIS."' between nw_begin_time and nw_end_time
and nw_device IN ( 'both', 'mobile' ) and nw_use ='1'
order by nw_id asc ";
7. 그누보드5 / theme / 테마 / css / default.css 의 26라인
#hd_pop {z-index:1000;position:relative;margin:0 auto;width:970px;height:0}
에서 width 값을 변경
#hd_pop {z-index:1000;position:relative;margin:0 auto;width:100%;height:0}
추천
4
4
댓글 7개
좋은 팁 감사합니다. ^^ 나중에 만들게 되면 적용해서 써야겠네요. 춛현 콰쾅!!!
사용하기 옵션이 없어서 무척 당황(?)해서 긴급 추가하게 되었습니다.
아하 그누에 옵션에 없어서 아쉬워는데 감사합니다. ^^
왠만하면 원본을 사용하고 싶지만, 없으면 맹글어서 사용해야죠 ^^
감사합니다.
팝업레이어 드래그&드롭
좋은팁 감사합니다..