
안녕하세요?
원하는 게시판만 최신글로 출력이 되게
index.php 을 다음과 같이 수정했는데
Copy
<div style="float:left;<?php echo $lt_style ?>"> <?php // 이 함수가 바로 최신글을 추출하는 역할을 합니다. // 사용방법 : latest(스킨, 게시판아이디, 출력라인, 글자수); echo latest("basic","cc", 6, 25); ?> </div>
이렇게 했더니 여덟개가 나와버리네요 왜 이럴까요?
그리고 최신글이 왼쪽으로 쏠려 있는데 이거는 어떻게 수정해야 할까요?
위의 코드에 float:left는 아니더군요
도움 주시면 정말 감사하겠습니다.
즐겁고 행복한 주말 되세요
답변 3개 / 댓글 9개
채택된 답변
+20 포인트
echo latest("basic","cc", 6, 25); break;
팁게시판에서 '사노라가노라'님의 글을 찾아보세요.
제외할 게시판을 적용하는 소스를 입력해주면 됩니다.
제외할 게시판을 적용하는 소스를 입력해주면 됩니다.
답변에 대한 댓글 3개
[code]// 최신글
$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 ";
$sql = " select bo_table, bo_subject from {$g5['board_table']} where bo_table in ('cc') order by gr_id, bo_table";
$result = sql_query($sql);
for ($i=0; $row=sql_fetch_array($result); $i++) {
if ($i%2==1) $lt_style = "margin-left:20px";
else $lt_style = "";
?>
<div style="float:left;<?php echo $lt_style ?>">
<?php
// 이 함수가 바로 최신글을 추출하는 역할을 합니다.
// 사용방법 : latest(스킨, 게시판아이디, 출력라인, 글자수);
echo latest("basic", $row['bo_table'], 5, 25);
?>
</div>
<?php
}
?>
<!-- } 최신글 끝 -->[/code]
$sql = " select bo_table, bo_subject from {$g5['board_table']} where bo_table in ('cc') order by gr_id, bo_table";
'not in'을 'in'으로 수정했습니다.
더 추가할 게시판이 있으면... 아래와 같이...
$sql = " select bo_table, bo_subject from {$g5['board_table']} where bo_table in ('게시판1', '게시판2', '게시판3') order by gr_id, bo_table";
$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 ";
$sql = " select bo_table, bo_subject from {$g5['board_table']} where bo_table in ('cc') order by gr_id, bo_table";
$result = sql_query($sql);
for ($i=0; $row=sql_fetch_array($result); $i++) {
if ($i%2==1) $lt_style = "margin-left:20px";
else $lt_style = "";
?>
<div style="float:left;<?php echo $lt_style ?>">
<?php
// 이 함수가 바로 최신글을 추출하는 역할을 합니다.
// 사용방법 : latest(스킨, 게시판아이디, 출력라인, 글자수);
echo latest("basic", $row['bo_table'], 5, 25);
?>
</div>
<?php
}
?>
<!-- } 최신글 끝 -->[/code]
$sql = " select bo_table, bo_subject from {$g5['board_table']} where bo_table in ('cc') order by gr_id, bo_table";
'not in'을 'in'으로 수정했습니다.
더 추가할 게시판이 있으면... 아래와 같이...
$sql = " select bo_table, bo_subject from {$g5['board_table']} where bo_table in ('게시판1', '게시판2', '게시판3') order by gr_id, bo_table";
답변에 대한 댓글 5개
$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:40px";
else $lt_style = "";
네 이렇게 포문이 있긴 한데 이것을 수정해야 할까요?
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:40px";
else $lt_style = "";
네 이렇게 포문이 있긴 한데 이것을 수정해야 할까요?
답변을 작성하려면 로그인이 필요합니다.
브레이크로 반복을 중단해야 하는군요
큰 고민이 해결되었습니다. 행복한 주말 되세요