new.php 질문입니다...
bbs/new.php 에 관련해서입니다.
skin/new/new.skin.php 에서
댓글을 표시할때 <font color="#ff6600">{$list[$i][wr_comment]}</font> 이런식으로 하여 최신글 제목 뒤에 댓글 수가 표시 하도록 했습니다.
근데, 이게 댓글이 없는 즉, 0개일때도 표시가 되더군요!
안녕하세요 가입인사 합니다 0
반갑습니다 0
처음 뵙겠습니다. 7
이런식으로 0일때는 표시를 안하고 싶은데, 어떤 방식으로 해야 하나요~?
용좌님께서 답변을 주셨는데~
<? if($list[$i][wr_comment] == '0'){ } else echo '{$list[$i][wr_comment]}' ?>
<? if($list[$i][wr_comment] == '0'){ } else{echo "$list[$i][wr_comment";} ?>
위처럼 해봐도 안되더라구요~
두번째 질문
현재 보면 최신글은 제목이 표시가 되고, 최근 댓글은 [코]글제목이 나옵니다
이게 코 없이, 댓글이 보이도록 할수 없는지요~
지금은 댓글이 달려도 [코]게시물제목 이런식으로 표시가 되거든요!
skin/new/new.skin.php 에서
댓글을 표시할때 <font color="#ff6600">{$list[$i][wr_comment]}</font> 이런식으로 하여 최신글 제목 뒤에 댓글 수가 표시 하도록 했습니다.
근데, 이게 댓글이 없는 즉, 0개일때도 표시가 되더군요!
안녕하세요 가입인사 합니다 0
반갑습니다 0
처음 뵙겠습니다. 7
이런식으로 0일때는 표시를 안하고 싶은데, 어떤 방식으로 해야 하나요~?
용좌님께서 답변을 주셨는데~
<? if($list[$i][wr_comment] == '0'){ } else echo '{$list[$i][wr_comment]}' ?>
<? if($list[$i][wr_comment] == '0'){ } else{echo "$list[$i][wr_comment";} ?>
위처럼 해봐도 안되더라구요~
두번째 질문
현재 보면 최신글은 제목이 표시가 되고, 최근 댓글은 [코]글제목이 나옵니다
이게 코 없이, 댓글이 보이도록 할수 없는지요~
지금은 댓글이 달려도 [코]게시물제목 이런식으로 표시가 되거든요!
|
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기
댓글 6개
<tr>
<td align="center" height="30" colspan=3><a href='./new.php?gr_id={$list[$i][gr_id]}'>{$gr_subject}</a></td>
<td align="center" colspan=2><a href='./board.php?bo_table={$list[$i][bo_table]}'>{$bo_subject}</a></td>
<td width=""> <a href='{$list[$i][href]}'>{$list[$i][comment]}{$wr_subject}</a></td>
<td align="center">{$list[$i][name]}</td>
<td align="center" colspan=2>{$list[$i][datetime2]}</td>
<!-- <a href="javascript:;" onclick="document.getElementById('mb_id').value='{$list[$i][mb_id]}';">·</a> -->
</tr>
<tr>
<td colspan="9" height="1" background="{$new_skin_path}/img/dot_bg.gif"></td>
</tr>
HEREDOC;
이부분의 내용이죠?
$view_cmt = $list[$i][comment] ? $list[$i][comment] : ""; // 추가
echo <<<HEREDOC
<tr>
<td align="center" height="30" colspan=3><a href='./new.php?gr_id={$list[$i][gr_id]}'>{$gr_subject}</a></td>
<td align="center" colspan=2><a href='./board.php?bo_table={$list[$i][bo_table]}'>{$bo_subject}</a></td>
<td width=""> <a href='{$list[$i][href]}'>{$view_cmt}<!-- $list[$i][comment] 를 $view_cmt 로 -->{$wr_subject}</a></td>
<td align="center">{$list[$i][name]}</td>
<td align="center" colspan=2>{$list[$i][datetime2]}</td>
<!-- <a href="javascript:;" onclick="document.getElementById('mb_id').value='{$list[$i][mb_id]}';">·</a> -->
</tr>
<tr>
<td colspan="9" height="1" background="{$new_skin_path}/img/dot_bg.gif"></td>
</tr>
HEREDOC;
이런식으로 해보세요..
echo <<<HEREDOC 라인 윗 부분에
$wr_subject = str_replace("[코]", "", $wr_subject);
를 추가해 보세요..
echo <<<HEREDOC 라인 윗 부분에
$list[$i][comment] = "";
$list[$i][wr_comment] = $list[$i][wr_comment] ? "(".$list[$i][wr_comment].")": "";
이 두줄 추가 하시면 될거에요..
혼란을 드려 죄송합니다..
잘 해결했습니다.