최신글에서요, 내가 쓴 글만 클릭하는 방법즘요 ㅜㅜ > 그누4 질문답변

그누4 질문답변

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

최신글에서요, 내가 쓴 글만 클릭하는 방법즘요 ㅜㅜ 정보

최신글에서요, 내가 쓴 글만 클릭하는 방법즘요 ㅜㅜ

본문

최신글 출력한 게시판이 페이지에선 자기가 쓴 글만 보이게 해논 상태입니다.!

그치만 최신글에선 남들이 쓴 글도 리스트로 뿌려져야하구요.
뿌려지는것까진 되는데요.

그 글중에 자기가 쓴 글만 열람이 가능하고 남들이 쓴 글 리스트는 안열려야 하거든요..
어떤 코드를 추가해야될까요 ㅜㅜ

답변 꼭 부탁드립니다~~
이해안되시면 댓글 남겨주세요!!


-------------------------  최신글 코드 ---------------------------

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

$latest_width = "460"; //탭메뉴 폭과 같게
?>

<style>
a {text-decoration:none; color: #7b5d51;}
a:link, a:visited, a:active {text-decoration:none; color: #7b5d51;}
a:hover {text-decoration:none; color:#c17018;}
</style>

<div style="height:150px;">
<table width='<?=$latest_width?>' cellpadding='0' cellspacing='0' border='0'>
 <tr>
  <td height='15' colspan='3'></td>
 </tr>

<? for ($i=0; $i<count($list); $i++) { ?>
 <tr>
  <td width='6' height='20' style='padding-left:5px;'><img src='<?=$latest_skin_path?>/img/latest_icon.gif' width='2' height='2' border='0' align="absmiddle"></td>
  <td width='<?=$latest_width-84?>' height='20' align="left">

<?
    $style = "font-family:돋움; font-size:9pt; color:#7b5d51;";
    if ($list[$i][icon_new])
    $style = "style='font-family:돋움; font-size:9pt;' ";
$subject = "<span $style>".cut_str($list[$i][subject],80)."</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-family:Tahoma;font-size:10px;color:#f1782e;'>{$list[$i][comment_cnt]}</span>";

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

  </td>
  <td width='70' height='20' align='center' ><span style='font-size:9pt; color:#7b5d51;'><?=$list[$i][datetime]?></span>
  </td>
 </tr>
<? } ?>

<? if (count($list) == 0) { ?><tr><td colspan=3 align=center height=100 style='font-family:돋움; font-size:9pt; color:#7b5d51;'>게시물이 없습니다.</td></tr><? } ?>

</tr>
</table>
</div>
  • 복사

댓글 전체

echo "<a href='{$list[$i][href]}' title='{$list[$i][subject]}' onfocus='this.blur()'>{$subject}";
 부분을
if($list[$i][mb_id] == $member[mb_id]) {
 echo "<a href='{$list[$i][href]}' title='{$list[$i][subject]}' onfocus='this.blur()'>";
}
echo "{$subject}";

위와 같은 방법으로 바꾸시면 될 듯 합니다.
for 문 다음줄에 넣으세요
if(!$is_admin && $list[$i][mb_id]!=$member[mb_id]) $list[$i][href]="#";

view스킨 상단에 넣으세요
if(!$is_admin && $view[mb_id]!=$member[mb_id]) alert("본인의 글이 아닙니다:);
아 죄송한데 문제가 지금 메인에 최근게시물이 5개 이상이 노출되있는데 그중 한개의 게시판만 자기가 쓴글만 클릭되게끔 해야해서 latest.skin 파일을 수정하면 안될거같아요 ㅜ
© SIRSOFT
현재 페이지 제일 처음으로