그누보드 [G5] 저장된 아이피 변경하기
페이지 정보
본문
그누보드를 사용함에 있어서 저장된 아이피 정보를 일괄 변경하기 위해 만들었습니다.
1. 그누보드5 / adm / admin.menu990.php
2. 그누보드5 / adm / ip_rename / _common.php
3. 그누보드5 / adm / ip_rename / ip_rename.php
4. 그누보드5 / adm / ip_rename / ip_rename_update.php
기능이 대폭 개선된 프로그램을 https://sir.kr/cmall/1650348712 에서 판매중입니다
1. 그누보드5 / adm / admin.menu990.php
<?php
$menu["menu990"] = array (
array('990000', '추가기능', G5_ADMIN_URL.'/ip_rename/ip_rename.php', 'ETC'),
//array('990100', '활성도 통계', G5_ADMIN_URL.'/status/m3stats.php', 'm3stats'),
//array('990200', '팝업새창 관리', G5_ADMIN_URL.'/popup/popup_list.php', 'popup_blank'),
//array('990250', '팝업레이어 관리', G5_ADMIN_URL.'/popup/newwinlist.php', 'popup_layer'),
//array('990300', '메인배너관리', G5_ADMIN_URL.'/banner/main_banner_list.php', 'main_banner'),
//array('990310', '사이드배너관리', G5_ADMIN_URL.'/banner/aside_banner_list.php', 'side_banner'),
//array('990400', '출석부 환경설정', G5_ADMIN_URL.'/attendance/attendance_setup.php', 'attendance_setup'),
//array("990510", "날짜조회수관리", ''.G5_ADMIN_URL.'/board_admin/board_manage_etc_list.php', 'board_manage'),
//array('990520', '이미지 주소 변경', G5_ADMIN_URL.'/img_rename/img_rename.php', 'img_rename'),
array('990530', '아이피 변경', G5_ADMIN_URL.'/ip_rename/ip_rename.php', 'ip_rename'),
);
?>
2. 그누보드5 / adm / ip_rename / _common.php
<?php
define('G5_IS_ADMIN', true);
include_once ('../../common.php');
include_once(G5_ADMIN_PATH.'/admin.lib.php');
?>
3. 그누보드5 / adm / ip_rename / ip_rename.php
<?php
$sub_menu = "990530";
include_once('./_common.php');
auth_check($auth[$sub_menu], 'r');
if ($is_admin != 'super')
alert('최고관리자만 접근 가능합니다.');
$g5['title'] = 'IP 변경';
include_once ('../admin.head.php');
$pg_anchor = '<ul class="anchor">
<li><a href="#ip_delete">IP 변경</a></li>
</ul>';
$frm_submit = '<div class="btn_confirm01 btn_confirm">
<input type="submit" value="확인" class="btn_submit" accesskey="s">
<a href="'.G5_URL.'/">메인으로</a>
</div>';
?>
<div class="local_desc01 local_desc">
<p>IP 주소를 임의의 IP 주소로 변경됩니다.</p>
</div>
<form name="fconfigform" id="fconfigform" method="post" onsubmit="return fconfigform_submit(this);" enctype="MULTIPART/FORM-DATA">
<input type="hidden" name="token" value="" id="token">
<section id="img_rename">
<div class="tbl_frm01 tbl_wrap">
<table>
<caption>IP 변경</caption>
<colgroup>
<col class="grid_4">
<col>
<col class="grid_4">
<col>
</colgroup>
<tbody>
<tr>
<th scope="row"><label for="previous_site">변경전 IP 주소<strong class="sound_only">필수</strong></label></th>
<td>
<?php echo help('ex) 나의 IP '.$_SERVER['REMOTE_ADDR'].'') ?>
<input type="text" name="previous_ip" value="<?php echo $_SERVER['REMOTE_ADDR']; ?>" id="previous_ip" class="frm_input required" required size="30" required>
</td>
<th scope="row"><label for="now_ip">변경후 IP 주소<strong class="sound_only">필수</strong></label></th>
<td>
<?php echo help('ex) 1.2.3.4') ?>
<input type="text" name="now_ip" value="1.2.3.4" id="now_ip" class="frm_input required" required size="30" readonly>
</td>
</tr>
</tbody>
</table>
</div>
</section>
<?php echo $frm_submit; ?>
</form>
<script>
function fconfigform_submit(f)
{
f.action = "./ip_delete_update.php";
return true;
}
</script>
<?
include_once ('../admin.tail.php');
?>
4. 그누보드5 / adm / ip_rename / ip_rename_update.php
<?php
$sub_menu = "990530";
include_once('./_common.php');
auth_check($auth[$sub_menu], 'r');
if ($is_admin != 'super')
alert('최고관리자만 접근 가능합니다.');
$g5['title'] = 'IP 변경';
include_once ('../admin.head.php');
$old = $_POST['previous_ip'];
$new= $_POST['now_ip'];
if ($new == "" || $old == "")
alert('변경전/후 IP를 입력하세요');
sql_query("update ".$g5['member_table']." set mb_ip=REPLACE(`mb_ip`,'".$old."','".$new."')"); // 회원 테이블
sql_query("update ".$g5['member_table']." set mb_login_ip=REPLACE(`mb_login_ip`,'".$old."','".$new."')"); // 회원 테이블
sql_query("update ".$g5['popular_table']." set pp_ip=REPLACE(`pp_ip`,'".$old."','".$new."')"); // 인기검색어 테이블
sql_query("update ".$g5['visit_table']." set vi_ip=REPLACE(`vi_ip`,'".$old."','".$new."')"); // 방문자 테이블
sql_query("update ".$g5['uniqid_table']." set uq_ip=REPLACE(`uq_ip`,'".$old."','".$new."')"); // 유니크한 값을 만드는 테이블
$sql = sql_query("select * from ".$g5['board_table']." ");
while($data = sql_fetch_array($sql)){
//echo $data["bo_table"]."<br>";
sql_query("update ".$g5['write_prefix'].$data['bo_table']." set wr_ip=REPLACE(`wr_ip`,'".$old."','".$new."')");
}
alert('IP 변경이 완료되었습니다.', './ip_rename.php');
?>
1. 그누보드5 / adm / admin.menu990.php
2. 그누보드5 / adm / ip_rename / _common.php
3. 그누보드5 / adm / ip_rename / ip_rename.php
4. 그누보드5 / adm / ip_rename / ip_rename_update.php
기능이 대폭 개선된 프로그램을 https://sir.kr/cmall/1650348712 에서 판매중입니다
1. 그누보드5 / adm / admin.menu990.php
<?php
$menu["menu990"] = array (
array('990000', '추가기능', G5_ADMIN_URL.'/ip_rename/ip_rename.php', 'ETC'),
//array('990100', '활성도 통계', G5_ADMIN_URL.'/status/m3stats.php', 'm3stats'),
//array('990200', '팝업새창 관리', G5_ADMIN_URL.'/popup/popup_list.php', 'popup_blank'),
//array('990250', '팝업레이어 관리', G5_ADMIN_URL.'/popup/newwinlist.php', 'popup_layer'),
//array('990300', '메인배너관리', G5_ADMIN_URL.'/banner/main_banner_list.php', 'main_banner'),
//array('990310', '사이드배너관리', G5_ADMIN_URL.'/banner/aside_banner_list.php', 'side_banner'),
//array('990400', '출석부 환경설정', G5_ADMIN_URL.'/attendance/attendance_setup.php', 'attendance_setup'),
//array("990510", "날짜조회수관리", ''.G5_ADMIN_URL.'/board_admin/board_manage_etc_list.php', 'board_manage'),
//array('990520', '이미지 주소 변경', G5_ADMIN_URL.'/img_rename/img_rename.php', 'img_rename'),
array('990530', '아이피 변경', G5_ADMIN_URL.'/ip_rename/ip_rename.php', 'ip_rename'),
);
?>
2. 그누보드5 / adm / ip_rename / _common.php
<?php
define('G5_IS_ADMIN', true);
include_once ('../../common.php');
include_once(G5_ADMIN_PATH.'/admin.lib.php');
?>
3. 그누보드5 / adm / ip_rename / ip_rename.php
<?php
$sub_menu = "990530";
include_once('./_common.php');
auth_check($auth[$sub_menu], 'r');
if ($is_admin != 'super')
alert('최고관리자만 접근 가능합니다.');
$g5['title'] = 'IP 변경';
include_once ('../admin.head.php');
$pg_anchor = '<ul class="anchor">
<li><a href="#ip_delete">IP 변경</a></li>
</ul>';
$frm_submit = '<div class="btn_confirm01 btn_confirm">
<input type="submit" value="확인" class="btn_submit" accesskey="s">
<a href="'.G5_URL.'/">메인으로</a>
</div>';
?>
<div class="local_desc01 local_desc">
<p>IP 주소를 임의의 IP 주소로 변경됩니다.</p>
</div>
<form name="fconfigform" id="fconfigform" method="post" onsubmit="return fconfigform_submit(this);" enctype="MULTIPART/FORM-DATA">
<input type="hidden" name="token" value="" id="token">
<section id="img_rename">
<div class="tbl_frm01 tbl_wrap">
<table>
<caption>IP 변경</caption>
<colgroup>
<col class="grid_4">
<col>
<col class="grid_4">
<col>
</colgroup>
<tbody>
<tr>
<th scope="row"><label for="previous_site">변경전 IP 주소<strong class="sound_only">필수</strong></label></th>
<td>
<?php echo help('ex) 나의 IP '.$_SERVER['REMOTE_ADDR'].'') ?>
<input type="text" name="previous_ip" value="<?php echo $_SERVER['REMOTE_ADDR']; ?>" id="previous_ip" class="frm_input required" required size="30" required>
</td>
<th scope="row"><label for="now_ip">변경후 IP 주소<strong class="sound_only">필수</strong></label></th>
<td>
<?php echo help('ex) 1.2.3.4') ?>
<input type="text" name="now_ip" value="1.2.3.4" id="now_ip" class="frm_input required" required size="30" readonly>
</td>
</tr>
</tbody>
</table>
</div>
</section>
<?php echo $frm_submit; ?>
</form>
<script>
function fconfigform_submit(f)
{
f.action = "./ip_delete_update.php";
return true;
}
</script>
<?
include_once ('../admin.tail.php');
?>
4. 그누보드5 / adm / ip_rename / ip_rename_update.php
<?php
$sub_menu = "990530";
include_once('./_common.php');
auth_check($auth[$sub_menu], 'r');
if ($is_admin != 'super')
alert('최고관리자만 접근 가능합니다.');
$g5['title'] = 'IP 변경';
include_once ('../admin.head.php');
$old = $_POST['previous_ip'];
$new= $_POST['now_ip'];
if ($new == "" || $old == "")
alert('변경전/후 IP를 입력하세요');
sql_query("update ".$g5['member_table']." set mb_ip=REPLACE(`mb_ip`,'".$old."','".$new."')"); // 회원 테이블
sql_query("update ".$g5['member_table']." set mb_login_ip=REPLACE(`mb_login_ip`,'".$old."','".$new."')"); // 회원 테이블
sql_query("update ".$g5['popular_table']." set pp_ip=REPLACE(`pp_ip`,'".$old."','".$new."')"); // 인기검색어 테이블
sql_query("update ".$g5['visit_table']." set vi_ip=REPLACE(`vi_ip`,'".$old."','".$new."')"); // 방문자 테이블
sql_query("update ".$g5['uniqid_table']." set uq_ip=REPLACE(`uq_ip`,'".$old."','".$new."')"); // 유니크한 값을 만드는 테이블
$sql = sql_query("select * from ".$g5['board_table']." ");
while($data = sql_fetch_array($sql)){
//echo $data["bo_table"]."<br>";
sql_query("update ".$g5['write_prefix'].$data['bo_table']." set wr_ip=REPLACE(`wr_ip`,'".$old."','".$new."')");
}
alert('IP 변경이 완료되었습니다.', './ip_rename.php');
?>
댓글목록
등록된 댓글이 없습니다.