// 이미지글수 $img = array(); $img_arr = array(); $wset['image'] = 1; //이미지글만 추출 $wset['rows'] = $img_post_cnt; $img = apms_board_rows($wset); $img_cnt = count($img); for ($i = 0; $i < $img_cnt; $i++) { $img_arr[$i] = $img[$i]['bo_table'] . '-' . $img[$i]['wr_id']; } // 리스트글 - 중복글 제외 $tmp = array(); $wset['image'] = ''; $wset['rows'] = $post_cnt + $img_cnt; $tmp = apms_board_rows($wset); $tmp_cnt = count($tmp); $z = 0; for ($i = 0; $i < $tmp_cnt; $i++) { $chk_wr = $tmp[$i]['bo_table'] . '-' . $tmp[$i]['wr_id']; if ($img_cnt && in_array($chk_wr, $img_arr)) { continue; } $list[$z] = $tmp[$i]; if ($z == $post_cnt) { break; } $z++; } unset($tmp); $list_cnt = count($list);
<?php if (!defined('_GNUBOARD_')) { exit; } //개별 페이지 접근 불가 // 썸네일 $wset['thumb_w'] = isset($wset['thumb_w']) && $wset['thumb_w'] > 0 ? $wset['thumb_w'] : 400; $wset['thumb_h'] = isset($wset['thumb_h']) && $wset['thumb_h'] > 0 ? $wset['thumb_h'] : 225; $wset['scut'] = isset($wset['scut']) && $wset['scut'] > 0 ? $wset['scut'] : ''; $wset['cut'] = isset($wset['cut']) && $wset['cut'] > 0 ? $wset['cut'] : ''; $wset['ncut'] = isset($wset['ncut']) && $wset['ncut'] > 0 ? $wset['ncut'] : ''; // 추출수 $wset['rows'] = $wset['garo'] * $wset['sero']; // 추출하기 $list = apms_board_rows($wset); $list_cnt = count($list); // 글수 // 높이 $img_height = apms_img_height($wset['thumb_w'], $wset['thumb_h'], 100); // 랭킹 $rank = apms_rank_offset($wset['rows'], $wset['page']); // 라벨 $labels = array(); $label_cnt = 0; if (isset($wset['label']) && $wset['label']) { $labels = apms_label_list($wset); $label_cnt = count($labels); $wset['label_color'] = isset($wset['label_color']) && $wset['label_color'] ? $wset['label_color'] : 'gray'; } // 링크
$list = apms_board_rows($wset); $list_cnt = count($list); $img = array(); $k = 0; for ($i = 0; $i < $list_cnt; $i++) { if ($list[$i]['img']['src']) { $img[$k] = $list[$i]; $k++; } } if (!$k || $is_dadan && $k < 2) { $wset['image'] = 1; //이미지글만 추출 $wset['rows'] = 2; //2개만 추출 $img = apms_board_rows($wset); } $img_cnt = count($img); // 이미지 랜덤 if (isset($wset['irdm']) && $wset['irdm']) { shuffle($img); } // 아이콘 $icon = isset($wset['icon']) && $wset['icon'] ? apms_fa($wset['icon']) : ''; // 높이 $img_height = apms_img_height($wset['thumb_w'], $wset['thumb_h'], 100); // 랭킹 $rank = apms_rank_offset($wset['rows'], $wset['page']); // 링크 $is_link = isset($wset['link']) && $wset['link'] ? true : false; // 제목