최근게시물 공지만 출력 도움주세요

· 17년 전 · 1077 · 2
http://sir.co.kr/bbs/board.php?bo_table=g4_tiptech&wr_id=16440


latest.skin.php 첫부분에 추가하세요

foreach( $list as $key => $value) $tmp_notice[$key] = $value['is_notice'] *100000 + $value['wr_id'];
array_multisort($tmp_notice, SORT_DESC, $list);
-------------------------------------------------------
10만을 곱해준 이유는 wr_id 값이 큰 순서로 정렬하기 위함입니다(한개 이상의 공지 및공지가 아닌 게시물들의 출력 순서 결정) -- 10 이나 100 등 아무것이나 할 수 있지만 출력할 목록수보다는 커야겠지요
최신글은 출력할 갯수가 많지않으므로 공지가 있는지 없는지 검사 후에 위 스크립트를
실행 하는 루틴은 생략 했습니다

이것이 필요하다면 latest.lib.php에서 get_list() 다음행에 아래 스크립트를 추가한 후 위 스크립트에 조건으로 넣어주면 됩니다 ( if($notice>0 )
if($list[$i]['is_notice'] ) $notice++;

위 의활요팁에있는내용 입니다.
최근스킨에다 끼워넣어라고 하는데 어떻해 해도 안됩니다.
아래 제가 가쓰는 스킨 어디다 끼워넣어야되는지
도와주세요

답변 감사합니다.


제가 쓰고 있는 최근 스킨
last.skin.php---

<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가

$latest_table = '400'; //테이블폭

?>

<style>
.la_he { font-family:굴림; font-size:9pt; color:#636363;line-height:150%;}
</style>

<table width='<?=$latest_table?>' cellpadding='0' cellspacing='0' border='0' align='left'>

<? for ($i=0; $i<count($list); $i++) { ?>
<tr>
<td width='20' height='23' style='padding-left:5px;'><img src='<?=$latest_skin_path?>/img/latest_icon.gif' width='9' height='9' border='0'></td>
<td width='<?=$latest_table-90?>' valign='bottom' class='la_he'>

<?

$style = "font-family:돋움; font-size:9pt; color:#636363;";
if ($list[$i][icon_new])


$style = "style='font-family:돋움; font-size:9pt; color:#006F00;' ";
$subject = "<span $style>".cut_str($list[$i][subject],47)."</span>"; //제목 글자수 자르기


echo $list[$i][icon_reply] . " ";
echo "<a href='{$list[$i][href]}' title='{$list[$i][subject]}' onfocus='this.blur()'>{$subject}";

if ($list[$i][comment_cnt])
echo " <span style='font-size:8pt; color:#9A9A9A;'>{$list[$i][comment_cnt]}</span>";

echo " " . $list[$i][icon_new];
echo "</a>";
?>

</td>
<td width='70' align='center' class='la_he' valign='bottom'><span style='font-size:8pt; color:#999999;'><?=$list[$i][datetime]?></span>
</td>
</tr>
<tr>
<td height='1' colspan='3' background='<?=$latest_skin_path?>/img/line.gif'></td>
</tr>
<? } ?>

<? if (count($list) == 0) { ?><tr><td colspan=3 align=center height=100><font color=#6A6A6A>게시물이 없습니다.</font></td></tr><? } ?>
</table>
|

댓글 2개

저건 공지글과 일반글을 모두 출력하는 곳에서 공지글을 먼저 출력하는 팁입니다
위 소스를 사용한다면 ?> 바로 윗줄에 넣으면 됩니다
안된다는 건 어떤 상황이라는 것인지....

공지만 출력하는 건 아래 팁입니다
http://sir.co.kr/bbs/tb.php/g4_tiptech/16131/ef478afbccbd2ca801a996facf24092c
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가 <--- 다음 줄에 넣으면 됩니다
댓글을 작성하시려면 로그인이 필요합니다.

그누4 질문답변

그누보드4 관련 질문은 QA 로 이전됩니다. QA 그누보드4 바로가기 기존 게시물은 열람만 가능합니다.

+
제목 글쓴이 날짜 조회
17년 전 조회 864
17년 전 조회 744
17년 전 조회 752
17년 전 조회 674
17년 전 조회 579
17년 전 조회 740
17년 전 조회 1,619
17년 전 조회 753
17년 전 조회 850
17년 전 조회 1,078
17년 전 조회 1,511
17년 전 조회 766
17년 전 조회 953
17년 전 조회 944
17년 전 조회 808
17년 전 조회 1,515
17년 전 조회 844
17년 전 조회 918
17년 전 조회 779
17년 전 조회 733