최신글 정보
최신글관련링크
http://googoojapan.com/
244회 연결
본문
if문 좀 물어봅시다
<? for ($i=0; $i<count($list); $i++) { ?>
<li class="list"><a href="<?=$list[$i]['href']?>" class="text3">· <?=$list[$i]['subject']?> <span style='font-size:8pt; color:#FF7575;'>(<?=$list[$i]['wr_comment']?>)</span></a></li>
<? } ?>
지금은 코멘트가 없으면 0으로 나타나는데 어떻게 if문을 넣으면 있을때만 나타나게 하지요?
<? for ($i=0; $i<count($list); $i++) { ?>
<li class="list"><a href="<?=$list[$i]['href']?>" class="text3">· <?=$list[$i]['subject']?> <span style='font-size:8pt; color:#FF7575;'>(<?=$list[$i]['wr_comment']?>)</span></a></li>
<? } ?>
지금은 코멘트가 없으면 0으로 나타나는데 어떻게 if문을 넣으면 있을때만 나타나게 하지요?
댓글 전체
<? for ($i=0; $i<count($list); $i++) { ?>
<? if ($list[$i]['wr_comment']) { ?>
<li class="list"><a href="<?=$list[$i]['href']?>" class="text3">· <?=$list[$i]['subject']?> <span style='font-size:8pt; color:#FF7575;'>(<?=$list[$i]['wr_comment']?>)</span></a></li>
<? } ?>
<? } ?>
이렇게 하면 되려나..ㅜ
<? if ($list[$i]['wr_comment']) { ?>
<li class="list"><a href="<?=$list[$i]['href']?>" class="text3">· <?=$list[$i]['subject']?> <span style='font-size:8pt; color:#FF7575;'>(<?=$list[$i]['wr_comment']?>)</span></a></li>
<? } ?>
<? } ?>
이렇게 하면 되려나..ㅜ
알려주신대로 하면 코멘트만있는 최신글이 출력되네요
$list[$i]['comment_cnt'] 로 넣어보세요
common.lib.php 290번째 즈음에...
$list['comment_cnt'] = "";
if ($list['wr_comment'])
$list['comment_cnt'] = "($list[wr_comment])";
를
$list['comment_cnt'] = "";
if ($list['wr_comment'] > 0)
$list['comment_cnt'] = "($list[wr_comment])";
로 하시면 더 확실할 듯 합니다.
common.lib.php 290번째 즈음에...
$list['comment_cnt'] = "";
if ($list['wr_comment'])
$list['comment_cnt'] = "($list[wr_comment])";
를
$list['comment_cnt'] = "";
if ($list['wr_comment'] > 0)
$list['comment_cnt'] = "($list[wr_comment])";
로 하시면 더 확실할 듯 합니다.
코멘트가 없으면 ()로 출력되네요 ()까지 없있수 없을가요?
()를 빼면 되죠;;