그누보드5 베이직 메인레이아웃 변경
본문
제가 원하는 게시판만 메인레이아웃에 추가하고 싶은데
추가하는 것마다 저렇게 뜨네요 ㅜ ㅜ 대체 어떻게 수정을 해야할까요?
공지사항하고 자유게시판만 일단 띄어두고싶은데,
공지사항의 게시판 아이디는[ notice ]이며 자유게시판은[ free ]입니다..
<?php
// 최신글
$sql = " select bo_table
from `{$g5['board_table']}` a left join `{$g5['group_table']}` b on (a.gr_id=b.gr_id)
where a.bo_device <> 'mobile' ";
if(!$is_admin)
$sql .= " and a.bo_use_cert = '' ";
$sql .= " order by b.gr_order, a.bo_order ";
$result = sql_query($sql);
for ($i=0; $row=sql_fetch_array($result); $i++) {
if ($i%2==1) $lt_style = "margin-left:2%";
else $lt_style = "";
?>
<div style="float:left;<?php echo $lt_style ?>" class="lt_wr">
<?php
// 이 함수가 바로 최신글을 추출하는 역할을 합니다.
// 사용방법 : latest(스킨, 게시판아이디, 출력라인, 글자수);
// 테마의 스킨을 사용하려면 theme/basic 과 같이 지정
echo latest('theme/basic', $row['bo_table'], 6, 24);
?>
</div>
<?php
}
?>
답변 3
일단 간단하게 하실려면
$sql = " select bo_table
from `{$g5['board_table']}` a left join `{$g5['group_table']}` b on (a.gr_id=b.gr_id)
where a.bo_device <> 'mobile' and ( a.bo_table = 'notice' or a.bo_table ='free' ) "; 로 해보세요
<div style="float:left;" class="lt_wr">
<?php
echo latest('theme/basic', 'notice', 6, 24);
?>
</div>
<div style="float:left;margin-left:2%" class="lt_wr">
<?php
echo latest('theme/basic', 'free', 6, 24);
?>
</div>
<?php
// 최신글
$sql = " select bo_table
from `{$g5['board_table']}` a left join `{$g5['group_table']}` b on (a.gr_id=b.gr_id)
where a.bo_device <> 'mobile' ";
if(!$is_admin)
$sql .= " and a.bo_use_cert = '' ";
$sql .= " and a.bo_table in ('free', 'notice') "; // 추가 하세요.
$sql .= " order by b.gr_order, a.bo_order ";
$result = sql_query($sql);
for ($i=0; $row=sql_fetch_array($result); $i++) {
if ($i%2==1) $lt_style = "margin-left:2%";
else $lt_style = "";
?>
<div style="float:left;<?php echo $lt_style ?>" class="lt_wr">
<?php
// 이 함수가 바로 최신글을 추출하는 역할을 합니다.
// 사용방법 : latest(스킨, 게시판아이디, 출력라인, 글자수);
// 테마의 스킨을 사용하려면 theme/basic 과 같이 지정
echo latest('theme/basic', $row['bo_table'], 6, 24);
?>
</div>
<?php
}
?>