그룹 최근글 정렬방식 > 글제목 순서로 정렬
본문
안녕하세요. ㅠ.ㅠ
https://selhak.com/bbs/group.php?gr_id=infomation
이 그룹에 게시판들 최신글 정렬을
게시글 제목 순으로 하고 싶어요.
어느 부분을 변경하면 될까요?
도와주세요 ㅠ.ㅠ
감사합니다!
<td class="text-center">정렬 방법</td>
<td>
<?php $wset['sort'] = isset($wset['sort']) ? $wset['sort'] : ''; ?>
<select name="wset[sort]" class="custom-select">
<?php echo na_sort_options($wset['sort']);?>
</select>
</td>
widget.setup.php 이부분에서 $wset['sort'] 이부분의 함수를 변경해야 할거 같은데 어느 파일에 있을까요?
답변 1
lib/latest.lib.php에 있는 다음 함수에서
// 최신글 추출
function latest($skin_dir='', $bo_table, $rows=10, $subject_len=40, $cache_time=1, $options='')
$tmp_write_table = $g5['write_prefix'] . $bo_table; // 게시판 테이블 전체이름
$sql = " select * from {$tmp_write_table} where wr_is_comment = 0 order by wr_num limit 0, {$rows} ";
여기 order by wr_num을
여기 order by wr_subject로 바꾸면 됩니다.
latest()사용하는 모든 곳에 적용됩니다.