■ 그누보드 버젼 ver1.0 정식 아웃로그인(위치상관없는 ets버젼) > 그누3 팁자료실

그누3 팁자료실

■ 그누보드 버젼 ver1.0 정식 아웃로그인(위치상관없는 ets버젼) 정보

일반 ■ 그누보드 버젼 ver1.0 정식 아웃로그인(위치상관없는 ets버젼)

본문

이 방법은 index.html파일 위치가 그누보드와 같은 위치에 있지 않고 상위위치에 있을경우
그누보드 ver1.0정식에 포함된 아웃로그인은 에러를 잃으킴으로 올립니다. *^^* (방금손보았네요 *^^*)
예)
★ 인덱스파일위치
 http://111.111.111/~계정명/index.html
★ 그누보드 설치위치
 http://111.111.111.111/~계정명/gnuboard1/
간단하게 소스 전체를 올립니다.
##########################################################################################
 http://111.111.111/~계정명/index.html 내용 (demo.php) 내용을 그대로 사용하면됩니다.
<?
//=====================================================
// 그누보드 사용 방법 (DEMO)
//=====================================================
require_once "./lib.inc.php";
// 외부 로그인
// require_once "$reldir/outlogin.php"; &nbsp; &nbsp;// ###### 수정처리 이유는 현재폴더에 복사해넣기때문.
require_once "outlogin.php";
echo "<font size=2>※ index.php(또는 index.html) 가 존재해야 합니다.</font>";
echo "<p>";
echo "<table width=150><tr><td>";
// 투표
$row = sql_fetch_array(" select max(vo_id) from $cfg[table_vote] ");
if ($row[0]) {
 &nbsp; &nbsp;$vo_id = $row[0];
 &nbsp; &nbsp;require_once "$reldir/gbvote.php";

}
echo "</td></tr></table>";

echo "<br><table width=400><tr><td>";

// 새글 추출
$result = sql_query_error(" select * from $cfg[table_board] order by gb_table asc ");
while ($row = mysql_fetch_array($result)) {
 &nbsp; &nbsp;echo newlist($row[gb_table], $row[gb_subject], 5, 40);
 &nbsp; &nbsp;echo "<p>";
}
mysql_free_result($result);
echo "</td></tr></table>";
?>
########################################################################################
 http://111.111.111/~계정명/lib.inc.php 내용
<?
// 상대경로
$reldir = "./gnuboard1"; &nbsp;// 여기 보드 설치위치를 설정해줍니다.
require_once "$reldir/lib.inc.php";
?>
########################################################################################
 http://111.111.111/~계정명/outlogin.php 내용
<?
/*---------------------------
** &nbsp; &nbsp; &nbsp; &nbsp;외부로그인 &nbsp; &nbsp; &nbsp; &nbsp; **
---------------------------*/
require_once "./lib.inc.php";
require_once "$reldir/ets.php";
if ($login_mb[mb_id]) { // 로그인 중이라면

 &nbsp; &nbsp;$temp->게시판 = $gb_table;
 &nbsp; &nbsp;$temp->회원아이디 = $login_mb[mb_id];
 &nbsp; &nbsp;$temp->회원명 = $login_mb[mb_name];
 &nbsp; &nbsp;$temp->그룹관리자권한이상 = false;
 &nbsp; &nbsp;if ($login_mb[mb_level] >= $cfg[level_group_admin])
 &nbsp; &nbsp; &nbsp; &nbsp;$temp->그룹관리자권한이상 = true;
 &nbsp; &nbsp;$temp->회원탈퇴대기일 = $cfg[leave_day];

 &nbsp; &nbsp;$temp->절대경로 = $absdir;
 &nbsp; &nbsp;$temp->상대경로 = $reldir; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;// ############# 추가했습니다.
 &nbsp; &nbsp;$temp->스킨디렉토리 = $cfg[dir_skin];
 &nbsp; &nbsp;$temp->스킨 = $cfg[skin];
 &nbsp; &nbsp;$temp->uc1 = $uc1;
 &nbsp; &nbsp;$temp->uc2 = $uc2;
 &nbsp; &nbsp;$temp->uc3 = $uc3;

 &nbsp; &nbsp;printt($temp, "$reldir/$cfg[dir_skin]/$cfg[skin]/outlogin1.ets");

} else { // 로그아웃 중이라면

 &nbsp; &nbsp;$temp->게시판 = $gb_table;
 &nbsp; &nbsp;$temp->회원아이디 = $login_mb[mb_id];
 &nbsp; &nbsp;$temp->회원명 = $login_mb[mb_name];
 &nbsp; &nbsp;$temp->그룹관리자권한이상 = false;
 &nbsp; &nbsp;if ($login_mb[mb_level] >= $cfg[level_group_admin])
 &nbsp; &nbsp; &nbsp; &nbsp;$temp->그룹관리자권한이상 = true;
 &nbsp; &nbsp;$temp->회원탈퇴대기일 = $cfg[leave_day];

 &nbsp; &nbsp;$temp->절대경로 = $absdir;
 &nbsp; &nbsp;$temp->상대경로 = $reldir; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // ############## 추가했습니다.
 &nbsp; &nbsp;$temp->스킨디렉토리 = $cfg[dir_skin];
 &nbsp; &nbsp;$temp->스킨 = $cfg[skin];
 &nbsp; &nbsp;$temp->uc1 = $uc1;
 &nbsp; &nbsp;$temp->uc2 = $uc2;
 &nbsp; &nbsp;$temp->uc3 = $uc3;
 &nbsp; &nbsp;printt($temp, "$reldir/$cfg[dir_skin]/$cfg[skin]/outlogin2.ets");
}
unset($temp);
?>
여기까지 홈디렉토리내용은 다되었습니다.
########################################################################################
 http://111.111.111/~계정명/gnuboard1/mblogincheck.php 내용
가장 밑에 내용
######## 수정전 ########
} else {
 &nbsp; &nbsp; &nbsp; $link = "$absdir/";
}
header("location:$link");
?>
######## 수정후 #######
} else {
 &nbsp; &nbsp;$outlog1 = ""; &nbsp; &nbsp; &nbsp; &nbsp; // 여길처리해야 로그인체크후 홈디렉토리로 갑니다.안하면
 &nbsp; &nbsp;if ($mb_id) { &nbsp; &nbsp; &nbsp; &nbsp; // 그누보드설치디렉토리로 이동합니다. 그리고 정지 끝 *^^*
 &nbsp; &nbsp; &nbsp; &nbsp;$link = "../";
 &nbsp; &nbsp; &nbsp; &nbsp;$outlog1 = "1"; &nbsp; //이 변수를 사용하지 않으면 홈계정에서는 로그오프체크를 못합니다.
 &nbsp; &nbsp;} else {
 &nbsp; &nbsp; &nbsp; $link = "$absdir/";
 &nbsp; &nbsp;}
}
header("location:$link");
?>

########################################################################################
 http://111.111.111/~계정명/gnuboard1/mblogout.php 내용(전체)
<?
require_once "./lib.inc.php";
// 세션에서 회원아이디 삭제
session_unregister("ss_mb_id");

if ($url) {
 &nbsp; &nbsp;$link = $url;
} else if ($gb_table) {
 &nbsp; &nbsp; &nbsp; &nbsp;$link = "$absdir/gblist.php{$uc1}gb_table{$uc2}$gb_table"; &nbsp; &nbsp;
} else {
// ####### 수정전 ########

 &nbsp; $link = "$absdir/";
}
header("location:$link");
?>
// ####### 수정후 ##########
 &nbsp; if ($outlog1 = 1) {
 &nbsp; &nbsp; &nbsp; $link = "../";
 &nbsp; } else {
 &nbsp; $link = "$absdir/";
 &nbsp; }
}
header("location:$link");
?>
########################################################################################
 http://111.111.111/~계정명/gnuboard1/skin/sample/outlogin1.ets &nbsp;내용(전체)
{mask:main}
<table border=1 cellpadding=4 cellspacing=0 bordercolordark="white" bordercolorlight="navy"><tr><td style='font-size:9pt; font-family:굴림;'>
 &nbsp; &nbsp;<b>{회원아이디}</b>님 로그인 중입니다.<br>
 &nbsp; &nbsp;<input type=button value='로그아웃' onclick="location='{상대경로}/mblogout.php{uc1}gb_table{uc2}{게시판}';">
 &nbsp; &nbsp;<input type=button value='정보수정' onclick="outsidembform('{게시판}')">
 &nbsp; &nbsp;<center>
 &nbsp; &nbsp; &nbsp; &nbsp;{var:그룹관리자권한이상}<a href='{절대경로}/{상대경로}/manage/'>관리자화면</a>{/var:그룹관리자권한이상}
 &nbsp; &nbsp; &nbsp; &nbsp;{mis:그룹관리자권한이상}<a href=\"javascript:mbleave('{게시판}');\">회원을 탈퇴합니다!</a>{/mis:그룹관리자권한이상}
 &nbsp; &nbsp;</center>
</td></tr></table>

<script language='javascript'>
 &nbsp; &nbsp;function outsidembform(gb_table)
 &nbsp; &nbsp;{
 &nbsp; &nbsp; &nbsp; &nbsp;window.open('{절대경로}/{상대경로}/mbform.php{uc1}w{uc2}u{uc3}gb_table{uc2}'+gb_table, '회원정보수정', 'left=10,top=10,width=550,height=600,scrollbars=yes');
 &nbsp; &nbsp;}

 &nbsp; &nbsp;function mbleave(gb_table)
 &nbsp; &nbsp;{
 &nbsp; &nbsp; &nbsp; &nbsp;if (confirm("회원 탈퇴 {회원탈퇴대기일}일 후 {회원아이디}님의 모든 자료가 삭제됩니다.\n\n정말 회원을 탈퇴하시겠습니까?")) {
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;location = '{절대경로}/{상대경로}/mbleave.php{uc1}gb_table{uc2}' + gb_table;
 &nbsp; &nbsp; &nbsp; &nbsp;}
 &nbsp; &nbsp;}
</script>
{/mask:main}

// 소스를 기존소스와 비교해보시면 아실겁니다.

########################################################################################
 http://111.111.111/~계정명/gnuboard1/skin/sample/outlogin2.ets &nbsp;내용(전체)

{mask:main}
<table border=1 cellpadding=4 cellspacing=0 bordercolordark="white" bordercolorlight="navy">
<tr><td style='font-size:9pt; font-family:굴림;'>
<form name=outsideloginform method=post action='{상대경로}/mblogincheck.php'
 &nbsp; &nbsp;onsubmit='return outsideloginformcheck(this)' autocomplete='off'>
 &nbsp; &nbsp;<input type='hidden' name='gb_table' value='{게시판}'>
 &nbsp; &nbsp;아이디 : <input type=text name=mb_id size=10><br>
 &nbsp; &nbsp;암 &nbsp;&nbsp;호 : <input type=password name=mb_passwd size=10><br>
 &nbsp; &nbsp;<input type=submit value='로그인'>
 &nbsp; &nbsp;<input type=button value='회원가입' onclick="outsidembform('{게시판}');"><br>
 &nbsp; &nbsp;<center><a href='{상대경로}/mbpasswdforget1.php{uc1}gb_table{uc2}{게시판}'>암호를 잊었어요!</a></center>
</td></tr></form></table>

<script language='javascript'>
 &nbsp; &nbsp;function outsideloginformcheck(f) {
 &nbsp; &nbsp; &nbsp; &nbsp;if (f.mb_id.value == '') {
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;alert('회원아이디를 입력하세요.');
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;f.mb_id.focus();
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;return false;
 &nbsp; &nbsp; &nbsp; &nbsp;} else if (f.mb_passwd.value == '') {
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;alert('암호를 입력하세요.');
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;f.mb_passwd.focus();
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;return false;
 &nbsp; &nbsp; &nbsp; &nbsp;}
 &nbsp; &nbsp; &nbsp; &nbsp;return true;
 &nbsp; &nbsp;}
 &nbsp; &nbsp;function outsidembform(gb_table)
 &nbsp; &nbsp;{
 &nbsp; &nbsp; &nbsp; &nbsp;window.open('{상대경로}/mbform.php{uc1}w{uc2}i', '회원가입', 'left=10,top=10,width=550,he
ight=600,scrollbars=yes');
 &nbsp; &nbsp;}
</script>
{/mask:main}

전체적으로 상대주소로 찾아가서 실행해라고 설정했습니다.
다시말해서 lib.inc.php에서 $reldir = "./gnuboard1"이라고 설정했고
{상대경로} 변수값에 &nbsp; &nbsp; $temp->상대경로 = $reldir; &nbsp; &nbsp; &nbsp; 요렇게 추가를했었죠 *^^* &nbsp;
또한 &nbsp;회원가입부분 window.open('{상대경로}/mbform.php{uc1}w{uc2}i', '회원가입', 여기를 손보았습니다. 기존걸루하면 보드를 걸쳐서 로그인하게 되어있기 때문에 이건 메인페이지기 때문에 보드변수값이 없기때문에 잘못된 경로가입입니다라고 나옵니다. 그래서 뒤에 변수넘겨주는걸 다 잘라줘야 제대로 회원가입이 됩니다. *^^*

혹 최신글 추출이 안되신분은 말씀해주시면 수정소스 올려드리겠습니다.
추천
13
  • 복사

댓글 전체

^^ 한번 해봐야 겠군요..제가 올린게 도움이 되었다니 초보로서 기분 좋은데요..^^
님이 꼭 봐주길 바랬는데 다행이 보셨나보군요.^^ 베타2에서는 잘 됐는데 베타 3부터 바뀐 부분들 땀시 안되서 아에 정식판 나오면 손볼까 하고 안했는데 다시 해봐야 겠네요...아무튼 감사.^^
대명 1111를 바꿧씁니다 아무래도 2틀간 보니까 대명 때문인지 어떤 답변도 없길래...글도 지워 버리고 대명 바꿨어요.^^
© SIRSOFT
현재 페이지 제일 처음으로