공지사항쓰면 모든게시판에 등록하는 문제 ㅜㅜ 채택완료
쥬리앙
10년 전
조회 3,943
</p><p> </p><pre>// 공지 처리(추가)
$board_notice_name='notice'; // 전체 공지를 줄 게시판명 (공지게시판을 따로 두어야함..)
$board_notice=sql_fetch(" select * from `g5_board` where `bo_table`='$board_notice_name' ");
if (!$sca && !$stx && $board['bo_table']!=$board_notice_name) {
$arr_notice = explode(',', trim($board_notice['bo_notice']));
$from_notice_idx = ($page - 1) * $page_rows;
if($from_notice_idx < 0)
$from_notice_idx = 0;
$board_notice_count = count($arr_notice);
$total_count+=$board_notice_count;
for ($k=0; $k<$board_notice_count; $k++) {
if (trim($arr_notice[$k]) == '') continue;
$row = sql_fetch(" select * from `g5_write_".$board_notice_name."` where wr_id = '{$arr_notice[$k]}' ");
if (!$row['wr_id']) continue;
$notice_array[] = 0;
if($k < $from_notice_idx) continue;
$list[$i] = get_list($row, $board_notice, $board_skin_url, G5_IS_MOBILE ? $board['bo_mobile_subject_len'] : $board['bo_subject_len']);
$list[$i]['is_notice'] = true;
$i++;
$notice_count++;
if($notice_count >= $list_page_rows)
break;
}
}
// 공지 처리(원본)
if (!$sca && !$stx) {
......(후략)
</pre><p> </p><p>
공지사항을 쓰면 모든게시판에 적용되는 소스입니다.
여기서 원하는 게시판에만 적용되게 하려면 어느부분을 손봐야할까요?ㅜㅜ
고수님들 도와주세요 ~~
댓글을 작성하려면 로그인이 필요합니다.
답변 2개
채택된 답변
+20 포인트
10년 전
if (!$sca && !$stx && $board['bo_table']!=$board_notice_name) {
이 부분을 아래처럼 변경해보세요.
$bo_table == '1111' 이렇게 필요한 게시판만 골라서 넣으면 됩니다.
if (!$sca && !$stx && $board['bo_table']!=$board_notice_name && ($bo_table == '1111' || $bo_table == '2222' || $bo_table == '3333')) {
로그인 후 평가할 수 있습니다
댓글을 작성하려면 로그인이 필요합니다.
답변을 작성하려면 로그인이 필요합니다.
로그인