그룹내에 모든 게시판에서 조회수 높은 순으로 출력하는 방법(소스첨부)

그룹내에 모든 게시판에서 조회수 높은 순으로 출력하는 방법(소스첨부)

QA

그룹내에 모든 게시판에서 조회수 높은 순으로 출력하는 방법(소스첨부)

본문

아래 소스는 게시판내에서 조회수 높은 순서대로 출력하는  lib/latest_hit.lib.php  소스에요..

그룹 내에 속한 모든 게시판에서 조회수 높은 순서대로 출력하는 방법이 궁금합니다 ㅠ

어느부분을 어떻게 수정해야 출력이 될까요?...ㅠㅠ

도움 부탁드립니다..

 

 


<?php
if (!defined('_GNUBOARD_')) exit;
 
// 최신글 추출
function latest_hit($skin_dir="", $bo_table, $rows=10, $subject_len=40, $options="") 
{ 
    global $g5;
 
    if ($skin_dir) 
        $latest_skin_path = G5_SKIN_PATH.'/latest/'.$skin_dir; 
    else 
        $latest_skin_path = G5_SKIN_URL.'/latest/basic'; 
 
    $list = array(); 
 
    $sql = " select * from {$g5['board_table']} where bo_table = '$bo_table'"; 
    $board = sql_fetch($sql); 
 
    $tmp_write_table = $g5['write_prefix'] . $bo_table; // 게시판 테이블 전체이름 
    //$sql = " select * from $tmp_write_table where wr_is_comment = 0 order by wr_id desc limit 0, $rows "; 
    // 위의 코드 보다 속도가 빠름 
    $sql = " select * from $tmp_write_table where wr_is_comment = 0 order by wr_hit desc limit 0, $rows "; 
    //explain($sql); 
    $result = sql_query($sql); 
    for ($i=0; $row = sql_fetch_array($result); $i++) 
        $list[$i] = get_list($row, $board, $latest_skin_path, $subject_len); 
 
    ob_start();
    include $latest_skin_path.'/latest.skin.php';
    $content = ob_get_contents();
    ob_end_clean();
 
    return $content;
}
?>

이 질문에 댓글 쓰기 :

답변 1

저대로 하였는데~
이미지가 출력이 잘 안되네요 ㅠㅠ

참고 주소로 남겨준 곳의 소스는 그룹에서 출력하는 소스인데

최근게시물 스킨자체에서는 아래처럼 게시판에서 뽑아오는거라..

이미자 자체가 인식못해서 출력이 안되는것 같은데 하단에 어떤부분을 수정해야할까요?


<div class="img">
<a href="<?php echo $list[$i]['href'] ?>">
<?php               
$thumb = get_list_thumbnail($bo_table, $list[$i]['wr_id'], $imgwidth, $imgheight);               
if($thumb['src']) {
$img_content = '<img class="img_left" src="'.$thumb['src'].'" alt="'.$list[$i]['subject'].'" width="'.$imgwidth.'" height="'.$imgheight.'">';
} else {
$img_content = '스크린샷 없음';
}               
echo $img_content;              
?>
</a>
</div>

답변을 작성하시기 전에 로그인 해주세요.
전체 129,406 | RSS
QA 내용 검색

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1402호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT