게시판 글번호 역순 채택완료
조폭고냥이
8년 전
조회 5,725
<?php</p><p>for ($i=0; $i<count($list); $i++) {</p><p>?></p><p> </p><p>-----------------------------------------</p><p> </p><p><td class="hidden-xs"><?php echo $i+1 ?></td> </p><p>
이렇게만 올려도 될런지 모르겠는데...;;
지금은 게시판글번호가
1
2
3
4
이런식으로 나오구요..
제가 원하는건 쓸때마다 번호가 위로 올라가게
4
3
2
1
이런식으로 하고싶은데.. 모르겠네요 도와주세요..ㅠ
댓글을 작성하려면 로그인이 필요합니다.
답변 2개
답변에 대한 댓글 2개
�
조폭고냥이
8년 전
�
잉끼다
8년 전
/bbs/list.php 중./..
while ($row = sql_fetch_array($result))
{
// 검색일 경우 wr_id만 얻었으므로 다시 한행을 얻는다
if ($sca || $stx)
$row = sql_fetch(" select * from {$write_table} where wr_id = '{$row['wr_parent']}' ");
$list[$i] = get_list($row, $board, $board_skin_url, G5_IS_MOBILE ? $board['bo_mobile_subject_len'] : $board['bo_subject_len']);
if (strstr($sfl, 'subject')) {
$list[$i]['subject'] = search_font($stx, $list[$i]['subject']);
}
$list[$i]['is_notice'] = false;
$list_num = $total_count - ($page - 1) * $list_page_rows - $notice_count;
$list[$i]['num'] = $list_num - $k;
$i++;
$k++;
}
전체 게시물 수 에서 순차적으로 1씩 빼면서 $list 안에 푸쉬합니다.
while ($row = sql_fetch_array($result))
{
// 검색일 경우 wr_id만 얻었으므로 다시 한행을 얻는다
if ($sca || $stx)
$row = sql_fetch(" select * from {$write_table} where wr_id = '{$row['wr_parent']}' ");
$list[$i] = get_list($row, $board, $board_skin_url, G5_IS_MOBILE ? $board['bo_mobile_subject_len'] : $board['bo_subject_len']);
if (strstr($sfl, 'subject')) {
$list[$i]['subject'] = search_font($stx, $list[$i]['subject']);
}
$list[$i]['is_notice'] = false;
$list_num = $total_count - ($page - 1) * $list_page_rows - $notice_count;
$list[$i]['num'] = $list_num - $k;
$i++;
$k++;
}
전체 게시물 수 에서 순차적으로 1씩 빼면서 $list 안에 푸쉬합니다.
댓글을 작성하려면 로그인이 필요합니다.
답변을 작성하려면 로그인이 필요합니다.
로그인
근데 왜 1번이 아니라 4번부터 나오는거죠...ㅠ