그룹내에 모든 게시판에서 조회수 높은 순으로 출력하는 방법(소스첨부) 채택완료
본드공
9년 전
조회 6,387
아래 소스는 게시판내에서 조회수 높은 순서대로 출력하는 lib/latest_hit.lib.php 소스에요..
그룹 내에 속한 모든 게시판에서 조회수 높은 순서대로 출력하는 방법이 궁금합니다 ㅠ
어느부분을 어떻게 수정해야 출력이 될까요?...ㅠㅠ
도움 부탁드립니다..
</p><p><?php</p><p>if (!defined('_GNUBOARD_')) exit;</p><p> </p><p>// 최신글 추출</p><p>function latest_hit($skin_dir="", $bo_table, $rows=10, $subject_len=40, $options="") </p><p>{ </p><p> global $g5;</p><p> </p><p> if ($skin_dir) </p><p> $latest_skin_path = G5_SKIN_PATH.'/latest/'.$skin_dir; </p><p> else </p><p> $latest_skin_path = G5_SKIN_URL.'/latest/basic'; </p><p> </p><p> $list = array(); </p><p> </p><p> $sql = " select * from {$g5['board_table']} where bo_table = '$bo_table'"; </p><p> $board = sql_fetch($sql); </p><p> </p><p> $tmp_write_table = $g5['write_prefix'] . $bo_table; // 게시판 테이블 전체이름 </p><p> //$sql = " select * from $tmp_write_table where wr_is_comment = 0 order by wr_id desc limit 0, $rows "; </p><p> // 위의 코드 보다 속도가 빠름 </p><p> $sql = " select * from $tmp_write_table where wr_is_comment = 0 order by wr_hit desc limit 0, $rows "; </p><p> //explain($sql); </p><p> $result = sql_query($sql); </p><p> for ($i=0; $row = sql_fetch_array($result); $i++) </p><p> $list[$i] = get_list($row, $board, $latest_skin_path, $subject_len); </p><p> </p><p> ob_start();</p><p> include $latest_skin_path.'/latest.skin.php';</p><p> $content = ob_get_contents();</p><p> ob_end_clean();</p><p> </p><p> return $content;</p><p>}</p><p>?></p><p>
댓글을 작성하려면 로그인이 필요합니다.
답변 1개
채택된 답변
+20 포인트
9년 전
http://sir.kr/g5_skin/7720?sca=%EC%B5%9C%EC%8B%A0%EA%B8%80&sfl=wr_subject%7C%7Cwr_content&stx=%EA%B7%B8%EB%A3%B9+%EC%A1%B0%ED%9A%8C%EC%88%98">http://sir.kr/g5_skin/7720?sca=%EC%B5%9C%EC%8B%A0%EA%B8%80&sfl=wr_subject%7C%7Cwr_content&stx=%EA%B7%B8%EB%A3%B9+%EC%A1%B0%ED%9A%8C%EC%88%98
참고해보세요~
로그인 후 평가할 수 있습니다
답변에 대한 댓글 1개
�
본드공
9년 전
댓글을 작성하려면 로그인이 필요합니다.
답변을 작성하려면 로그인이 필요합니다.
로그인
이미지가 출력이 잘 안되네요 ㅠㅠ
참고 주소로 남겨준 곳의 소스는 그룹에서 출력하는 소스인데
최근게시물 스킨자체에서는 아래처럼 게시판에서 뽑아오는거라..
이미자 자체가 인식못해서 출력이 안되는것 같은데 하단에 어떤부분을 수정해야할까요?
<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>