a

아래 전체 보드카테고리 메뉴에서 특정 그룹 제외는 어찌 구현해야 하는가요 ?

<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
?>

<!-- 디자인 부분 -->
<style type="text/css">
.menutitle{
cursor:pointer;
margin-bottom: 5px;
background-color:#CDCDCD;
color:#000000;
width:140px;
padding:2px;
text-align:left;
font-weight:bold;
border:0px solid #000000;
}

.submenu{
margin-bottom: 0.5em;
}
</style>

<script type="text/javascript">
var persistmenu="yes"
var persisttype="sitewide"

if (document.getElementById){
document.write('<style type="text/css">\n')
document.write('.submenu{display: none;}\n')
document.write('</style>\n')
}

// 메뉴전환
function SwitchMenu(obj){
if(document.getElementById){
var el = document.getElementById(obj);
var ar = document.getElementById("masterdiv").getElementsByTagName("span");
if(el.style.display != "block"){
for (var i=0; i<ar.length; i++){
if (ar[i].className=="submenu")
ar[i].style.display = "none";
}
el.style.display = "block";
}else{
el.style.display = "none";
}
}
}

// 쿠키
function get_cookie(Name) {
var search = Name + "="
var returnvalue = "";
if (document.cookie.length > 0) {
offset = document.cookie.indexOf(search)
if (offset != -1) {
offset += search.length
end = document.cookie.indexOf(";", offset);
if (end == -1) end = document.cookie.length;
returnvalue=unescape(document.cookie.substring(offset, end))
}
}
return returnvalue;
}

function onloadfunction(){
if (persistmenu=="yes"){
var cookiename=(persisttype=="sitewide")? "switchmenu" : window.location.pathname
var cookievalue=get_cookie(cookiename)
if (cookievalue!="")
document.getElementById(cookievalue).style.display="block"
}
}

// 기존메뉴상태 보존
function savemenustate(){
var inc=1, blockid=""
while (document.getElementById("sub"+inc)){
if (document.getElementById("sub"+inc).style.display=="block"){
blockid="sub"+inc
break
}
inc++
}
var cookiename=(persisttype=="sitewide")? "switchmenu" : window.location.pathname
var cookievalue=(persisttype=="sitewide")? blockid+";path=/" : blockid
document.cookie=cookiename+"="+cookievalue
}

if (window.addEventListener)
window.addEventListener("load", onloadfunction, false)
else if (window.attachEvent)
window.attachEvent("onload", onloadfunction)
else if (document.getElementById)
window.onload=onloadfunction

if (persistmenu=="yes" && document.getElementById)
window.onunload=savemenustate

</script>

<?
global $g4;

$sql = " select * from $g4[board_table] where bo_list_level = '1' order by bo_subject ";
$result = sql_query($sql);

echo "<div id='masterdiv' align=center>";

$k="";
while ($row = mysql_fetch_array($result)) {
$k=$k+1;

if ($row[bo_use_category]==0) {
echo <<<HEREDOC
<div class="menutitle" onClick="location.href='$g4[bbs_path]/board.php?bo_table=$row[bo_table]'">&nbsp;&nbsp;{$row[bo_subject]}</div>
<span class="submenu" id="sub$k"></span>
HEREDOC;
continue;
}

else {
echo <<<HEREDOC
<div class="menutitle" onclick="SwitchMenu('sub$k')">&nbsp;&nbsp;{$row[bo_subject]}</div>
<span class="submenu" id="sub$k">
HEREDOC;

$arr = explode("|", $row[bo_category_list]); // 구분자가 , 로 되어 있음
echo <<<HEREDOC
<A HREF="$g4[bbs_path]/board.php?bo_table=$row[bo_table]&sca=">전체</A><br>
HEREDOC;
for ($i=0; $i<count($arr); $i++)

if (trim($arr[$i])) {
echo <<<HEREDOC
<A HREF="$g4[bbs_path]/board.php?bo_table=$row[bo_table]&sca=$arr[$i]">{$arr[$i]}</A><br>
HEREDOC;
}
echo "</span>";
}
}
echo "</div> ";

mysql_free_result($result);
?>

============================================================

어느 고수님의 메뉴스킨인데요 ..
특정 그룹 제외는 어찌 해야 하는가요 ?
|

댓글 1개

단순한 방법으로 아래처럼 제외할 그룹에 그룹 아이디($gr_id)를 대입해주면 됩니다.
//$sql = " select * from $g4[board_table] where bo_list_level = '1' order by bo_subject ";
$sql = " select * from $g4[board_table]
where gr_id <> '제외할 그룹1'
and gr_id <> '제외할 그룹2'
and gr_id <> '제외할 그룹3'
and gr_id <> '제외할 그룹4'
order by bo_subject ";//게시판 이름순으로 정렬
댓글을 작성하시려면 로그인이 필요합니다. 로그인

그누4 질문답변

그누보드4 관련 질문은 QA 로 이전됩니다. QA 그누보드4 바로가기 기존 게시물은 열람만 가능합니다.

+
제목 글쓴이 날짜 조회
20년 전 조회 2,293
20년 전 조회 1,836
20년 전 조회 1,585
20년 전 조회 1,641
20년 전 조회 1,652
20년 전 조회 1,605
20년 전 조회 1,508
20년 전 조회 1,676
20년 전 조회 1,524
20년 전 조회 1,513
20년 전 조회 1,621
20년 전 조회 1,707
20년 전 조회 1,608
20년 전 조회 1,525
20년 전 조회 1,727
20년 전 조회 1,731
20년 전 조회 1,786
20년 전 조회 1,510
20년 전 조회 1,563
20년 전 조회 1,546
🐛 버그신고