관리자설정에서 그룹의 상단, 하단 파일도 지정(수정)
홈페이지를 디자인 하다 보면, 또는 커뮤니티를 염두에 두다 보면 꼭 필요한 것이 그룹별 상,하단 파일 지정입니다. 많은 분들이 저와 같이 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]; } // 그룹 하단 파일 로딩
이것 첨가
이상 끝입니다.
관리자 설정 화면에서 '그누보드>그룹' 가신 후 아무 그룹이나 수정 버튼 누르면 지정하실 수 있습니다.
(그룹 관리자의 설정 범위를 좀 더 넓혀주는 팁을 어느 분께서 예전에 올리신 것이 있는데 그 가운데 이와 같이 상하단 파일 지정에 관련된 부분도 있으니 참고하시기 바랍니다.)
아마 그누 제작자께서도 염두에 두셨다가 특별한 까닭으로 아직 구현하시지 않은 것같습니다. 주석처리가 되어 있더군요.
수정할 파일 다섯개 입니다.(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]; } // 그룹 하단 파일 로딩
이것 첨가
이상 끝입니다.
관리자 설정 화면에서 '그누보드>그룹' 가신 후 아무 그룹이나 수정 버튼 누르면 지정하실 수 있습니다.
|
댓글을 작성하시려면 로그인이 필요합니다.
로그인
댓글 6개
위소스로 테스트해보니까 해당그룹 회원이 로그인해도 상단파일은 변하지가 않은것 같습니다.
검색한 보람이 있네요.. 정말 감사하구요.. 잘쓰겠습니다.
해결해서 다시 글을 수정해 놓았습니다. 작은 따옴표가 빠졌어요.
value='<?=$gr[gr_include_tail]?>'
이부분 있죠? 수정한데로 사용하시면 될 것같습니다.
그러니까 수정 후에 폼박스에 size=60 을 삭제하시고 저장하시면 제대로 될 것같습니다.
감사합니다.