최근게시물에서 공지사항 맨 위에 표시하기 > 질문답변

본문 바로가기
사이트 내 전체검색

질문답변

서버정보나 계정정보는 보안유지를 위해 관리자쪽지나 메일로 발송해 주시거나 제작의뢰 게시판을 이용해 주시면 감사하겠습니다..

최근게시물에서 공지사항 맨 위에 표시하기

페이지 정보

본문

보통은 위 그림처럼 최근게시물에 공지사항을 올린 후 일반 게시물을 올리면 공지사항이 밑으로 내려갑니다.

제가 구현하고자 하는건 최근게시물에서 공지사항은 내려가지 않고 계속해서 최근게시물 맨 위에 표시하고자 했으면 합니다.

------------------------------------------------------------

위 질문을 올렸더니 어떤 분이 아래와 같은 답변을 주시더군요.

<? for ($i=1; $i<count($list); $i++) { ?>
if ($list[$i]['is_notice'])
echo "<font style='font-family:돋움; font-size:9pt; color:#2C88B9;'><strong>{$list[$i]['subject']}</strong></font>";
<?}?>

<? for ($i=1; $i<count($list); $i++) { ?>
if (!$list[$i]['is_notice'])
echo "<font style='font-family:돋움; font-size:9pt;'>{$list[$i]['subject']}</font>";
<?}?>

응용하세요

---------------------------------------------------

아래 소스에 적용하려고 하는데 어떻게 적용하라고 하는건지 아무리 고민해도 잘 모르겠네요.
꼭 좀 도와주시길 부탁드립니다.
감사합니다. ^^


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

<table border=0 width=100% cellspacing=0 cellpadding=0>
<tr height=25><td align=left valign=bottom colspan=3>&nbsp;&nbsp;<strong><a href='<?=$g4[bbs_path]?>/board.php?bo_table=<?=$bo_table?>'><?=$board[bo_subject]?></a></strong></td></tr>
<tr><td width=78 height=4><img src="<?=$latest_skin_path?>/img/bgl.gif" border=0></td>
<td width=34 height=4><img src="<?=$latest_skin_path?>/img/bgm.gif" border=0></td>
<td width=100%  height=4 background="<?=$latest_skin_path?>/img/bgr.gif"></td></tr>
<? for ($i=0; $i<count($list); $i++) { ?>
<tr><td colspan=3 align=center>

<table width=100%>
<tr><td height=20> <img src='<?=$latest_skin_path?>/img/arrow.gif' align=absmiddle>
            <?
            echo $list[$i]['icon_reply'] . " ";
            echo "<a href='{$list[$i]['href']}'>";
            if ($list[$i]['is_notice'])
                echo "<font style='color:#2C88B9;'><strong>{$list[$i]['subject']}</strong></font>";
            else
                echo "<font style='color:#6A6A6A;'>{$list[$i]['subject']}</font>";
            echo "</a>";

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

            // if ($list[$i]['link']['count']) { echo "[{$list[$i]['link']['count']}]"; }
            // if ($list[$i]['file']['count']) { echo "<{$list[$i]['file']['count']}>"; }

            echo " " . $list[$i]['icon_new'];
            echo " " . $list[$i]['icon_file'];
            echo " " . $list[$i]['icon_link'];
            echo " " . $list[$i]['icon_hot'];
            echo " " . $list[$i]['icon_secret'];
            ?>
           
</td></tr>
<tr><td background="<?=$latest_skin_path?>/img/dot.gif" height=1> </td></tr></table>

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

댓글목록

profile_image

쎄엠님의 댓글

쎄엠쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 작성일

답답하실 것 같아 혹 하고 올려봅니다.
초보이기 때문에 전혀아닐 수도 있습니다만 시도해 보시면 어떨까 하고 용감하게 올려 봅니다.
올리신 부분 가운데 아래의 부분을 찾습니다.
-->
<table width=100%>
<tr><td height=20> <img src='<?=$latest_skin_path?>/img/arrow.gif' align=absmiddle>
            <?
            echo $list[$i]['icon_reply'] . " ";
            echo "<a href='{$list[$i]['href']}'>";
--≫      if ($list[$i]['is_notice'])
                echo "<font style='color:#2C88B9;'><strong>{$list[$i]['subject']}</strong></font>";
            else
--≫      echo "<font style='color:#6A6A6A;'>{$list[$i]['subject']}</font>";
            echo "</a>";

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

중간에 --≫ 로 표시된 부분을 어떤 분이 올리신 팁을 적용해 보면 어떨까요?
아 단순하게 그냥 적용해서는 안 되는 것 같습니다.
응용을 해야 할 것 같은데 말입니다.
고수님들의 손길이 필요할 것 같네요.

Total 38건 2 페이지
  • RSS
질문답변 목록
번호 제목 글쓴이 조회 추천 날짜
13 davi쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 9818 0 01-28
열람중 davi쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 7172 0 01-05
11 davi쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 6289 0 12-23
10 davi쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 7295 0 12-13
9 davi쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 9137 0 12-07
8 davi쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 8715 0 10-22
7 davi쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 6854 0 10-22
6 davi쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 5876 0 10-19
5 davi쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 42 0 10-18
4 davi쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 6116 0 10-17
3 davi쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 11713 0 09-09
2 davi쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 8533 0 09-08
1 davi쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 7764 0 09-04

검색

회원로그인

회원가입

사이트 정보

株式会社YHPLUS / 대표 : ZERO
〒140-0011 東京都品川区東大井2-5-9-203
050-5539-7787
오픈카카오톡 (YHPLUS) :
https://open.kakao.com/o/slfDj15d

접속자집계

오늘
3,368
어제
4,822
최대
7,259
전체
1,331,859
Copyright (c) 株式会社YHPLUS. All rights reserved.