배너 테이블로 출력하기 질문드립니다.
fdud3889
9년 전
조회 5,724
탑스쿨님 배너관리스킨(http://sir.kr/g4_skin/89432)을">http://sir.kr/g4_skin/89432)을 G5에 맞게 변경해서 사용중인데요~
현재 등록한배너가 15개 있다면
ㅁ ㅁ ㅁ ㅁ
ㅁ ㅁ ㅁ ㅁ
ㅁ ㅁ ㅁ ㅁ
ㅁ ㅁ ㅁ
한줄에 4개씩 위와같이 출력하고싶습니다.
혼자서 G5에맞게 변경도하고 출력부분 소스에 테이블넣고 여러가지 시도는해봤는데 해결이안되서
질문올립니다ㅠㅠ
</p><p><?
if (!defined('_GNUBOARD_')) exit;</p><p>// banner_latest(세로출력row 가로출력 col , 중앙[c] 왼쪽[l] 오른쪽[r] 하단[b] 그룹[g] 랜덤[d] , limit );
// 주의사항 : d 랜덤 일때는 무조건 limit 1 로 만듬</p><p>function banner_latest($skin="row", $loca="l" ,$limit="100")
{
global $config, $g5;</p><p> $upload_dir = "/data/banner/";</p><p> if($loca)
$sql_search = " and bn_location = '$loca'";</p><p> $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 = "";</p><p> 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>";
}</p><p> $style="";
if($i >= 1)
$style="style=\"margin-top:10px;\"";</p><p> if($skin == "row")
echo "<div $style align=\"center\">{$file}</div>";</p><p> if($skin == "col")
echo "<span>{$file}</span>";</p><p> $i++;
}
}
}</p><p>?></p><p>
댓글을 작성하려면 로그인이 필요합니다.
답변 1개
답변을 작성하려면 로그인이 필요합니다.
로그인
소스상으로봤을때 가로출력인 col로 설정했을때는 <span>{$file}</span>으로
행을 나누는건 없어보이네요;;