최근게시물갤러리 제목옆에 코멘트추출하는 방법좀 알려주세요
안녕하세요! 최근게시물 갤러리를 사용하고 있는데, 제목은 나오는데 코멘트가 안나오네요..
요곳조곳 소스를 비교해가면서 코멘트를 넣어봤는데도 초보는 힘이드네요..
고수님들 이 소스에서 코멘트가 제목옆에 나올 수 있도록 부탁좀 드리겠습니다.
<?
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>
댓글 1개
15년 전
<?
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 " <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%> </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] . " ";
if ($list[$i][comment_cnt]) // 코멘트 불러오기
echo " <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%> </td>";
}
?>
<? if (count($list) == 0) { echo "<td height=80 align=center>게시물이 없습니다.</td>"; } ?>
</tr>
</table>
</tr>
</table>
</tr>
</table>
이렇게 하면되지 않을까요?
게시판 목록
그누4 질문답변
그누보드4 관련 질문은 QA 로 이전됩니다. QA 그누보드4 바로가기
기존 게시물은 열람만 가능합니다.
기존 게시물은 열람만 가능합니다.
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 66474 | 11년 전 | 3617 | ||
| 66473 | 11년 전 | 2669 | ||
| 66472 | 11년 전 | 4860 | ||
| 66471 |
hoonii
|
11년 전 | 4435 | |
| 66470 | 11년 전 | 2249 | ||
| 66469 | 11년 전 | 3104 | ||
| 66468 |
100볼트
|
11년 전 | 3096 | |
| 66467 |
몬스터박스
|
11년 전 | 2112 | |
| 66466 |
몬스터박스
|
11년 전 | 2657 | |
| 66465 |
lsj9894
|
11년 전 | 2438 | |
| 66464 |
테크노관리자
|
11년 전 | 2847 | |
| 66463 | 11년 전 | 2875 | ||
| 66462 |
커네드커네드
|
11년 전 | 3227 | |
| 66461 | 11년 전 | 2641 | ||
| 66460 | 11년 전 | 3309 | ||
| 66459 |
narasarang
|
11년 전 | 2603 | |
| 66458 |
AnnieK
|
11년 전 | 3366 | |
| 66457 | 11년 전 | 3232 | ||
| 66456 | 11년 전 | 2084 | ||
| 66455 | 11년 전 | 3257 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기