답변 4개 / 댓글 4개
만약 앞에 공지만 나오게 하고 싶으시면
//skin/board/basic/list.skin.php
74번째 라인에 포문에서
for ($i=0; $i<count($list); $i++) {
//이부분 추가
if (!$list[$i]['is_notice']){continue;}
하시면 공지가 아닌글은 출력 되지 않습니다.
//skin/board/basic/list.skin.php
74번째 라인에 포문에서
for ($i=0; $i<count($list); $i++) {
//이부분 추가
if (!$list[$i]['is_notice']){continue;}
하시면 공지가 아닌글은 출력 되지 않습니다.
도움이 될지 모르겠습니다...
저도 초보라서 확실한 코드인지는 자신하지 못하는데요.. 링크된 소스 수정을 했습니다..
50라인 쯤에..
$sql_search = "";
//공지 중복출력 방지 추가사항
$notice_cnt = 0;
$str_notice = trim($board[bo_notice]);
$str_notice = substr($str_notice, 0, strlen($str_notice)-1);
$arr_notice = explode(",", $str_notice);
if($str_notice) {
$notice_cnt = count($arr_notice);
$no_notice_qry = " and wr_id not IN($str_notice) ";
}
//추가사항 끝
그 바로 아래
$total_count = $board['bo_count_write']; <-- 이부분 대신(원본 코드)
$total_count = $board['bo_count_write'] - $notice_cnt + 1; <-- 이렇게 수정(수정 사항)
좀더 내려가셔서..
/*
$total_page = ceil($total_count / $page_rows); // 전체 페이지 계산
if (!$page) { $page = 1; } // 페이지가 없으면 첫 페이지 (1 페이지)
$from_record = ($page - 1) * $page_rows; // 시작 열을 구함
*/
위 부분을 아래와 같이 수정하시고
$total_page = ceil($total_count / $board[bo_page_rows]); // 전체 페이지 계산
if (!$page) { $page = 1; } // 페이지가 없으면 첫 페이지 (1 페이지)
$from_record = ($page - 1) * $board[bo_page_rows]; // 시작 열을 구함
또 내려 가셔서..
//$sql = " select * from {$write_table} where wr_is_comment = 0 {$sql_order} limit {$from_record}, $page_rows "; <-- 원본 코드
$sql = " select * from {$write_table} where wr_is_comment = 0 {$no_notice_qry} {$sql_order} limit {$from_record}, $page_rows"; <-- 이렇게 수정
좀더 간결하고 확실한 방법은 고수님들께서 해주시리라 믿습니다..
조금이나마 도움이 되면 좋겠습니다..
저도 초보라서 확실한 코드인지는 자신하지 못하는데요.. 링크된 소스 수정을 했습니다..
50라인 쯤에..
$sql_search = "";
//공지 중복출력 방지 추가사항
$notice_cnt = 0;
$str_notice = trim($board[bo_notice]);
$str_notice = substr($str_notice, 0, strlen($str_notice)-1);
$arr_notice = explode(",", $str_notice);
if($str_notice) {
$notice_cnt = count($arr_notice);
$no_notice_qry = " and wr_id not IN($str_notice) ";
}
//추가사항 끝
그 바로 아래
$total_count = $board['bo_count_write']; <-- 이부분 대신(원본 코드)
$total_count = $board['bo_count_write'] - $notice_cnt + 1; <-- 이렇게 수정(수정 사항)
좀더 내려가셔서..
/*
$total_page = ceil($total_count / $page_rows); // 전체 페이지 계산
if (!$page) { $page = 1; } // 페이지가 없으면 첫 페이지 (1 페이지)
$from_record = ($page - 1) * $page_rows; // 시작 열을 구함
*/
위 부분을 아래와 같이 수정하시고
$total_page = ceil($total_count / $board[bo_page_rows]); // 전체 페이지 계산
if (!$page) { $page = 1; } // 페이지가 없으면 첫 페이지 (1 페이지)
$from_record = ($page - 1) * $board[bo_page_rows]; // 시작 열을 구함
또 내려 가셔서..
//$sql = " select * from {$write_table} where wr_is_comment = 0 {$sql_order} limit {$from_record}, $page_rows "; <-- 원본 코드
$sql = " select * from {$write_table} where wr_is_comment = 0 {$no_notice_qry} {$sql_order} limit {$from_record}, $page_rows"; <-- 이렇게 수정
좀더 간결하고 확실한 방법은 고수님들께서 해주시리라 믿습니다..
조금이나마 도움이 되면 좋겠습니다..
답변에 대한 댓글 3개
알려주신 방법대로 해봤더니...
이런 오류가나네요..ㅜ.ㅜ
select * from g4s_write_freeboard where wr_is_comment = 0 and wr_id not IN(18,15,,,,,,,,,,,,) order by wr_num, wr_reply limit 0, 15
1064 : You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ',,,,,,,,,,) order by wr_num, wr_reply limit 0, 15' at line 1
신경써주셔서 감사합니다.
이런 오류가나네요..ㅜ.ㅜ
select * from g4s_write_freeboard where wr_is_comment = 0 and wr_id not IN(18,15,,,,,,,,,,,,) order by wr_num, wr_reply limit 0, 15
1064 : You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ',,,,,,,,,,) order by wr_num, wr_reply limit 0, 15' at line 1
신경써주셔서 감사합니다.
답변을 작성하려면 로그인이 필요합니다.
새로 가입했네요 ^^
먼저 답변 감사드립니다.
본문내용에 있어서 약간 의사소통이 어긋난듯싶네요..
게시판에서 공지선택하고 글 작성하면 그림처럼..
공지 글 밑으로 중복되어서 출력되어지더라구요...
그래서 공지글만 보이게하고 그 밑에 공지하고 중복된 글은 없애버리고 싶거든요...
그누보드4에서는
http://sir.co.kr/bbs/board.php?bo_table=g4_tiptech&wr_id=30672&sca=&sfl=wr_subject%7C%7Cwr_content&stx=%EA%B3%B5%EC%A7%80%EC%82%AC%ED%95%AD+%EC%A4%91%EB%B3%B5
이방법으로 되나봐요..
그래서 시도해봤는데 g4s에서는 함수가 달라지는건지..
제가 php 초보라서 잘 모르겠더라구요...