관리자설정에서 그룹의 상단, 하단 파일도 지정(수정) > 그누3 팁자료실

그누3 팁자료실

관리자설정에서 그룹의 상단, 하단 파일도 지정(수정) 정보

그누호환 관리자설정에서 그룹의 상단, 하단 파일도 지정(수정)

본문

홈페이지를 디자인 하다 보면, 또는 커뮤니티를 염두에 두다 보면 꼭 필요한 것이 그룹별 상,하단 파일 지정입니다. 많은 분들이 저와 같이 head.php tail.php를 코딩하실 텐데. 다음의 방법으로 그룹별 상,하단 파일을 지정하실 수 있습니다.
(그룹 관리자의 설정 범위를 좀 더 넓혀주는 팁을 어느 분께서 예전에 올리신 것이 있는데 그 가운데 이와 같이 상하단 파일 지정에 관련된 부분도 있으니 참고하시기 바랍니다.)
아마 그누 제작자께서도 염두에 두셨다가 특별한 까닭으로 아직 구현하시지 않은 것같습니다. 주석처리가 되어 있더군요.

수정할 파일 다섯개 입니다.(3.26버전 기준입니다. 라인 숫자는 조금 틀릴 수 있습니다)

(1) bbs/admin/boardgroupform.php
63번 라인, 80번 라인의 주석을 제거합니다.('<!--'와 '-->'을 제거)
66번 라인의 <input type=text name=gr_include_head size=60> 을
<input type=text name=gr_include_head value='<?=$gr[gr_include_head]?>' size=60> 으로
70번 라인의 <input type=text name=gr_include_tail size=60> 을
<input type=text name=gr_include_tail value='<?=$gr[gr_include_tail]?>' size=60> 으로 각각 변경

(2) bbs/admin/boardgroupupdate.php
24번 라인, 28번 라인의 주석을 제거.('/*'와 '*/'을 제거)

(3) bbs/gnuboard.php

96번라인에 보시면 다음 두 줄이 있습니다. 게시판 환경에서 설정한 상단 파일을 로딩하는 부분인데,
if ($board[bo_include_head]) { @include $board[bo_include_head]; }
if ($board[bo_content_head]) { echo stripslashes($board[bo_content_head]); }

여기위에
if ($group[gr_include_head]) { @include $group[gr_include_head]; } // 그룹 상단 파일 로딩
if ($group[gr_content_head]) { echo stripslashes($group[gr_content_head]); } // 그룹 상단 내용 로딩
if ($board[bo_include_head]) { @include $board[bo_include_head]; }
if ($board[bo_content_head]) { echo stripslashes($board[bo_content_head]); }

이렇게 두 줄을 첨가합니다.

그리고 이 파일의 제일 아래에 보시면
if ($board[bo_content_tail]) { echo stripslashes($board[bo_content_tail]); }
if ($board[bo_include_tail]) { @include $board[bo_include_tail]; }

이 두줄 보이실 겁니다. 하단 파일 로딩 부분이지요.
여기 아래에 다음과 같이 두줄을 첨가하면 아래와 같겠지요.
if ($board[bo_content_tail]) { echo stripslashes($board[bo_content_tail]); }
if ($board[bo_include_tail]) { @include $board[bo_include_tail]; }
if ($group[gr_content_tail]) { echo stripslashes($group[gr_content_tail]); } // 그룹 하단 내용 로딩
if ($group[gr_include_tail]) { @include $group[gr_include_tail]; } // 그룹 하단 파일 로딩

(4) bbs/gbform.php

마찬가지로 233번줄에
if ($group[gr_include_head]) { @include $group[gr_include_head]; } // 그룹 상단 파일 로딩
if ($group[gr_content_head]) { echo stripslashes($group[gr_content_head]); }  // 그룹 상단 내용 로딩

이것을 첨가

제일 끝줄 ?> 위에
if ($group[gr_content_tail]) { echo stripslashes($group[gr_content_tail]); }  // 그룹 하단 내용 로딩
if ($group[gr_include_tail]) { @include $group[gr_include_tail]; } // 그룹 하단 파일 로딩
이것을 첨가

(5) bbs/gbpasswd.php

역시 마찬가지 입니다
17번 라인에
if ($group[gr_include_head]) { @include $group[gr_include_head]; } // 그룹 상단 파일 로딩
if ($group[gr_content_head]) { echo stripslashes($group[gr_content_head]); }  // 그룹 상단 내용 로딩

첨가

제일 끝줄 ?> 위에
if ($group[gr_content_tail]) { echo stripslashes($group[gr_content_tail]); }  // 그룹 하단 내용 로딩
if ($group[gr_include_tail]) { @include $group[gr_include_tail]; } // 그룹 하단 파일 로딩
이것 첨가

이상 끝입니다.
관리자 설정 화면에서 '그누보드>그룹' 가신 후 아무 그룹이나 수정 버튼 누르면 지정하실 수 있습니다.
추천
0

댓글 전체

감사합니다. 제가 원하던 팁이였는데 이소스를 해당그룹에 속한 회원이 로그인시에 회원이 속한그룹을 첵크하여 해당그룹의 상단파일로 적용하는것은 안되나요?

위소스로 테스트해보니까 해당그룹 회원이 로그인해도 상단파일은 변하지가 않은것 같습니다.
감사합니다 너무너무 잘섰습니다. ^^* 수십번 뜯어 고치다 혹시나 해서 검색해봤는데.
검색한 보람이 있네요.. 정말 감사하구요.. 잘쓰겠습니다.
죄송해요. 제가 충분히 확인을 못했었네요. 오류가 있었구요.
해결해서 다시 글을 수정해 놓았습니다. 작은 따옴표가 빠졌어요.
value='<?=$gr[gr_include_tail]?>'
이부분 있죠? 수정한데로 사용하시면 될 것같습니다.
그러니까 수정 후에 폼박스에 size=60 을 삭제하시고 저장하시면 제대로 될 것같습니다.
감사합니다.
좋은소스 감사합니다. 설명해주신 (1)소스를 그대로 적용했더니, 폼박스에 size=60 이란게 그대로 나타나네요.. 저만 그런거지;;; 답변줌 부탁드립니다. 프로그램엔 문외한이라 간단한 문제도 해결이 안돼네요-_-;;
전체 1,026
그누3 팁자료실 내용 검색

회원로그인

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