최신글 공지사항을 제일 먼제 출력하고 아래는 리스터 순서대로
관련링크
본문
저는 뉴스 사이트를 운영합니다. 한 게시판에서 두개의 뉴스형 최신글을 불러와 메인 페이지를 구성하는데 제일 먼저 공지만 축출하여 헤드라인으로 사용하고 있고요(글자크기등 변경). 아래에 최신글 형태로 일반 뉴스를 축출하고 있습니다.
그런데 아래에 헤드라인에 이미 추출된 공지글이 중복해서 나오게 됩니다. 아래 그림을 참고 하시고 한꺼번에 공지와 함께 추축할 수는 없는지요. 물론 공지는 글자 크기 변경등이 가능하면 좋겠네요.
1.
<meta name="generator" content="Namo WebEditor(Trial)">
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
if($notice>0) {
foreach( $list as $key => $value) $tmp_notice[$key] = $value['is_notice'] *100000 + $value['wr_id'];
array_multisort($tmp_notice, SORT_DESC, $list);
}
$rows = count($list);
$style_name = "mw-group-$bo_table-$rows-$subject_len";
?>
<style type="text/css">
#<?=$style_name?> { clear:both; margin:1; border:1px solid #e1e1e1; }
#<?=$style_name?> .item { clear:both; display:none; }
#<?=$style_name?> .file-img-b { width:90px; height:60px; border:0px solid #e1e1e1; border-left:0; }
#<?=$style_name?> .subject { clear:both; height:30px; color:#666666; font-weight:bold; font-size:13px; }
#<?=$style_name?> .subject a { color:black; text-decoration:none; }
#<?=$style_name?> .prev { float:left; margin:0 0 0 -4px; cursor:pointer; }
#<?=$style_name?> .next { float:left; margin:0 0px 0 0; cursor:pointer; }
#<?=$style_name?> .link { float:left; margin:0 0 0 5px; text-align:center; }
</style>
<div id="<?=$style_name?>">
<? for ($i=0; $i<$rows; $i++) { ?>
<table width="99%" border="0" cellspacing="0" cellpadding="3" style="margin-top:4px; margin-bottom:4px; padding:5px;" height="96">
<tr>
<?
$img = "$g4[path]/data/file/$bo_table/thumb/{$list[$i][wr_id]}";
if (!@file_exists($img)) $img = "";
if (!$list[$i][wr_id]) $img = "";
if (@is_dir($img)) $img = "";
?>
<? if ($img) { ?>
<td width="1747" colspan="3" height="49">
<table border="0" width="100%" cellpadding="0" cellspacing="0">
<tr>
<td width="20" height="23"> </td>
<td width="1174" height="23">
<p style="line-height:150%;"><a href="<?=$list[$i][href]?>"><b><font color="black"><span style="font-size:16pt;"><?=$list[$i][wr_3]?></span></font></b></a></p>
</td></tr> <tr>
<td width="20" height="24"> </td>
<td width="1174" height="24"><p><a href="<?=$list[$i][href]?>"><b><font face="궁서" color="#333333"><span style="font-size:11pt;"><?=$list[$i][wr_1]?></span></font></b></a></p></td>
</tr></table>
</td>
<? } ?>
</tr>
<tr>
<td width="72" height="43"><p align="left"><a href="<?=$list[$i][href]?>"><img src="<?=$img?>" class="file-img-b"></a></p></td>
<td width="3" height="43"> </td>
<td width="1660" height="43" valign="top" background="http://tynews.kr/img/line2.gif">
<span style="color:#333333; font-size:12px"><?=cut_str(strip_tags($list[$i]['wr_2']),280,"...")?></span>
</td></tr></table>
<? } ?>
<? if (count($list) == 0) { echo "<table width='100%' border='0' cellspacing='0' cellpadding='0'>
<tr>
<td></td>
</tr>
</table>"; } ?>
</div>
2.
<meta name="generator" content="Namo WebEditor(Trial)">
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
if($notice>0) {
foreach( $list as $key => $value) $tmp_notice[$key] = $value['is_notice'] *100000 + $value['wr_id'];
array_multisort($tmp_notice, SORT_DESC, $list);
}
$rows = count($list);
$style_name = "mw-group-$bo_table-$rows-$subject_len";
?>
<style type="text/css">
#<?=$style_name?> { clear:both; margin:1; border:1px solid #e1e1e1; }
#<?=$style_name?> .item { clear:both; display:none; }
#<?=$style_name?> .file-img-b { width:90px; height:60px; border:0px solid #e1e1e1; border-left:0; }
#<?=$style_name?> .subject { clear:both; height:30px; color:#666666; font-weight:bold; font-size:13px; }
#<?=$style_name?> .subject a { color:black; text-decoration:none; }
#<?=$style_name?> .prev { float:left; margin:0 0 0 -4px; cursor:pointer; }
#<?=$style_name?> .next { float:left; margin:0 0px 0 0; cursor:pointer; }
#<?=$style_name?> .link { float:left; margin:0 0 0 5px; text-align:center; }
</style>
<div id="<?=$style_name?>">
<? for ($i=0; $i<$rows; $i++) { ?>
<table width="99%" border="0" cellspacing="0" cellpadding="3" style="margin-top:4px; margin-bottom:4px; padding:5px;" height="96">
<tr>
<?
$img = "$g4[path]/data/file/$bo_table/thumb/{$list[$i][wr_id]}";
if (!@file_exists($img)) $img = "";
if (!$list[$i][wr_id]) $img = "";
if (@is_dir($img)) $img = "";
?>
<? if ($img) { ?>
<td width="1747" colspan="3" height="49">
<table border="0" width="100%" cellpadding="0" cellspacing="0">
<tr>
<td width="20" height="23"> </td>
<td width="1174" height="23">
<p style="line-height:150%;"><a href="<?=$list[$i][href]?>"><b><font color="black"><span style="font-size:13pt;"><?=$list[$i][wr_3]?></span></font></b></a></p>
</td></tr> <tr>
<td width="20" height="24"> </td>
<td width="1174" height="24"><p><a href="<?=$list[$i][href]?>"><b><font face="궁서" color="#333333"><span style="font-size:11pt;"><?=$list[$i][wr_1]?></span></font></b></a></p></td>
</tr></table>
</td>
<? } ?>
</tr>
<tr>
<td width="72" height="43"><p align="left"><a href="<?=$list[$i][href]?>"><img src="<?=$img?>" class="file-img-b"></a></p></td>
<td width="3" height="43"> </td>
<td width="1660" height="43" valign="top" background="http://tynews.kr/img/line2.gif">
<span style="color:#333333; font-size:12px"><?=cut_str(strip_tags($list[$i]['wr_2']),280,"...")?></span>
</td></tr></table>
<? } ?>
<? if (count($list) == 0) { echo "<table width='100%' border='0' cellspacing='0' cellpadding='0'>
<tr>
<td></td>
</tr>
</table>"; } ?>
</div>