요

최신글을 자기글만 보이게 하려면 어떻게 해야 되나요???

· 2008-09-22 (월) 20:08:16 · 820 · 2
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
?>

<table width=100% cellpadding=0 cellspacing=0>
<!--<tr>
<td width=14><img src='<?=$latest_skin_path?>/img/latest_t01.gif'></td>
<td width='100%' background='<?=$latest_skin_path?>/img/bg_latest.gif'>  <strong><a href='<?=$g4[bbs_path]?>/board.php?bo_table=<?=$bo_table?>'><?=$board[bo_subject]?></a></strong></td>
<td width=37 background='<?=$latest_skin_path?>/img/bg_latest.gif'><a href='<?=$g4[bbs_path]?>/board.php?bo_table=<?=$bo_table?>'><img src='<?=$latest_skin_path?>/img/more.gif' border=0></a></td>
<td width=14><img src='<?=$latest_skin_path?>/img/latest_t02.gif'></td>
</tr>-->

<? for ($i=0; $i<count($list); $i++) { ?>
<tr>
<td colspan=4 align=center>
<table width=95%>
<tr>
<td height=25><img src='<?=$latest_skin_path?>/img/latest_icon.gif' align=absmiddle>  
<?
echo $list[$i]['icon_reply'] . " ";
echo "<a href='{$list[$i]['href']}'>";
if ($list[$i]['is_notice'])
echo "<font style='font-family:돋움; font-size:9pt; color:#2C88B9;'><strong>{$list[$i]['subject']}</strong></font>";
else
echo "<font style='font-family:돋움; font-size:9pt; 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 bgcolor=#EBEBEB height=1></td></tr>
</table></td>
</tr>
<? } ?>

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

</table>


최신글 latest.skin.php 파일입니다. ^^;;

댓글 2개

mb_id값을 이용해서 하면 될 것 같네요.

먼저 로그인하지 않으면 최신 글이 보이지 않게 하는 코드를 입력하셔야 되구요... 예를 들면
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
다음에 if($member['mb_id'])) {; 이란 코드를 넣으면 되겠죠. 그리고 for 구문을 다음처럼 수정하면 될 것 같네요.


$cnt_list = 0;
<? for ($i=0; $i<count($list); $i++) { ?>
if ($list['mb_id'] == $member['mb_id']) {
$cnt_list++;
}
else {
continue;
}

그리고 쭉 내려서 <? if(count($list) == 0) 을 <? if ($cnt_list == 0)으로 수정하면 됩니다.

그리고 맨 마지막에 위에서 if 구문을 넣었으니까 처리해야겠죠.
<? } else { echo "최근게시물을 보려면 로그인을 해야 합니다!!!"; } ?>
댓글을 작성하시려면 로그인이 필요합니다.

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

+
제목 글쓴이 날짜 조회
08-09-23 조회 1,008
08-09-23 조회 1,619
08-09-23 조회 911
08-09-23 조회 797
08-09-23 조회 1,628
08-09-23 조회 819
08-09-23 조회 837
08-09-23 조회 863
08-09-23 조회 1,069
08-09-23 조회 858
08-09-23 조회 810
08-09-22 조회 814
08-09-22 조회 3,430
08-09-22 조회 812
08-09-22 조회 1,246
08-09-22 조회 821
08-09-22 조회 1,079
08-09-22 조회 847
08-09-22 조회 1,053
08-09-22 조회 1,663