랭킹스킨을 수정하고 싶은데 도움 좀 부탁드립니다. 채택완료
탑스쿨님의 댓글순 랭킹스킨을 사용하려 하는데
댓글순으로 되는걸 조회순으로 어떻게 바꿔야 할지 몰라 여쭈어 봅니다.
스킨 주소 : http://sir.co.kr/bbs/board.php?bo_table=g4_skin&wr_id=113335&sca=&sfl=wr_subject||wr_content&stx=%EC%9D%BC%EA%B0%84">http://sir.co.kr/bbs/board.php?bo_table=g4_skin&wr_id=113335&sca=&sfl=wr_subject||wr_content&stx=%EC%9D%BC%EA%B0%84
질문/답변 게시판이나 팁자료실등을 찾아보니 중간에 빨간색으로 밑줄그은 곳이 댓글 순으로 정렬되도록 하는 곳 같은데
order by cnt desc -> order by hit desc 로 해봐도 오류만 나오네요
어떻게 수정을 해야할지 도움 부탁드립니다...꾸벅(__)
hitco_latest.lib.php (*extend폴더에 업로드되는 파일)
=====================================================================================================
if (!defined('_GNUBOARD_')) exit; function hitco_latest($skin_dir="basic",$day=1, $rows=10, $subject_len=40, $table="") { global $config, $g4, $topconfig; $list = array(); $hitco_latest_skin_path = "$g4[path]/skin/hitco_latest/$skin_dir"; $where = "where wr_id <> wr_parent"; if($table){ $where .= " and ("; $tmp_Twhere = explode(",",$table); for($i=0;count($tmp_Twhere) > $i; $i++){ if($i == 0) $where .= " bo_table = '{$tmp_Twhere[$i]}'"; else $where .= " or bo_table = '{$tmp_Twhere[$i]}'"; } $where .= " )"; } $where .= " and bn_datetime >= ( now( ) - INTERVAL $day DAY ) and bn_datetime <= now( )"; $tmp_query = sql_query(" select count( wr_id ) AS cnt, bo_table, wr_parent from {$g4['board_new_table']} $where group by bo_table, wr_parent order by cnt desc limit 0, $rows"); $y = 0; for ($i=0; $bo_row = sql_fetch_array($tmp_query); $i++){ // 그룹 게시판 $tmp_table = $g4['write_prefix'].$bo_row[bo_table]; // 게시판 테이블 $sql_table = " select wr_id, wr_subject,wr_datetime from $tmp_table where wr_id = '$bo_row[wr_parent]' "; $row_table = sql_fetch($sql_table); $list[$i][wr_id] = $row_table[wr_id]; $list[$i][bo_table] = $bo_row[bo_table]; $list[$i][comment_cnt] = $bo_row[cnt]; $list[$i][datetime] = substr($row_table[wr_datetime],0,10); $list[$i][subject] = conv_subject($row_table[wr_subject],$subject_len); } ob_start(); include_once ("$hitco_latest_skin_path/latest.skin.php"); $content = ob_get_contents(); ob_end_clean(); return $content; } ?>
====================================================================================================
latest.skin.php(*스킨파일)
====================================================================================================
=$day;?>일간 관심 게시물
-
for ($i=0; $i
- =$list[$i][subject];?>=$list[$i][comment_cnt]?> } ?> if (count($list) == 0) { ?>
- 게시물이 없습니다. } ?>
====================================================================================================
답변을 작성하려면 로그인이 필요합니다.
로그인
wr_hit로도 해봤는데 오류나는건 마찬가지더라구요