2.42버젼 노프레임, 최신글, 외부로그인 소스전체 > 그누3 팁자료실

그누3 팁자료실

2.42버젼 노프레임, 최신글, 외부로그인 소스전체 정보

일반 2.42버젼 노프레임, 최신글, 외부로그인 소스전체

본문

그누보드 2.42버젼을 디렉토리부분을 cwd디렉토리절대값
/home/계정명/public_html/gnu2
url절대값 http://111.111.111.111/~계정명/gnu2
두가지 변수를 선언하여서 프로그램 대부분 경로부분에서 수정된겁니다.

완전초보자와 디렉토리 구조를 깔끔하게 사용하실분과 확장성을 생각하신분이 사용하시는데 적당하리라고
생각합니다.

먼저 gnu2.tgz를 풀면 gnu2로 그누보드 2.42가 풀립니다.
index.html, head.htm, foot.htm은 아래 소스를 파일로 저장하시면 됩니다.
설치방법은 똑같습니다.
gnu2를 계정안에서
tar zxvf gnu2하시면
gnu2폴더가 생성됩니다.
root폴더에
index.html, head.htm, foot.htm만 복사해넣으시면 되고

여기서 수정해야할부분은
index.html과 head.htm에서
$cfg[url] = "http://61.40.183.198/~oldccc/gnu2";
$cfg[reldir]  = "/home/oldccc/public_html/gnu2";
이부분에 자기에 맞게끔 수정해주시면되고

gnu2/lib.inc.php에서
8 Line부분에
    $reldir = "/home/oldccc/public_html/gnu2";
이부분을 수정해주고

gnu2/config.inc.php에서
/*
$cfg[url] = "http://61.40.183.198/~oldccc/gnu2";
$cfg[reldir]  = "/home/oldccc/public_html/gnu2";
*/
이부분을 주석제거하시고 자기 설정에 맞게끔수정하시면됩니다.
하지만 주석제거 안하셔서 잘작동합니다.

1. 노프레임 경로부분

HOME--------계정명------public-+----gnu2--+-----manage
                               |          |
                               |          +-----data-+------file
                               |          |        
                               |          +-----skin-+------board
                               |          |          +------outlogin
                               |          |          +------latest-+------newlist
                               |          |          +------member
                               |          |          +------memo
                               |          + _head.php
                               |          + _tail.php
                               |        
                               +----main-+ profil.htm
                               |         + main2.htm
                               |         + main3.htm
                               |         + main4.htm
                               |         + main5.htm
                               |
                               + index.html
                               + head.htm
                               + foot.htm
                                        
이 구조를 기본으로
노프레임 구현시 main폴더안에 파일에서 게시판및 기타 경로상에 문제 없도록
수정했습니다.

2. 외부로그인 수정부분
   1.1 게시판보는 상태에서 로그인, 로그오프하면 폴더로 해당폴더 파일로가는걸
       만약 게시판을 보는 상태면 해당게시판 보는 위치로 로그인,오프 후에 이동합니다.
       단, 특정페이지, 특정글로는 이동하지 않습니다.
       이유는 만약 글을 본상태에서 글삭제나, 수정기타시 로그 오프를 하게되면
       메뉴바가 보이지 않기때문에 의미가 없는듯해서....필요하면 언제든지 추가는 가능!
   1.2 게시판 이외의 main폴더안에서 실행시 이상하게 작동하는걸 경로변수 수정으로 변경함(다른 방식은 될지 의문)


3. 최신글 추츨
   기존형식으로 바꿧습니다.
   특히나 지금 샘플의 경우 이미지파일 경로가 없기때문에 이미자 파일경로를 줄수가 없어서 $last_skin경로를
   설정에 값만 넘기고 다시 최신글 추출부분에서 디렉토리부분, 이미지 부분, 파일부분은 다시 선언을 했습니다.
   그리고 함수명도 제로보드와 친근하게 print_bbs로 변경했습니다. 보시면 아시리라!
   아참 문제점이 하나 더 있었네요! 최신글 추출에서 만약 게시판명을 보여야하는데
   현재는 $bo_table값을 head부분에 출력함으로써 $bo_table값은 영문으로 설정하기때문에 약간문제가 있어서 수정처리함


//#################################
//#   index.html 소스
//#################################
<?
$cfg[url] = "http://61.40.183.198/~oldccc/gnu2";
$cfg[reldir] &nbsp; = "/home/oldccc/public_html/gnu2";
require_once "$cfg[reldir]/lib.inc.php";
?>

<html>
<head>
<title>■□■ TEST ■□■</title>
<meta http-equiv="content-type" content="text/html; charset=euc-kr">
</head>

<link rel='stylesheet' href='<?=$cfg[url]?>/style.css' type='text/css'>

<body bgcolor=#ffffff leftmargin=0 topmargin=0 marginwidth=0 marginheight=0 >
<table width=800 border=1 cellpadding=0 cellspacing=0 border=0>
 &nbsp; &nbsp;<tr>
 &nbsp; &nbsp; &nbsp; &nbsp;<td colspan=2 height=40>&nbsp;<a href='http://61.40.183.198/~oldccc/index.html'>home</a>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<a href='http://61.40.183.198/~oldccc/main/profil.htm'>자기소개</a>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<a href='http://61.40.183.198/~oldccc/gnu2/gnuboard.php?bo_table=free'>자유게시판</a>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<a href='http://61.40.183.198/~oldccc/gnu2/gnuboard.php?bo_table=pic'>겔러리게시판</a>
 &nbsp; &nbsp; &nbsp; &nbsp;</td>
 &nbsp; &nbsp;</tr>
 &nbsp; &nbsp;<tr>
 &nbsp; &nbsp; &nbsp; &nbsp;<!-- 외부 로그인 시작-->
 &nbsp; &nbsp; &nbsp; &nbsp;<td valign=top width=167>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<? require "$cfg[reldir]/outlogin.php"; ?>
 &nbsp; &nbsp; &nbsp; &nbsp;</td>
 &nbsp; &nbsp; &nbsp; &nbsp;<!-- 외부 로그인 끝 -->
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
 &nbsp; &nbsp; &nbsp; &nbsp;<!-- 메인부분시작 -->
 &nbsp; &nbsp; &nbsp; &nbsp;<td width=633>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<table width=633>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<tr>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<td width=50% align=center valign=top><? print_bbs(newlist,free, 자유게시판, 5, 40); ?>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<td width=50% align=center valign=top><? print_bbs(newlist, pic, 겔러리, 5, 40); ?>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</tr>

 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</table>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br><br><br><br><br><br><br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
 &nbsp; &nbsp; &nbsp; &nbsp;</td>
 &nbsp; &nbsp; &nbsp; &nbsp;<!-- 메인부분 끝 -->
 &nbsp; &nbsp;</tr>
 &nbsp; &nbsp;<tr>
 &nbsp; &nbsp; &nbsp; &nbsp;<td height=30 colspan=2 align=center>만든이 ⓒⓒⓒ</td>
 &nbsp; &nbsp;</tr>
</table
</body>
</html>



//#################################
//# &nbsp; head.htm 소스
//#################################
<?
$cfg[url] = "http://61.40.183.198/~oldccc/gnu2";
$cfg[reldir] &nbsp; = "/home/oldccc/public_html/gnu2";
require_once "$cfg[reldir]/lib.inc.php";
?>

<html>
<head>
<title>■□■ TEST ■□■</title>
<meta http-equiv="content-type" content="text/html; charset=euc-kr">
</head>

<link rel='stylesheet' href='<?=$cfg[url]?>/style.css' type='text/css'>

<body bgcolor=#ffffff leftmargin=0 topmargin=0 marginwidth=0 marginheight=0 >
<table width=800 border=1 cellpadding=0 cellspacing=0 border=0>
 &nbsp; &nbsp;<tr>
 &nbsp; &nbsp; &nbsp; &nbsp;<td colspan=2 height=40>&nbsp;<a href='http://61.40.183.198/~oldccc/index.html'>home</a>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<a href='http://61.40.183.198/~oldccc/main/profil.htm'>자기소개</a>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<a href='http://61.40.183.198/~oldccc/gnu2/gnuboard.php?bo_table=free'>자유게시판</a>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<a href='http://61.40.183.198/~oldccc/gnu2/gnuboard.php?bo_table=pic'>겔러리게시판</a>
 &nbsp; &nbsp; &nbsp; &nbsp;</td>
 &nbsp; &nbsp;</tr>
 &nbsp; &nbsp;<tr>
 &nbsp; &nbsp; &nbsp; &nbsp;<!-- 외부 로그인 시작-->
 &nbsp; &nbsp; &nbsp; &nbsp;<td valign=top width=167>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<? require "$cfg[reldir]/outlogin.php"; ?>
 &nbsp; &nbsp; &nbsp; &nbsp;</td>
 &nbsp; &nbsp; &nbsp; &nbsp;<!-- 외부 로그인 끝 -->
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
 &nbsp; &nbsp; &nbsp; &nbsp;<!-- 메인부분시작 -->
 &nbsp; &nbsp; &nbsp; &nbsp;<td width=633>

//#################################
//# &nbsp; foot.htm 소스
//#################################
 &nbsp; &nbsp; &nbsp; &nbsp;<!-- 메인부분 끝 -->
 &nbsp; &nbsp;</tr>
 &nbsp; &nbsp;<tr>
 &nbsp; &nbsp; &nbsp; &nbsp;<td height=30 colspan=2 align=center>만든이 ⓒⓒⓒ</td>
 &nbsp; &nbsp;</tr>
</table
</body>
</html>

샘플페이지 : 죄송합니다. 현재 카페형식으로 구도변경중으로 작동하지 않습니다. 그래서 링크삭제처리함
소스전체 : index.html, head,htm, foot.htm제외 LINK #2
p.s : 리눅스서버에서 테스트 되었고 혹 경로부분에 덜 고친부분으로 에러가 있을수도 있습니다.
그리고 소스의 경로부분이 모든 파일이 변경되어서 질문시는 원소스와 혼동을 피하기 위해
밑에다만 질문하세요!
아니면 http://wisccc.com 또는 *** 개인정보보호를 위한 이메일주소 노출방지 *** 으로 질문해주시기 바랍니다.
추천
5

댓글 전체

만약 제가 올리신걸 다운받으셨다면
lib.inc.php안에
if (!$reldir) {
    $reldir = "/home/test/www/gnu2";
}
요부분을을 제대로 설정안하신듯합니다.
저기만 절대주소로 바꾸시면 제대로 작동할겁니다.
수고가 만흐시네요! 초보가 하다하다 질문 합니다. 디비를 만들려고 manage를 실행하면
Fatal error: Failed opening required '../gnu2/config.inc.php' (include_path='.:/usr/local/lib/php') in /home/best0one/gnu2/lib.inc.php on line 15
와 같은 에러가 발생하는더 뭐가 문제 일까요!  어디를 고쳐야 하는지...
그리고 인덱스를 실행해도
Fatal error: Failed opening required '/home/gnu2/gnu2/config.inc.php' (include_path='.:/usr/local/lib/php') in /home/best0one/gnu2/lib.inc.php on line 15
라고 나온느데  왜 이러죠!!!!!! 초보데...
꼬리부분을  이렇게  foot.htm 설정하면 관리자 설정에서 어떻게 하는지 궁굼 합니다
그누게시판 소스의 거의가    require_once "../_tail.php";  이런 식으로 되어 있던데
꼬리부분  foot.htm 설정하고 _tail.php설정 둘중 어느거로 ? foot.htm 로 설정해도 에러 안 날까요?
저는 통일 시키기위해  gnu2위에 루트에 _head.php , _tail.php 이렇게 놓으니 관리자에서 설정을  안해도
무조건 다_head.php , _tail.php 포함되어 나오고 관리자 에서 컨트롤이 안 되던데 여기서 해답을 찾을것도 같은데
설명좀 부탁 드림니다
이렇게 정리하기도 쉽진 안았을 텐데 ...
저는 여기서 헤메고 있어요 잘 안되네요 다른 문제는 다 해결이 됬는데..
암든 감사합니다.
_head.php , _tail.php 파일을 head.php ,tail.php 에러
Fatal error: Failed opening required '../gnu2/config.inc.php' (include_path='.') in c:\usr\www\gnu2\lib.inc.php on line 17
이런에러가 뜨네요 수정했더니 ../gnu2부분을 ./gnu2로 수정했더니 또에러
경로 문제땜에 몇
Fatal error: Failed opening required './gnu2/config.inc.php' (include_path='.') in c:\usr\www\gnu2\lib.inc.php on line 18
이방법은 에러 나는곳마다 lib.inc.php 를 계속 수정 해야 하는 군요
다양한 헤더와테일이 포한되는건 좋은데
*^^* _head.php와 _tail.php 이 두가지 파일은 관리자 모드에 설정에서 상단첨부파일, 그룹첨부파일을 불러오는 부분과 스타일러 불러오는 부분인데 경로상문제및 구조상 깔끔을 위하여 구버젼처럼 gnu2디렉토리로 이동하고 소스상
require_once "../_tail.php" 이런씩으로 ../으로 되어있는걸 require_once "./tail.php"으로 모든 소스를 다 변경처리 한것입니다.  그리고 root안에 head.htm과 foot.htm은 노프레임을 구현을 위한 상단첨부파일과 하단첨부파일입니다.
*^^* 어젠가 운영자님이 경로부분을 2.3X버젼으로 돌리신다고 하셨는데 경로만 하신다면 그작업이 된상대라고 보시면 되겠네요 *^^*
방갑성님 위의 적어 놓으신부분은 한칸씩 밀린듯 싶습니다. 위의 보이는대로는 불가능 합니다.
예를 들어 계정명 에 위치한 인덱스와 헤드 푸트 는 동작하지 않습니다. 저대로 해석하시면 곤란하구요.
한칸씩 밀려 보인다고 생각하시면 편할듯 싶습니다.
즉 인덱스는와 헤드 푸트는 퍼블릭 디렉 안에 데이타와 스킨폴더는 gnu2 폴더 안에 . .. 이렇게 한칸씩 미룬단 소립니다.
그렇지 않다면 아까 말했듯이 불가능한 구조가 됩니다.
궁금한 것이 있습니다......
보통 임대 계정을 사용하는 사람들은 /home/ⓒⓒⓒ/public_html 이렇게 되어있으며  브라우저에서 보이게 하는 곳은
public_html 안에 내용만 브라우저에 보이는데 위의 보이는 경로의 부분은 좀 다른 것 같군요....
. 노프레임 경로부분

HOME--------계정명------public-+----gnu2--+-----manage
                              |          |
                              |          +-----data-+------file
                              |          |       
                              |          +-----skin-+------board
                              |          |          +------outlogin
                              |          |          +------latest-+------newlist
                              |          |          +------member
                              |          |          +------memo
                              |          + _head.php
                              |          + _tail.php
                              |       
                              +----main-+ profil.htm
                              |        + main2.htm
                              |        + main3.htm
                              |        + main4.htm
                              |        + main5.htm
                              |
                              + index.html
                              + head.htm
                              + foot.htm
자신의 서버 운영자의 계정 설정인가요?
gnu2/gblayer.php 에러수정분
<script language='JavaScript'>
    function gblayeraction(name, status)
    {
        // event.clientX : 클릭한곳의 X 좌표
        // event.clientY : 클릭한곳의 Y 좌표
        // obj.offsetWidth  : DIV 오브젝트의 폭
        // obj.offsetHeight : DIV 오브젝트의 높이
        // document.body.clientWidth  : 브라우저의 폭
        // document.body.clientHeight : 브라우저의 높이
        // document.body.scrollLeft : 스크롤 Left
        // document.body.scrollTop  : 스크롤 Top
        // obj.style.posLeft : DIV 오브젝트의 X 좌표
        // obj.style.posTop  : DIV 오브젝트의 Y 좌표

        var obj = document.all[name];

        if (typeof(obj) == 'undefined') {
            return;
        }

        var x, y;

        if (event.clientX + obj.offsetWidth > document.body.clientWidth) {
            x = event.clientX + document.body.scrollLeft - obj.offsetWidth - 10;
        } else {
            x = event.clientX + document.body.scrollLeft;
        }
        x = x + 10;

        if (event.clientY + obj.offsetHeight > document.body.clientHeight) {
            y = event.clientY + document.body.scrollTop - obj.offsetHeight;
        } else {
            y = event.clientY + document.body.scrollTop;
        }
        y = y + 5;

        obj.style.posLeft = x;
        obj.style.posTop = y;

        if (status) {
            obj.style.visibility = status;
        } else {
            if(obj.style.visibility == 'visible')
                obj.style.visibility='hidden';
            else
                obj.style.visibility='visible';

            if (typeof(before_obj) != 'undefined') {
                if (before_obj != obj)
                    before_obj.style.visibility = 'hidden';
            }
        }

        before_obj = obj;
    }

    function gblayer(layername, id, name, email, homepage)
    {
        var body = "";
        var height = 0;

        if (id) {
            body += "<tr><td align=center height=20 bgcolor=#FFFFFF><a href='./mbmemoform.php?me_recv_mb_id=" + id + "'>쪽지보내기</a></td></tr>";
            height += 20;
        }

        <? if ($bo_table) { ?>
        if (name) {
            body += "<tr><td align=center height=20 bgcolor=#FFFFFF><a href='./gnuboard.php?bo_table=<?=$bo_table?>&sselect=wr_name&stext="+name+"'>이름으로 검색</a></td></tr>";
            height += 20;
        }
        <? } ?>

        if (email) {
            body += "<tr><td align=center height=20 bgcolor=#FFFFFF><a href='mailto:"+email+"'>메일보내기</a></td></tr>";
            height += 20;
        }

        if (homepage) {
            body += "<tr><td align=center height=20 bgcolor=#FFFFFF><a href='"+homepage+"' target='<?=$default[de_link_target]?>'>홈페이지</a></td></tr>";
            height += 20;
        }

        if (body) {
            var head = "<div id="+layername+" style='position:absolute; left:1px; top:1px; width:100px; height:"+height+"px; z-index:1; visibility: hidden'>";
            head += "<table width=100% border=0 cellspacing=1 cellpadding=3 class=tablebg>";
            var tail = "</table></div>";
            document.writeln(head+body+tail);
        }
    }
</script>

$reldir변수값을 .로 변경해야하는데 빠졌네요!*^^*
전체 52
그누3 팁자료실 내용 검색

회원로그인

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