D

그누보드의 3일최다댓글 구현..

질문을 검색해도 없거나 찾지 못해 올립니다.

그누보드 오른쪽에 있는 3일 최다 댓글을 뽑으려면 sql문에서 어떻게 처리해야 하나요 ?
|

댓글 2개

조건0, 전체 게시판 테이블 로드
조건1, 현제 날짜에서 3일전것까지 로드
조건2, 댓글수로 desc
$tsql = sql_query("select count( wr_id ) AS cnt, bo_table, wr_parent from $g4[board_new_table] where bn_datetime >= ( now( ) - INTERVAL 3 DAY ) and bn_datetime <= now( ) group by bo_table, wr_parent order by cnt desc limit 10");
for($i=0; $temp = sql_fetch_array($tsql); $i++) {
$temp1[$i] = $temp;
}
@mysql_free_result($tsql);
unset($temp);
foreach($temp1 as $temp) {

$array_new = sql_fetch(" select count(wr_comment) AS cnt from ". $g4['write_prefix'].$temp[bo_table]. " where wr_id = '$temp[wr_id]' order by cnt desc limit 10");
if($array_new['wr_subject']=="") {
echo "<a href=\"".$g4['path']."/bbs/board.php?bo_table=$temp[bo_table]&wr_id=$temp[wr_id]\">".cut_str($array_new['wr_content'], 16,'...')."  <font color='#999999' style='font-size:8pt;'>(".$array_new['wr_hit'].")</a></font><br>";
} else {
echo "<a href=\"".$g4['path']."/bbs/board.php?bo_table=$temp[bo_table]&wr_id=$temp[wr_id]\">".cut_str($array_new['wr_subject'], 16,'...')."  <font color='#999999' style='font-size:8pt;'>(".$array_new['wr_hit'].")</a></font><br>";
}

unset($temp1);
unset($array_new);

이렇게 하는데 도무지 개념은 이해가 가는데... 막상 그림은 안 그려지네요
댓글을 작성하시려면 로그인이 필요합니다.

그누4 질문답변

그누보드4 관련 질문은 QA 로 이전됩니다. QA 그누보드4 바로가기 기존 게시물은 열람만 가능합니다.

+
제목 글쓴이 날짜 조회
14년 전 조회 868
14년 전 조회 1,465
14년 전 조회 882
14년 전 조회 1,632
14년 전 조회 1,663
14년 전 조회 7,538
14년 전 조회 1,033
14년 전 조회 1,172
14년 전 조회 2,336
14년 전 조회 1,001
14년 전 조회 2,227
14년 전 조회 1,545
14년 전 조회 1,278
14년 전 조회 1,580
14년 전 조회 1,027
14년 전 조회 1,469
14년 전 조회 991
14년 전 조회 1,682
14년 전 조회 1,550
14년 전 조회 1,651