그룹게시판의 인기글을 뽑고싶어요 채택완료
크루오얼
10년 전
조회 3,419
</p><p><span style="font-size: 14.6666669845581px; line-height: 1.5;"><?php</span></p><p style="font-size: 14.6666669845581px;">if (!defined('_GNUBOARD_')) exit;</p><p style="font-size: 14.6666669845581px;"> </p><p style="font-size: 14.6666669845581px;">// 인기글 추출</p><p style="font-size: 14.6666669845581px;">// $cache_time 캐시 갱신시간</p><p style="font-size: 14.6666669845581px;">function latest_popular($bo_table, $rows=10, $subject_len=40, $term='', $options='')</p><p style="font-size: 14.6666669845581px;">{</p><p style="font-size: 14.6666669845581px;"> global $g5;</p><p style="font-size: 14.6666669845581px;"> </p><p style="font-size: 14.6666669845581px;"><span class="Apple-tab-span" style="white-space: pre;"> </span>switch($term){</p><p style="font-size: 14.6666669845581px;"><span class="Apple-tab-span" style="white-space: pre;"> </span>case '일간': $term_time = date("Y-m-d H:i:s", G5_SERVER_TIME-3600*24); break;</p><p style="font-size: 14.6666669845581px;"><span class="Apple-tab-span" style="white-space: pre;"> </span>case '주간': $term_time = date("Y-m-d H:i:s", G5_SERVER_TIME-3600*24*7); break;</p><p style="font-size: 14.6666669845581px;"><span class="Apple-tab-span" style="white-space: pre;"> </span>case '월간': $term_time = date("Y-m-d H:i:s", G5_SERVER_TIME-3600*24*30); break;</p><p style="font-size: 14.6666669845581px;"><span class="Apple-tab-span" style="white-space: pre;"> </span>}</p><p style="font-size: 14.6666669845581px;"> </p><p style="font-size: 14.6666669845581px;"> $list = array();</p><p style="font-size: 14.6666669845581px;"> </p><p style="font-size: 14.6666669845581px;"> if($gr_id){ //각 그룹게시판 출력</p><p style="font-size: 14.6666669845581px;"> </p><p style="font-size: 14.6666669845581px;"> $sql = " select * from {$g5['board_table']} where gr_id = '{$gr_id}' ";</p><p style="font-size: 14.6666669845581px;"> $group = sql_query($sql);</p><p style="font-size: 14.6666669845581px;"> </p><p style="font-size: 14.6666669845581px;"> for ($b=0; $board = sql_fetch_array($group); $b++)</p><p style="font-size: 14.6666669845581px;"> $bo_subject = get_text($board['bo_subject']); </p><p style="font-size: 14.6666669845581px;"> $tmp_write_table = $g5['write_prefix'] . $board[bo_table]; // 게시판 테이블 전체이름</p><p style="font-size: 14.6666669845581px;"> $sql_between = " wr_datetime between '$term_time' and '".G5_TIME_YMDHIS."' ";</p><p style="font-size: 14.6666669845581px;"> $sql = " select * from {$tmp_write_table} where wr_is_comment = 0 and {$sql_between} order by {$options} limit 0, {$rows} ";</p><p style="font-size: 14.6666669845581px;"> $result = sql_query($sql);</p><p style="font-size: 14.6666669845581px;"> for ($i=0; $row = sql_fetch_array($result); $i++)</p><p style="font-size: 14.6666669845581px;"> {</p><p style="font-size: 14.6666669845581px;"> $list[$i] = get_list($row, $board, $latest_skin_url, $subject_len);</p><p style="font-size: 14.6666669845581px;"> }</p><p style="font-size: 14.6666669845581px;"> }</p><p style="font-size: 14.6666669845581px;"> </p><p style="font-size: 14.6666669845581px;"> ob_start();</p><p><span style="font-size: 14.6666669845581px; line-height: 1.5;">?> </span> </p><p><span style="font-size: 14.6666669845581px; line-height: 1.5;">
sir 참조하며 이렇게 만들어봤지만, 그룹게시판에서 추출이 안되네요 ㅠㅠ
어디가 틀린것인가요?
댓글을 작성하려면 로그인이 필요합니다.
답변 1개
답변을 작성하려면 로그인이 필요합니다.
로그인