랭킹스킨을 수정하고 싶은데 도움 좀 부탁드립니다.
본문
탑스쿨님의 댓글순 랭킹스킨을 사용하려 하는데
댓글순으로 되는걸 조회순으로 어떻게 바꿔야 할지 몰라 여쭈어 봅니다.
질문/답변 게시판이나 팁자료실등을 찾아보니 중간에 빨간색으로 밑줄그은 곳이 댓글 순으로 정렬되도록 하는 곳 같은데
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(*스킨파일)
====================================================================================================
<div class="topDayBest">
<h2><span><?=$day;?></span>일간 관심 게시물</h2>
<ol>
<? for ($i=0; $i<count($list); $i++) { ?>
<li class="n<?=$i?>">
<a href="<?=$g4[bbs_path];?>/board.php?bo_table=<?=$list[$i][bo_table];?>&wr_id=<?=$list[$i][wr_id];?>"><?=$list[$i][subject];?><em><?=$list[$i][comment_cnt]?></em></a>
</li>
<? } ?>
<? if (count($list) == 0) { ?><li>게시물이 없습니다.</li><? } ?>
</ol>
</div>
====================================================================================================