카테고리별로 공지를 보여주고 싶은데 방법 없을까요? > 그누4 질문답변

그누4 질문답변

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

카테고리별로 공지를 보여주고 싶은데 방법 없을까요? 정보

카테고리별로 공지를 보여주고 싶은데 방법 없을까요?

본문

전문 프로그래머가 아니다 보니
검색이나 질문을 통해서 답을 얻게 되는데요 ㅎㅎ

메인에서는 공지가 노출되지 않고
카테고리별로 공지를 보여주고 싶은데 방법 없을까요?
  • 복사

댓글 전체

//원래 있는부분
lib/latest.lib.php 부분에
$sql = " select * from $tmp_write_table where wr_is_comment = 0 order by wr_num limit 0, $rows ";

아래 처럼 등록하신면 될듯 합니다
$notice_array = explode("\n", trim($board[bo_notice]));
$notice_count = count($notice_array):
$notice_str = "";
if($notice_count)
{
for($k =0 ; $k < $notice_count ; $k++)
{
$notice_array[$k] = " wr_id != '".$notice_array[$k]."' " ;
}
$notice_str = " AND ".implode(" AND " , $notice_array);." ";
}
$sql = " select * from $tmp_write_table where wr_is_comment = 0 $notice_str order by wr_num limit 0, $rows ";


카테고리별 공지 사항은
bbs/list.php  를 건드리셔도 되고

skin 폴더에 list.skin.php 의
리스트 부분에 루프 돌릴때
for ($i=0; $i<count($list); $i++) {
밑에 아래 if 문으로 필터를 해주시면 될듯 합니다
//공지가 아니고 , 공지면 현 카테고리만 보이게
 if (!$list[$i][is_notice] || ( $list[$i][is_notice] && ( $list[$i][ca_name] == $sca || $sca == "")  ){
아래 부분에서 어디에 넣으면 좋을까요? ㅎㅎ

<? for ($i=0; $i<count($list); $i++) { ?>
<tr height=25 align=center>
    <td>
        <?
        if ($list[$i][is_notice]) // 공지사항
            echo "<img src=\"$board_skin_path/img/notice_icon.gif\">";
        else if ($wr_id == $list[$i][wr_id]) // 현재위치
            echo "<font color='#333333'><strong>{$list[$i][num]}</strong>";
        else
            echo "<span style=font-size:8pt;><font face=Tahoma color=#888888>{$list[$i][num]}</font></span>";
        ?></td>
----------------------
© SIRSOFT
현재 페이지 제일 처음으로