테스트 사이트 - 개발 중인 베타 버전입니다

최근게시물 글 순서 (넘버 출력방법 문의드립니다.) 채택완료

워리워리 8년 전 조회 2,421

</p><p> </p><p> </p><p><?php
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
include_once(G5_LIB_PATH.'/thumbnail.lib.php');
// add_stylesheet('css 구문', 출력순서); 숫자가 작을 수록 먼저 출력됨
add_stylesheet('<link rel="stylesheet" href="'.$latest_skin_url.'/style3.css">', 0);
$thumb_set[0]['width'] = 225;
$thumb_set[0]['height'] = 180;
$thumb_set[1]['width'] = 225;
$thumb_set[1]['height'] = 117;
$result = array();
$result_big = '';
for ($i=0; $i<count($list); $i++) {
    $result[$i]['content_class'] = 'content';
    $result[$i]['href'] = $list[$i]['href'];
    $result[$i]['subject'] = $list[$i]['subject'];
    $result[$i]['wr_num'] = $list[$i]['wr_num'];
    if($list[$i]['comment_cnt']) $result[$i]['subject'] .= $list[$i]['comment_cnt'];
    $result[$i]['name'] = $list[$i]['name'];
    $thumb = get_list_thumbnail($bo_table, $list[$i]['wr_id'], $thumb_set[1]['width'], $thumb_set[1]['height']);
    if($thumb['src']) {
        if(!$result_big) {
            $thumb = get_list_thumbnail($bo_table, $list[$i]['wr_id'], $thumb_set[0]['width'], $thumb_set[0]['height']);
            $result_big = $result[$i];
            $result_big['img'] = '<img src="'.$thumb['src'].'" class="thumb_1">';
            $result_big['content'] = '<dd class="caption">'.cut_str($list[$i]['wr_content'],126).'</dd>';
            unset($result[$i]);
        } else {
            $result[$i]['img'] = '<img src="'.$thumb['src'].'" class="thumb_2">';
        } 
    } else {
        $result[$i]['content_class'] .= ' only_text';
        $result[$i]['content'] = '<dd class="caption">'.cut_str(strip_tags($list[$i]['wr_content']),114).'</dd>';
    }
}
?> </p><p> </p><p> </p><p style="margin-left: 40px;">        <dd class="writer"><?php echo $value['name']; ?></dd>
         <dd class=""><?php echo $value['wr_num']; ?></dd> </p><p> </p><p>

 

 

위 방법으로 해서 최근게시물의 글을 출력시키는데.

 

글 넘버가 음수로 표기 됩니다.

음수 표기 없애는 방법이 따로 있을까요??

 

아니면  

 

다른 방법으로 글 넘버출력 하는 방법이 있을까요?? 

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

답변 2개

채택된 답변
+20 포인트
플라이
8년 전

$value['wr_num']; 선언된 소스의 상단을 보시면 페이징과 전체 카운팅 하는 부분을 체크해 보셔야 할듯 싶네요

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

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

8년 전
최근게시물을 5개만 출력할때 나오는 게시물 순번을 말하는건가요??
로그인 후 평가할 수 있습니다

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

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

로그인