최근게시물에 wr_1(여분필드)를 제목아래칸에 넣는방좀을 알고싶어요.... 정보
최근게시물에 wr_1(여분필드)를 제목아래칸에 넣는방좀을 알고싶어요....본문
홈페이지주소 pcink.co.kr 입니다.
게시판을 수정하여 wr_1로 값을 받는것 까지 다했구요...list,write,view 에 출력까지는 다했습니다.
최근게시물에 그림처럼 넣는것도 해보고 싶은데요...알려주시면 잘 배우겠습니다.
그림참조하시고 최근게시물 소스첨부합니다.
---소스----
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
// 썸네일 생성 갤러리 전용 최신글
// 이미지 가로 및 세로 정렬 기능
// 최신글에 불러들일 썸네일의 사이즈를 변경하려면 (처음 설치시는 해당없음)
// 우선 썸네일폭을 아래에서 지정하고
// data/file/테이블명/latest_thumb/파일 전체삭제 후 실행합니다.
$table_latest_width = 680; // 최신글 테이블폭
$cols = 8; // 이미지 가로갯수 = 이미지 세로 갯수는 메인(index.php)에서 지정(총 이미지 수)
$image_h = 10; // 이미지 상하 간격
$thum_width = "70"; //목록에서 보여질 썸네일 폭 (픽셀)
$image_quality = "100"; //목록에서 보여질 이미지의 압축률 (100 이하)
$data_path = $g4[path]."/data/file/$bo_table";
$thumb_path = $data_path.'/latest_thumb'; // 썸네일 생성 폴더명
@mkdir($thumb_path, 0707);
@chmod($thumb_path, 0707);
?>
<table width="<?=$table_latest_width?>" border="0" cellspacing="0" cellpadding="0" style='border:1 solid #DDDDDD;'>
<tr>
<td>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr><td height="1" colspan=2 bgcolor=#DDDDDD></td></tr>
<tr bgcolor=#F9F9F9 style=cursor:hand; onclick=location.href="<?=$g4[bbs_path]?>/board.php?bo_table=<?=$bo_table?>" onmouseover="this.style.backgroundColor='#FBFBFF';return true;" onMouseOut="this.style.backgroundColor='';return true;">
<td height="25" style='padding-top:3px;padding-left:20px;'><font style='font-family:굴림; font-size:9pt; color:#0A618D;'> <strong><?=$board[bo_subject]?></strong></font></td>
<td align="right" style='padding-top:3px;padding-right:20px;'><font style='font-family:돋움; font-size:8pt; color:#999999;'>more</font></td>
</tr>
<tr><td height="1" colspan=2 bgcolor=#E7E7E7></td></tr>
</table></td>
</tr>
<tr><td height="15" ></td></tr>
<tr>
<td>
<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 align="center" valign='top' style='padding-left:3px;'>
<?
$img = "이미지 없음";
$thumb = $thumb_path.'/'.$list[$i][wr_id];
if (!file_exists($thumb))
{
$file = $list[$i][file][0][path] .'/'. $list[$i][file][0][file];
if (preg_match("/\.(jp[e]?g|gif|png)$/i", $file) && file_exists($file))
{
$size = getimagesize($file);
if ($size[2] == 1)
$src = imagecreatefromgif($file);
else if ($size[2] == 2)
$src = imagecreatefromjpeg($file);
else if ($size[2] == 3)
$src = imagecreatefrompng($file);
else
break;
$rate = $thum_width / $size[0];
$height = (int)($size[1] * $rate);
$dst = imagecreatetruecolor($thum_width, $height);
imagecopyresampled($dst, $src, 0, 0, 0, 0, $thum_width, $height, $size[0], $size[1]);
imagepng($dst, $thumb_path.'/'.$list[$i][wr_id], $image_quality);
chmod($thumb_path.'/'.$list[$i][wr_id], 0606);
}
}
if (file_exists($thumb))
$img = "<img src='$thumb' alt='{$list[$i][subject]}' border='0' style='border:1 solid #C6C6C6;'>";
// $img = "<img src='$thumb' alt='{$list[$i][subject]}' width='90' height='60' border='0' style='border:1 solid #C6C6C6;'>"; // 썸네일 가로 세로 고정시 사용
echo $list[$i][icon_reply] . " ";
echo "<table cellpadding=0 cellspacing=0 border=0><tr>";
echo "<td><a href='{$list[$i][href]}' target='_self'>$img</a></td>";
echo "<td width=2 bgcolor=#DDDDDD style='border-top:3px solid #FFFFFF'><img width=2 height=1></td></tr>";
echo "<tr><td colspan=2 height=2 bgcolor=#DDDDDD style='border-left:3px solid #FFFFFF'><img width=1 height=2></td></tr>";
echo "<tr><td colspan=2 height=2><img width=1 height=2></td></tr></table>";
echo "<span style='cursor:default;'><font color='#BCCFCD'>▒</font> <font style=color:#393939;'>{$list[$i][subject]}</font> <font color='#BCCFCD'>▒</font></span> ";
echo " " . $list[$i][icon_new];
?>
</td>
<? } ?>
<?
$cnt = ($i%$cols);
for ($k=$cnt; $k<$cols && $cnt; $k++) {
echo "<td></td>";
}
?>
<? if (count($list) == 0) { echo "<td height=80 align=center>게시물이 없습니다.</td>"; } ?>
</tr>
</table></td>
</tr>
<tr><td height="5"></td></tr>
</table>
---소스끝
게시판을 수정하여 wr_1로 값을 받는것 까지 다했구요...list,write,view 에 출력까지는 다했습니다.
최근게시물에 그림처럼 넣는것도 해보고 싶은데요...알려주시면 잘 배우겠습니다.
그림참조하시고 최근게시물 소스첨부합니다.
---소스----
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
// 썸네일 생성 갤러리 전용 최신글
// 이미지 가로 및 세로 정렬 기능
// 최신글에 불러들일 썸네일의 사이즈를 변경하려면 (처음 설치시는 해당없음)
// 우선 썸네일폭을 아래에서 지정하고
// data/file/테이블명/latest_thumb/파일 전체삭제 후 실행합니다.
$table_latest_width = 680; // 최신글 테이블폭
$cols = 8; // 이미지 가로갯수 = 이미지 세로 갯수는 메인(index.php)에서 지정(총 이미지 수)
$image_h = 10; // 이미지 상하 간격
$thum_width = "70"; //목록에서 보여질 썸네일 폭 (픽셀)
$image_quality = "100"; //목록에서 보여질 이미지의 압축률 (100 이하)
$data_path = $g4[path]."/data/file/$bo_table";
$thumb_path = $data_path.'/latest_thumb'; // 썸네일 생성 폴더명
@mkdir($thumb_path, 0707);
@chmod($thumb_path, 0707);
?>
<table width="<?=$table_latest_width?>" border="0" cellspacing="0" cellpadding="0" style='border:1 solid #DDDDDD;'>
<tr>
<td>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr><td height="1" colspan=2 bgcolor=#DDDDDD></td></tr>
<tr bgcolor=#F9F9F9 style=cursor:hand; onclick=location.href="<?=$g4[bbs_path]?>/board.php?bo_table=<?=$bo_table?>" onmouseover="this.style.backgroundColor='#FBFBFF';return true;" onMouseOut="this.style.backgroundColor='';return true;">
<td height="25" style='padding-top:3px;padding-left:20px;'><font style='font-family:굴림; font-size:9pt; color:#0A618D;'> <strong><?=$board[bo_subject]?></strong></font></td>
<td align="right" style='padding-top:3px;padding-right:20px;'><font style='font-family:돋움; font-size:8pt; color:#999999;'>more</font></td>
</tr>
<tr><td height="1" colspan=2 bgcolor=#E7E7E7></td></tr>
</table></td>
</tr>
<tr><td height="15" ></td></tr>
<tr>
<td>
<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 align="center" valign='top' style='padding-left:3px;'>
<?
$img = "이미지 없음";
$thumb = $thumb_path.'/'.$list[$i][wr_id];
if (!file_exists($thumb))
{
$file = $list[$i][file][0][path] .'/'. $list[$i][file][0][file];
if (preg_match("/\.(jp[e]?g|gif|png)$/i", $file) && file_exists($file))
{
$size = getimagesize($file);
if ($size[2] == 1)
$src = imagecreatefromgif($file);
else if ($size[2] == 2)
$src = imagecreatefromjpeg($file);
else if ($size[2] == 3)
$src = imagecreatefrompng($file);
else
break;
$rate = $thum_width / $size[0];
$height = (int)($size[1] * $rate);
$dst = imagecreatetruecolor($thum_width, $height);
imagecopyresampled($dst, $src, 0, 0, 0, 0, $thum_width, $height, $size[0], $size[1]);
imagepng($dst, $thumb_path.'/'.$list[$i][wr_id], $image_quality);
chmod($thumb_path.'/'.$list[$i][wr_id], 0606);
}
}
if (file_exists($thumb))
$img = "<img src='$thumb' alt='{$list[$i][subject]}' border='0' style='border:1 solid #C6C6C6;'>";
// $img = "<img src='$thumb' alt='{$list[$i][subject]}' width='90' height='60' border='0' style='border:1 solid #C6C6C6;'>"; // 썸네일 가로 세로 고정시 사용
echo $list[$i][icon_reply] . " ";
echo "<table cellpadding=0 cellspacing=0 border=0><tr>";
echo "<td><a href='{$list[$i][href]}' target='_self'>$img</a></td>";
echo "<td width=2 bgcolor=#DDDDDD style='border-top:3px solid #FFFFFF'><img width=2 height=1></td></tr>";
echo "<tr><td colspan=2 height=2 bgcolor=#DDDDDD style='border-left:3px solid #FFFFFF'><img width=1 height=2></td></tr>";
echo "<tr><td colspan=2 height=2><img width=1 height=2></td></tr></table>";
echo "<span style='cursor:default;'><font color='#BCCFCD'>▒</font> <font style=color:#393939;'>{$list[$i][subject]}</font> <font color='#BCCFCD'>▒</font></span> ";
echo " " . $list[$i][icon_new];
?>
</td>
<? } ?>
<?
$cnt = ($i%$cols);
for ($k=$cnt; $k<$cols && $cnt; $k++) {
echo "<td></td>";
}
?>
<? if (count($list) == 0) { echo "<td height=80 align=center>게시물이 없습니다.</td>"; } ?>
</tr>
</table></td>
</tr>
<tr><td height="5"></td></tr>
</table>
---소스끝
댓글 전체
루트님 알려주신건 알것같은데요...제목 바로 아래 출력할려면 어디에 넣어야 하나요...
알려주시면 감사하겠습니다.
알려주시면 감사하겠습니다.
echo "<tr><td colspan=2 height=2><img width=1 height=2></td></tr></table>";
echo "<span style='cursor:default;'><font color='#BCCFCD'>▒</font> <font style=color:#393939;'>{$list[$i][subject]}</font> <font color='#BCCFCD'>▒</font></span> ";
echo " " . $list[$i][icon_new];
echo "<br> <?=number_format($list[$i][wr_1])?> 원"; // <=========추가
?>
</td>
<? } ?>
echo "<span style='cursor:default;'><font color='#BCCFCD'>▒</font> <font style=color:#393939;'>{$list[$i][subject]}</font> <font color='#BCCFCD'>▒</font></span> ";
echo " " . $list[$i][icon_new];
echo "<br> <?=number_format($list[$i][wr_1])?> 원"; // <=========추가
?>
</td>
<? } ?>
echo "<tr><td colspan=2 height=2><img width=1 height=2></td></tr></table>";
echo "<span style='cursor:default;'><font color='#BCCFCD'>▒</font> <font style=color:#393939;'>{$list[$i][subject]}</font> <font color='#BCCFCD'>▒</font></span> ";
echo " " . $list[$i][icon_new];
?>
<?=number_format($list[$i][wr_1])?>원 ------------> 이렇게하니깐 되구요. 가르쳐드린데로 하니깐 에러나구요... 이유가 뭘가요.... 아무튼 되긴되서 너무 기뻐요... ★감사드려요...★
</td>
<? } ?>
echo "<span style='cursor:default;'><font color='#BCCFCD'>▒</font> <font style=color:#393939;'>{$list[$i][subject]}</font> <font color='#BCCFCD'>▒</font></span> ";
echo " " . $list[$i][icon_new];
?>
<?=number_format($list[$i][wr_1])?>원 ------------> 이렇게하니깐 되구요. 가르쳐드린데로 하니깐 에러나구요... 이유가 뭘가요.... 아무튼 되긴되서 너무 기뻐요... ★감사드려요...★
</td>
<? } ?>
헐 잘못알려드렸었군요.
수정하신것이 맞습니다 ^^
수정하신것이 맞습니다 ^^
히히~ 루트님 너무 감사드리며, 다음질문 준비중인데...
최근게시물 아래 나오게...