첨부소스에서 코멘트 나오는 방법좀 알려주세요 정보
첨부소스에서 코멘트 나오는 방법좀 알려주세요본문
안녕하세요! 최근게시물 갤러리를 사용하고 있는데, 제목은 나오는데 코멘트가 안나오네요..
요곳조곳 소스를 비교해가면서 코멘트를 넣어봤는데도 초보는 힘이드네요..
고수님들 이 소스에서 코멘트가 제목옆에 나올 수 있도록 부탁좀 드리겠습니다.
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
$cols = 5; // 이미지 가로갯수 // 이미지 세로 갯수는 메인에서 지정(총 이미지 수)
$imgwidth=90; //표시할 이미지의 가로사이즈
$imgheight=60; //표시할 이미지의 세로사이즈
$image_h = 3; // 이미지 상하 간격
$col_width = (int)(99 / $cols);
$data_path = $g4[path]."/data/file/$bo_table";
$thumb_path = $data_path.'/thumb';
?>
<style type="text/css">
<!--
.data { font-size:8pt; color:#999999; }
-->
</style>
<table width="99%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="1847"></td>
</tr>
<tr>
<td width="99%" border="0">
<table width=100% border=0 cellpadding='0' cellspacing='0' align='center'>
<!-- 최신글 제목 -->
<tr>
<td height="2">
</td></tr>
<tr>
<td align='center'>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<? for ($i=0; $i<count($list); $i++) {
if ($i>0 && $i%$cols==0) { echo "</tr><tr><td colspan='$cols' height='$image_h'></td></tr><tr>"; }
?>
<td width="<?=$col_width?>%" align="center" valign='top' height="13">
<?
$image = $list[$i][file][0][file]; //원본
$img=$data_path. "/".$image; //썸네일이 없을경우 원본출력
$thumb = $thumb_path. "/". $list[$i][wr_id];
if ( file_exists($thumb) )
$img = $thumb;
$style = "font-size:9pt; color:#636363;";
if ($list[$i][icon_new])
$style = "style='font-size:9pt;' ";
$subject = "<span $style>".cut_str($list[$i][subject],12)."</span>"; //제목 글자수 자르기
$bg = ""; //새글?
if ($list[$i][icon_new])
$bg="la_top_2.gif";
else
$bg="la_top_1.gif";
echo $list[$i][icon_reply] . " ";
echo "<table width='100%' cellpadding='0' cellspacing='0' border='0'>";
echo " <tr><td valign='top' align='center'><a href='{$list[$i]['href']}'><img src='$img' width='{$imgwidth}' height='{$imgheight}' align='absmiddle' style='width:{$imgwidth}px;height:{$imgheight}px;border:1px solid #CCCCCC; padding:3px'></a></td></tr>";
echo " <tr><td align='center' height='21'><a href='{$list[$i]['href']}'>{$subject}</a></td></tr></table>";
?>
</td><? } ?>
<?
$cnt = ($i%$cols);
for ($k=$cnt; $k<$cols && $cnt; $k++) {
echo "<td width=$col_width%> </td>";
}
?>
<? if (count($list) == 0) { echo "<td height=80 align=center>게시물이 없습니다.</td>"; } ?>
</tr>
</table>
</tr>
</table>
</tr>
</table>
요곳조곳 소스를 비교해가면서 코멘트를 넣어봤는데도 초보는 힘이드네요..
고수님들 이 소스에서 코멘트가 제목옆에 나올 수 있도록 부탁좀 드리겠습니다.
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
$cols = 5; // 이미지 가로갯수 // 이미지 세로 갯수는 메인에서 지정(총 이미지 수)
$imgwidth=90; //표시할 이미지의 가로사이즈
$imgheight=60; //표시할 이미지의 세로사이즈
$image_h = 3; // 이미지 상하 간격
$col_width = (int)(99 / $cols);
$data_path = $g4[path]."/data/file/$bo_table";
$thumb_path = $data_path.'/thumb';
?>
<style type="text/css">
<!--
.data { font-size:8pt; color:#999999; }
-->
</style>
<table width="99%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="1847"></td>
</tr>
<tr>
<td width="99%" border="0">
<table width=100% border=0 cellpadding='0' cellspacing='0' align='center'>
<!-- 최신글 제목 -->
<tr>
<td height="2">
</td></tr>
<tr>
<td align='center'>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<? for ($i=0; $i<count($list); $i++) {
if ($i>0 && $i%$cols==0) { echo "</tr><tr><td colspan='$cols' height='$image_h'></td></tr><tr>"; }
?>
<td width="<?=$col_width?>%" align="center" valign='top' height="13">
<?
$image = $list[$i][file][0][file]; //원본
$img=$data_path. "/".$image; //썸네일이 없을경우 원본출력
$thumb = $thumb_path. "/". $list[$i][wr_id];
if ( file_exists($thumb) )
$img = $thumb;
$style = "font-size:9pt; color:#636363;";
if ($list[$i][icon_new])
$style = "style='font-size:9pt;' ";
$subject = "<span $style>".cut_str($list[$i][subject],12)."</span>"; //제목 글자수 자르기
$bg = ""; //새글?
if ($list[$i][icon_new])
$bg="la_top_2.gif";
else
$bg="la_top_1.gif";
echo $list[$i][icon_reply] . " ";
echo "<table width='100%' cellpadding='0' cellspacing='0' border='0'>";
echo " <tr><td valign='top' align='center'><a href='{$list[$i]['href']}'><img src='$img' width='{$imgwidth}' height='{$imgheight}' align='absmiddle' style='width:{$imgwidth}px;height:{$imgheight}px;border:1px solid #CCCCCC; padding:3px'></a></td></tr>";
echo " <tr><td align='center' height='21'><a href='{$list[$i]['href']}'>{$subject}</a></td></tr></table>";
?>
</td><? } ?>
<?
$cnt = ($i%$cols);
for ($k=$cnt; $k<$cols && $cnt; $k++) {
echo "<td width=$col_width%> </td>";
}
?>
<? if (count($list) == 0) { echo "<td height=80 align=center>게시물이 없습니다.</td>"; } ?>
</tr>
</table>
</tr>
</table>
</tr>
</table>
댓글 전체
$list[$i][comment_cnt] 를 말씀하시나요?
위에 소스에서 어떻게 하면 코멘트가 나올수있을까요?
$list[$i][comment_cnt] 이걸 어디에다가 붙여야 최근게시물에 제목옆에 코멘트가 나올까요?
$list[$i][comment_cnt] 이걸 어디에다가 붙여야 최근게시물에 제목옆에 코멘트가 나올까요?