2026, 새로운 도약을 시작합니다.

검색했을때 공지사항 유지되게 하는방법이 있을까요? 채택완료

<?php for ($i=0; $i<count($list); $i++) {

if($i>0 && ($i % $bo_gallery_cols == 0))

$style = '';

else

$style = '';

if ($i == 0) $k = 0;

$k += 2;

if ($k % $bo_gallery_cols == 0) ;

?>

<?php

if ($list[$i]['is_notice']) { // 공지사항 ?>

<ul class="bl_box">

<?} else{?>

<ul class="bl_box" style="<?php echo $style ?>">

<?}?>

<li class="zoom" >

<a href="<?php echo $list[$i]['href'] ?>" style="position:relative;">

<?

$thumb = get_list_thumbnail($board['bo_table'], $list[$i]['wr_id'], $board['bo_gallery_width'], $board['bo_gallery_height'], false, true, 'top');

if($thumb['src']) {

$img_content = '<img src="'.$thumb['src'].'" alt="'.$thumb['alt'].'" width="'.$board['bo_gallery_width'].'" height="'.$board['bo_gallery_height'].'">';

} else {

$img_content = '<div class="no_img1" style="width="'.$width.'" height="'.$height.'"><img src="/theme/basic/img/who2.png"></div>';

}

echo $img_content;

?>

</a>

</li>

<li class="bl_w25"></li>

<li class="zoom">

<a href="<?php echo $list[$i]['href'] ?>" style="position:relative; display:block;">

<?php

$thumb1 = get_list_thumbnail_1($board['bo_table'], $list[$i]['wr_id'], $board['bo_gallery_width'], $board['bo_gallery_height'],1);

if($thumb1['src']) {

$img_content1 = '<img src="'.$thumb1['src'].'" alt="'.$thumb1['alt'].'" width="'.$board['bo_gallery_width'].'" height="'.$board['bo_gallery_height'].'">';

} else {

$img_content1 = '<div class="no_img1" style="width="'.$width.'" height="'.$height.'"><img src="/theme/basic/img/who2.png"></div>';

}

echo $img_content1;

?>

</a>

</li>

공지사항으로 게시판을 만들었는데 검색을하면 공지사항 체크된 부분이 사라지고 검색된것들이 위에 올라오는데 검색을 해도 항상 고정되있게 할수있는 방법이 있을까요???

답변 1개

질문자님 말씀대로라면 페이징에서도 신경 써야 합니다.

그러지마시고 차라리 공지만 따로 최근글로 추출해서 게시판 헤더에 넣으세요.

그리고 리스트에는 공지 제외 처리 하시구요.

로그인 후 평가할 수 있습니다

댓글을 작성하려면 로그인이 필요합니다.

답변을 작성하려면 로그인이 필요합니다.

로그인
🐛 버그신고