배너 테이블로 출력하기 질문드립니다.
탑스쿨님 배너관리스킨(http://sir.kr/g4_skin/89432)을 G5에 맞게 변경해서 사용중인데요~
현재 등록한배너가 15개 있다면
ㅁ ㅁ ㅁ ㅁ
ㅁ ㅁ ㅁ ㅁ
ㅁ ㅁ ㅁ ㅁ
ㅁ ㅁ ㅁ
한줄에 4개씩 위와같이 출력하고싶습니다.
혼자서 G5에맞게 변경도하고 출력부분 소스에 테이블넣고 여러가지 시도는해봤는데 해결이안되서
질문올립니다ㅠㅠ
Copy
<?if (!defined('_GNUBOARD_')) exit;// banner_latest(세로출력row 가로출력 col , 중앙[c] 왼쪽[l] 오른쪽[r] 하단[b] 그룹[g] 랜덤[d] , limit ); // 주의사항 : d 랜덤 일때는 무조건 limit 1 로 만듬function banner_latest($skin="row", $loca="l" ,$limit="100"){ global $config, $g5; $upload_dir = "/data/banner/"; if($loca) $sql_search = " and bn_location = '$loca'"; $order_by = ""; if($loca=="d"){ // 랜덤 이면 무조건 한개만 출력 $order_by = "order by rand() desc"; $limit = 1; }else{ $order_by = "order by bn_seq desc"; } $time = G5_TIME_YMDHIS; $sql = "select * from g4_topschool_banner where bn_start_date < '$time' and bn_end_date > '$time' and bn_openchk = '1' $sql_search $order_by limit $limit"; $result = sql_query($sql); if ($result) { $i = 0; while($rs = sql_fetch_array($result)) { $file = ""; $target = ""; if($rs[bn_target]) $target = "target='_blank'"; if($rs[bn_file_type] == 13){ $file = "<script>doc_write(flash_movie('{$upload_dir}{$rs[bn_file_name]}', 'banner_{$rs[bn_id]}', '{$rs[bn_width]}', '{$rs[bn_height]}', 'transparent'));</script>"; }else{ $file = "<td><a href=\"{$rs[bn_url]}\" $target ><img src=\"{$upload_dir}{$rs[bn_file_name]}\" border=0 style=\"cursor\" width='{$rs[bn_width]}' height='{$rs[bn_height]}'></a></td>"; } $style=""; if($i >= 1) $style="style=\"margin-top:10px;\""; if($skin == "row") echo "<div $style align=\"center\">{$file}</div>"; if($skin == "col") echo "<span>{$file}</span>"; $i++; } }}?>
답변 1개 / 댓글 1개
2016-08-29 (월) 20:23:06
혹시 게시판설정에서 한줄에 나타낼 글 수 도 확인해보셨나요?
답변에 대한 댓글 1개
fdud3889
2016-08-29 (월) 20:26:24
답변을 작성하려면 로그인이 필요합니다.
소스상으로봤을때 가로출력인 col로 설정했을때는 <span>{$file}</span>으로
행을 나누는건 없어보이네요;;