테스트 사이트 - 개발 중인 베타 버전입니다

최근게시물갤러리 제목옆에 코멘트추출하는 방법좀 알려주세요

· 15년 전 · 1048 · 1
안녕하세요! 최근게시물 갤러리를 사용하고 있는데, 제목은 나오는데 코멘트가 안나오네요..
요곳조곳 소스를 비교해가면서 코멘트를 넣어봤는데도 초보는 힘이드네요..

고수님들 이 소스에서 코멘트가 제목옆에 나올 수 있도록 부탁좀 드리겠습니다.

<?
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%>&nbsp;</td>";
}
?>
<? if (count($list) == 0) { echo "<td height=80 align=center>게시물이 없습니다.</td>"; } ?>

</tr>
</table>
</tr>
</table>

</tr>
</table>

댓글 작성

댓글을 작성하시려면 로그인이 필요합니다.

로그인하기

댓글 1개

<?
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] . " ";



if ($list[$i][comment_cnt]) // 코멘트 불러오기
echo "&nbsp;<span style='font-family:굴림; font-size:8pt; color:#FF6633;'>{$list[$i][comment_cnt]}</span>";


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%>&nbsp;</td>";
}
?>
<? if (count($list) == 0) { echo "<td height=80 align=center>게시물이 없습니다.</td>"; } ?>

</tr>
</table>
</tr>
</table>

</tr>
</table>

이렇게 하면되지 않을까요?

게시글 목록

번호 제목
284438
284437
284435
284430
284420
284417
284409
284401
284399
284397
284380
284378
284371
284370
284366
284364
284360
284357
284355
284354