Copy
<?phpfor ($i=0; $i<count($list); $i++) {?> ----------------------------------------- <td class="hidden-xs"><?php echo $i+1 ?></td>
이렇게만 올려도 될런지 모르겠는데...;;
지금은 게시판글번호가
1
2
3
4
이런식으로 나오구요..
제가 원하는건 쓸때마다 번호가 위로 올라가게
4
3
2
1
이런식으로 하고싶은데.. 모르겠네요 도와주세요..ㅠ
답변 2개 / 댓글 3개
2017-04-21 (금) 17:27:02
<?php echo $list[$i]['num']; ?>
이미 계산된 값이 있습니다.
답변에 대한 댓글 2개
조폭고냥이
2017-04-21 (금) 17:28:22
2017-04-21 (금) 17:30:54
/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 안에 푸쉬합니다.
2017-04-21 (금) 17:12:25
<td class="hidden-xs"><?php echo $i+1 ?></td>
=> 아래와 같이 하시면 될거 같습니다.
<td class="hidden-xs"><?php echo count($list) - 1 ?></td>
답변에 대한 댓글 1개
답변을 작성하려면 로그인이 필요합니다.
근데 왜 1번이 아니라 4번부터 나오는거죠...ㅠ