플록님의 자동메뉴에 대한 질문입니다 정보
플록님의 자동메뉴에 대한 질문입니다본문
아래는 플록님의 왼쪽 자동메뉴 소스입니다..
현재 게시판제목의 왼쪽에 붙은 아이콘이름이
$blue_bullet = "<IMG SRC='$gnusr[img]/bullet.gif' WIDTH=22 HEIGHT=11 border=0>";
와 같이 정의되어 있고 게시판 제목의 옆에 bullet.gif 의 이미지가 출력되며
카테고리가 있는 게시판의 제목오른쪽에는 $sicon = " <span style='color:red;'><img src='$g4[path]/skin/latest/basic/img/tri.gif' border='0' width='9' height='8' align=absmiddle></span>";
와 같이 정의 되어 있고 카테고리가 있는 게시판의 제목 옆에는 작은 녹색 삼각형이 출력됩니다..
와 같이 정의 되어 있고 카테고리가 있는 게시판의 제목 옆에는 작은 녹색 삼각형이 출력됩니다..
이때....카테고리가 없는 게시판의 왼쪽에 bullet.gif 이 붙고 만약 카테고리가 있는 게시판이면 bullet.gif 대신에 다른아이콘이 출력되도록하려면 어찌하면 될까요...
에서 녹색삼각형이 있는 것이 카테고리가 있는 게시판입니다...
게시판 제목의 왼쪽과 오른쪽에 아이콘이 붙는 것이 좀 그래서요..
<? if (!defined("_GNUBOARD_")) exit; // bcRFV_css.php
########################################################
# CSS로 구현한 그누보드4 게시판 및 분류 자동추출 세로 메뉴
# 게시판 및 분류에서 위치표시+새글갯수 표시, 분류 세로열 조정가능
# 2006년 8월 11일, 헐랭이님, 나스카님, rolo님, izen님 소스코드 참조 수정 - 플록
########################################################
?><style type="text/css">
#bcRFV_global { /*메뉴 가장자리를 감싸는 영역*/
width:180px;
background-color:transparent/*black*/;
position:relative;
padding:5 0 0 0;
}
########################################################
# CSS로 구현한 그누보드4 게시판 및 분류 자동추출 세로 메뉴
# 게시판 및 분류에서 위치표시+새글갯수 표시, 분류 세로열 조정가능
# 2006년 8월 11일, 헐랭이님, 나스카님, rolo님, izen님 소스코드 참조 수정 - 플록
########################################################
?><style type="text/css">
#bcRFV_global { /*메뉴 가장자리를 감싸는 영역*/
width:180px;
background-color:transparent/*black*/;
position:relative;
padding:5 0 0 0;
}
#bcRFV_group { /*그룹메뉴 영역*/
width:180px;
margin:5 0 0 5;
padding:7 0 0 10;
background-color:silver;
/*font-weight:bold;*/
}
.bcRFV_group_subject { /*그룹제목 스타일*/
width:156px;/*block 설정시 너비 빼먹으면 msie에서 안먹힘*/
height:23px;
display:block; /*포인터 영역 확대*/
}
width:180px;
margin:5 0 0 5;
padding:7 0 0 10;
background-color:silver;
/*font-weight:bold;*/
}
.bcRFV_group_subject { /*그룹제목 스타일*/
width:156px;/*block 설정시 너비 빼먹으면 msie에서 안먹힘*/
height:23px;
display:block; /*포인터 영역 확대*/
}
#bcRFV_board { /*게시판 제목*/
width:180px;
margin:0 0 0 0;
padding:0 0 0 10;
background-color:transparent;
position:relative;
}
a.bcRFV_board_subject { /*게시판제목 링크 스타일*/
width:180px;/*block 설정시 너비 빼먹으면 msie에서 안먹힘*/
height:15px;
display:block; /*포인터 영역 확대*/
border-bottom:0px dotted gray;
padding:5 0 5 0;
}
width:180px;
margin:0 0 0 0;
padding:0 0 0 10;
background-color:transparent;
position:relative;
}
a.bcRFV_board_subject { /*게시판제목 링크 스타일*/
width:180px;/*block 설정시 너비 빼먹으면 msie에서 안먹힘*/
height:15px;
display:block; /*포인터 영역 확대*/
border-bottom:0px dotted gray;
padding:5 0 5 0;
}
#bcRFV_sub { /*분류 영역*/
position:relative;
border-right:0px dotted gray;
border-bottom:1px dotted #E7E3E7;
border-left:0px dotted gray;
}
a.bcRFV_sub_subject { /*분류제목 링크 스타일*/
width:150px; /*block 설정시 너비 빼먹으면 msie에서 안먹힘*/
height:15px;
display:block; /*포인터 영역 확대*/
border-bottom:0px dotted gray;
margin-left:10;
padding:5 0 2 0;
}
position:relative;
border-right:0px dotted gray;
border-bottom:1px dotted #E7E3E7;
border-left:0px dotted gray;
}
a.bcRFV_sub_subject { /*분류제목 링크 스타일*/
width:150px; /*block 설정시 너비 빼먹으면 msie에서 안먹힘*/
height:15px;
display:block; /*포인터 영역 확대*/
border-bottom:0px dotted gray;
margin-left:10;
padding:5 0 2 0;
}
.new {
font: oblique small-caps 500 12px/15px arial;
color:red;
}
.newc {
font: oblique 12px/15px arial;
}
</style><?
font: oblique small-caps 500 12px/15px arial;
color:red;
}
.newc {
font: oblique 12px/15px arial;
}
</style><?
// rolo님 메뉴스킨 라이브러리 참조, 일반적인 조건으로 쿼리
// 제외 게시판 - 전체 검색 사용 no, 목록열람 레벨
// 게시판 정렬 - 전체 검색 오름 차순
// 나스카님 원글 및 분류별 새글 카운트(izen님 php속도향상팁 적용)
?><div id='bcRFV_global'><?
// 제외 게시판 - 전체 검색 사용 no, 목록열람 레벨
// 게시판 정렬 - 전체 검색 오름 차순
// 나스카님 원글 및 분류별 새글 카운트(izen님 php속도향상팁 적용)
?><div id='bcRFV_global'><?
//### 그룹 추출 - 메뉴가 위치하는 그룹
$grN = sql_fetch(" select gr_id, gr_subject from $g4[group_table] where gr_id = '$gr_id' ");//그룹명시
$grN = sql_fetch(" select gr_id, gr_subject from $g4[group_table] where gr_id = '$gr_id' ");//그룹명시
$bar = "<IMG SRC='$gnusr[img]/img47.gif' WIDTH=20 HEIGHT=9 border=0>";
$blue_bullet = "<IMG SRC='$gnusr[img]/bullet.gif' WIDTH=22 HEIGHT=11 border=0>";
$blue_bullet = "<IMG SRC='$gnusr[img]/bullet.gif' WIDTH=22 HEIGHT=11 border=0>";
$list = array();
//제외시키고자 하는 게시판을 수동으로 추가
$exc = "('gm11_b1', '게시판2', '게시판3')";
$exc = "('gm11_b1', '게시판2', '게시판3')";
//## 게시판 추출 -목록열람 레벨 적용후 검색순 정렬
$sql = " select bo_table, bo_subject, bo_category_list, bo_use_category, bo_new from $g4[board_table] where (bo_list_level <= $member[mb_level]) and (gr_id = '$grN[gr_id]') and bo_table not in {$exc} order by bo_order_search";
$result = sql_query($sql);
$sql = " select bo_table, bo_subject, bo_category_list, bo_use_category, bo_new from $g4[board_table] where (bo_list_level <= $member[mb_level]) and (gr_id = '$grN[gr_id]') and bo_table not in {$exc} order by bo_order_search";
$result = sql_query($sql);
for ($i=0; $row = sql_fetch_array($result); $i++) {
$list[$row['bo_table']]['bo_subject'] = $row['bo_subject'];
$list[$row['bo_table']]['sca'] = explode("|", $row['bo_category_list']);
$list[$row['bo_table']]['bo_use_category'] = $row['bo_use_category'];
$list[$row['bo_table']]['bo_new'] = $row['bo_new'];
}
$list[$row['bo_table']]['bo_subject'] = $row['bo_subject'];
$list[$row['bo_table']]['sca'] = explode("|", $row['bo_category_list']);
$list[$row['bo_table']]['bo_use_category'] = $row['bo_use_category'];
$list[$row['bo_table']]['bo_new'] = $row['bo_new'];
}
//### 그룹
$menu_size= count( $list);
$group_subject = "<span style='font-weight:bold;'>" . cut_str(get_text($grN['gr_subject']),20,"") . "</span>";
$group_subject .= "<span style='font-size:8pt;'> Total:" . $menu_size . "</span>";
$menu_size= count( $list);
$group_subject = "<span style='font-weight:bold;'>" . cut_str(get_text($grN['gr_subject']),20,"") . "</span>";
$group_subject .= "<span style='font-size:8pt;'> Total:" . $menu_size . "</span>";
?>
<!--<div id="bcRFV_group">
<a href='<?=$g4['bbs_path']?><?=$grN['gr_id'] == "sample_gal"?'/gallery':'';/*특정그룹 경로*/?>/group.php?gr_id=<?=$grN['gr_id']?>' onfocus='this.blur()' class="bcRFV_group_subject"><?=$group_subject?></a></div>
-->
<?
<!--<div id="bcRFV_group">
<a href='<?=$g4['bbs_path']?><?=$grN['gr_id'] == "sample_gal"?'/gallery':'';/*특정그룹 경로*/?>/group.php?gr_id=<?=$grN['gr_id']?>' onfocus='this.blur()' class="bcRFV_group_subject"><?=$group_subject?></a></div>
-->
<?
//## 게시판 목록
foreach( $list as $key=> $value) {
$tmp_write_table = $g4[write_prefix] . $key;
$intime = date("Y-m-d H:i:s", time()-3600*$value['bo_new']);
//원글 및 코멘트 새글 카운트 by nasca, izen님 빠른쿼리로 보강
$sql_new = mysql_query(" select count(wr_datetime) as wr_datetime from $tmp_write_table where wr_is_comment = '0' and wr_datetime >= '$intime' ");
$row_new = mysql_fetch_array($sql_new);
$sql_cm_new = mysql_query(" select count(wr_datetime) as wr_datetime from $tmp_write_table where wr_is_comment <> '0' and wr_datetime >= '$intime' ");
$row_cm_new = mysql_fetch_array($sql_cm_new);
foreach( $list as $key=> $value) {
$tmp_write_table = $g4[write_prefix] . $key;
$intime = date("Y-m-d H:i:s", time()-3600*$value['bo_new']);
//원글 및 코멘트 새글 카운트 by nasca, izen님 빠른쿼리로 보강
$sql_new = mysql_query(" select count(wr_datetime) as wr_datetime from $tmp_write_table where wr_is_comment = '0' and wr_datetime >= '$intime' ");
$row_new = mysql_fetch_array($sql_new);
$sql_cm_new = mysql_query(" select count(wr_datetime) as wr_datetime from $tmp_write_table where wr_is_comment <> '0' and wr_datetime >= '$intime' ");
$row_cm_new = mysql_fetch_array($sql_cm_new);
$bn_count = $row_new['wr_datetime'];
$bn_countc = $row_cm_new['wr_datetime'];
$bn_countc = $row_cm_new['wr_datetime'];
if ($bn_count || $bn_countc > 0) {
$new = " <span class='new'><img src='$g4[path]/skin/latest/basic/img/icon_new.gif' border='0' width='14' height='6' align=absmiddle>(" . $bn_count . '/' . $bn_countc . ")</span>";
}else{
$new = "";
}
$new = " <span class='new'><img src='$g4[path]/skin/latest/basic/img/icon_new.gif' border='0' width='14' height='6' align=absmiddle>(" . $bn_count . '/' . $bn_countc . ")</span>";
}else{
$new = "";
}
foreach( $value['sca'] as $category) {//분류가 있고 분류사용 체크된 게시판 별도표시
$sicon = "";
if (($value['bo_use_category'] == "1") && ($category)) {
$sicon = " <span style='color:red;'><img src='$g4[path]/skin/latest/basic/img/tri.gif' border='0' width='9' height='8' align=absmiddle></span>";
}
}
$sicon = "";
if (($value['bo_use_category'] == "1") && ($category)) {
$sicon = " <span style='color:red;'><img src='$g4[path]/skin/latest/basic/img/tri.gif' border='0' width='9' height='8' align=absmiddle></span>";
}
}
$style = "";
if ($key == $bo_table)//해당 게시판 강조
$style = "style='font-weight:bold; color:red;'";
$bo_subject = "<span $style>" . cut_str(get_text($value['bo_subject']),20,"") . "</span>" . $new . $sicon;
?><a href='<?=$g4[bbs_path]?>/board.php?bo_table=<?=$key?>' class='bcRFV_board_subject' onfocus='this.blur()'><?=$blue_bullet?> <?=$bo_subject?></a><div id='bcRFV_sub'><?
if ($key == $bo_table)//해당 게시판 강조
$style = "style='font-weight:bold; color:red;'";
$bo_subject = "<span $style>" . cut_str(get_text($value['bo_subject']),20,"") . "</span>" . $new . $sicon;
?><a href='<?=$g4[bbs_path]?>/board.php?bo_table=<?=$key?>' class='bcRFV_board_subject' onfocus='this.blur()'><?=$blue_bullet?> <?=$bo_subject?></a><div id='bcRFV_sub'><?
//분류(카테고리)목록 세로배열
$bo_width = 100;//전체 너비 %
$cols = 1;//세로 칼럼수
$ca_width = intval($bo_width / $cols);//분류 너비 %
$bo_width = 100;//전체 너비 %
$cols = 1;//세로 칼럼수
$ca_width = intval($bo_width / $cols);//분류 너비 %
$cnt = 1;
//게시판이고 분류사용 체크되있으며 분류내용 있는 경우
if (($key == $bo_table) && (($value['bo_use_category'] == "1") && ($category))) {
if (($key == $bo_table) && (($value['bo_use_category'] == "1") && ($category))) {
?><div style="width:<?=$bo_width?>%; border:0px solid white;"><?
//# 분류 목록
foreach( $value['sca'] as $category) {
//bo_new에서 지정한 시간내 분류별 원글 및 코멘트 새글 카운트 by nasca, izen님 빠른쿼리로 보강
$sql2_new = mysql_query(" select count(wr_datetime) as wr_datetime from $tmp_write_table where wr_is_comment = '0' and wr_datetime >= '$intime' and ca_name = '$category'");
$row2_new = mysql_fetch_array($sql2_new);
$sql2_cm_new = mysql_query(" select count(wr_datetime) as wr_datetime from $tmp_write_table where wr_is_comment <> '0' and wr_datetime >= '$intime' and ca_name = '$category'");
$row2_cm_new = mysql_fetch_array($sql2_cm_new);
//# 분류 목록
foreach( $value['sca'] as $category) {
//bo_new에서 지정한 시간내 분류별 원글 및 코멘트 새글 카운트 by nasca, izen님 빠른쿼리로 보강
$sql2_new = mysql_query(" select count(wr_datetime) as wr_datetime from $tmp_write_table where wr_is_comment = '0' and wr_datetime >= '$intime' and ca_name = '$category'");
$row2_new = mysql_fetch_array($sql2_new);
$sql2_cm_new = mysql_query(" select count(wr_datetime) as wr_datetime from $tmp_write_table where wr_is_comment <> '0' and wr_datetime >= '$intime' and ca_name = '$category'");
$row2_cm_new = mysql_fetch_array($sql2_cm_new);
$cn_count = $row2_new['wr_datetime'];
$cn_countc = $row2_cm_new['wr_datetime'];
$cn_countc = $row2_cm_new['wr_datetime'];
if ($cn_count || $cn_countc > 0) {
$new2 = " <span class='new'>(" . $cn_count . '/' . $cn_countc . ")<img src='$g4[path]/skin/latest/basic/img/icon_new.gif' border='0' width='14' height='6' align=absmiddle></span>";
}else{
$new2 = "";
}
$new2 = " <span class='new'>(" . $cn_count . '/' . $cn_countc . ")<img src='$g4[path]/skin/latest/basic/img/icon_new.gif' border='0' width='14' height='6' align=absmiddle></span>";
}else{
$new2 = "";
}
//링크에서 한글로된 카데고리 이름을 urlencode시킴
$sca_url = urlencode($category);
$sca_url = urlencode($category);
$style = "";
if ($category == $sca)//해당 게시판 강조
$style = "style='font-weight:normal; color:red;'";
$ca_subject = "<span $style>" . cut_str(get_text($category),30,"") . "</span>" . $new2;
if ($category == $sca)//해당 게시판 강조
$style = "style='font-weight:normal; color:red;'";
$ca_subject = "<span $style>" . cut_str(get_text($category),30,"") . "</span>" . $new2;
?><span style="width:<?=$ca_width?>%;padding:3 0 3 10;"><a href='<?=$g4['bbs_path']?>/board.php?bo_table=<?=$key?>&sca=<?=urlencode($category)?>' style="border-bottom:0px dotted gray;" onfocus='this.blur()'><?=$bar?> <?=$ca_subject?></a>
</span><?
</span><?
if ($cnt == $cols){
$cnt = 0;
?></div><div style="width:<?=$bo_width?>%; border:0px solid red;"><?
}
$cnt = 0;
?></div><div style="width:<?=$bo_width?>%; border:0px solid red;"><?
}
$cnt++;
}//foreach
?></div><?
}//if
?></div></div><?
}//foreach 주메뉴 끝
?></div><!-- bcRFV_global end -->
<div style='clear: both;'></div>
}//foreach
?></div><?
}//if
?></div></div><?
}//foreach 주메뉴 끝
?></div><!-- bcRFV_global end -->
<div style='clear: both;'></div>
댓글 전체
ㅋㅋ 다잃었다..휴 길다..
if(!$value['sca'])
{
$blue_bullet = "<IMG SRC='$gnusr[img]/bullet.gif' WIDTH=22 HEIGHT=11 border=0>";
}
else
{
$blue_bullet = "<IMG SRC='$gnusr[img]/part.gif' WIDTH=22 HEIGHT=11 border=0>";
}
// 될려나...ㅠㅠ, 음...제가 위에거 자세히 안 읽어서... 쩝....
아닌가..ㅠㅠ 안되면..$value['sca'] 이거에 다른조건식을 넣으면 될텐데...
if(!$value['sca'])
{
$blue_bullet = "<IMG SRC='$gnusr[img]/bullet.gif' WIDTH=22 HEIGHT=11 border=0>";
}
else
{
$blue_bullet = "<IMG SRC='$gnusr[img]/part.gif' WIDTH=22 HEIGHT=11 border=0>";
}
// 될려나...ㅠㅠ, 음...제가 위에거 자세히 안 읽어서... 쩝....
아닌가..ㅠㅠ 안되면..$value['sca'] 이거에 다른조건식을 넣으면 될텐데...
// 이건가....흠..
if (!($value['bo_use_category'] == "1") &&! ($category)) // 조건식 계속 넣어보세요...언젠가 되지 않을가요.? 전 좀 무식하게 합니다 될때까지........
{
$blue_bullet = "<IMG SRC='$gnusr[img]/bullet.gif' WIDTH=22 HEIGHT=11 border=0>";
}
else
{
$blue_bullet = "<IMG SRC='$gnusr[img]/part.gif' WIDTH=22 HEIGHT=11 border=0>";
}
if (!($value['bo_use_category'] == "1") &&! ($category)) // 조건식 계속 넣어보세요...언젠가 되지 않을가요.? 전 좀 무식하게 합니다 될때까지........
{
$blue_bullet = "<IMG SRC='$gnusr[img]/bullet.gif' WIDTH=22 HEIGHT=11 border=0>";
}
else
{
$blue_bullet = "<IMG SRC='$gnusr[img]/part.gif' WIDTH=22 HEIGHT=11 border=0>";
}
뮤존님 ///감사합니다...잘 되네요
아싸 포인트~~ ㄳㄳ, 포인트좀 올려주세요~~~