공지정렬관련 > 그누4 질문답변

그누4 질문답변

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

공지정렬관련 정보

공지정렬관련

본문

if (!$sca && !$stx )
{
    $arr_notice = explode("\n", trim($board[bo_notice]));
    for ($k=0; $k<count($arr_notice); $k++)
    {
        if (trim($arr_notice[$k])=='') continue;

        $row = sql_fetch(" select * from $write_table where wr_id = '$arr_notice[$k]' ");

        if (!$row[wr_id]) continue;

        $list[$i] = get_list($row, $board, $board_skin_path, $board[bo_subject_len]);
        $list[$i][is_notice] = true;

        $i++;
    }
}
공지가 중복으로 나와서요.. 윗부분 다 없애구요
아래 $sql = 에 공지부터 나오게 하는 구문을 추가 시키면 될것같은데... ?
다음페이지에도 공지 나올필요 없고 일반처럼! 그냥 간단하게 공지체크된거가 먼저나오는 정렬로 나오게 하려고 하거든요...
제 실력으로는 아무리 해도 잘 안되네요.. 방법이 있을까요?.
그런데 위에 부분 다없애도 문제없을까요?


//정렬부분
 if ($sst)
    $sql_order = " order by $sst $sod ";
   

if ($sca || $stx ) //20120421 1~4추가
{
    $sql = " select distinct wr_parent from $write_table where $sql_search $sql_order limit $from_record, $board[bo_page_rows] ";
}
else
{
    $sql = " select * from $write_table where wr_is_comment = 0 $sql_order limit $from_record, $board[bo_page_rows] ";
}
$result = sql_query($sql);

// 년도 2자리
$today2 = $g4[time_ymd];
  • 복사

댓글 전체

list.php의 아래 부분을 찾아서

if (!$sca && !$stx)
{
    $arr_notice = split("\n", trim($board[bo_notice]));
    for ($k=0; $k<count($arr_notice); $k++)
    {
        if (trim($arr_notice[$k])=='') continue;

        $row = sql_fetch(" select * from $write_table where wr_id = '$arr_notice[$k]' ");

        if (!$row[wr_id]) continue;

        $list[$i] = get_list($row, $board, $board_skin_path, $board[bo_subject_len]);
        $list[$i][is_notice] = true;

        $i++;
    }
}

밑에 아래 부분을 추가합니다.

else if ($sca && !$stx) {
    $arr_notice = split("\n", trim($board[bo_notice]));
    for ($k=0; $k<count($arr_notice); $k++)
    {
        if (trim($arr_notice[$k])=='') continue;

        $row = sql_fetch(" select * from $write_table where wr_id = '$arr_notice[$k]' and ca_name = '$sca' ");

        if (!$row[wr_id]) continue;

        $list[$i] = get_list($row, $board, $board_skin_path, $board[bo_subject_len]);
        $list[$i][is_notice] = true;

        $i++;
    } 
}
© SIRSOFT
현재 페이지 제일 처음으로