최신글 관련 질문입니다. 정보
최신글 관련 질문입니다.본문
http://www.sir.co.kr/bbs/board.php?bo_table=g4_skin&wr_id=50957&sca=%C3%D6%BD%C5%B1%DB&page=2
불친절한아원 님의 그룹별 최신글 스킨으로 위와 같이 그림과 함께 글을 추출하고 있는데,
저 위에 "새 글이 " xxxx-xx-xx "에 올라왔습니다"를 자동으로 구현화 할 수 있었으면 좋겠습니다.
그룹 이름은 "webtoons" 이고요. 고수 님들의 조언 부탁드립니다. (_ _)
--------------------- main.php -------------------------------
<div id="main">
<div style="float: center; width: 720px;">
<div style="float: left; width: 510px; border: gold 4px solid; padding: 10px;">
<br>
<font size=4><center>새 글이 2008-04-12 에 올라왔습니다!</center></font><br>
<?
$g4_path = ".";
include_once("$g4_path/_common.php");
include_once("$g4[path]/lib/latest.group.lib.php");
// 출력
echo latest_group("red_latest_v30", "webtoons", 4, 55, 0, 14);
?>
</div>
-------------------- 최신글 red_latest 스킨 ------------
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
if (!function_exists("imagecopyresampled")) alert("GD 2.0.1 이상 버전이 설치되어 있어야 사용할 수 있는 스킨 입니다.");
?>
<style type="text/css">
#photo_v30_img, #photo_v30_list{float:left}
#photo_v30_img{width:100px;border:1px solid #CCCCCC;padding:3px;}
#photo_v30_list{width:400px;height:50px;padding:0 0 0 5px;}
.photo_v30_sub{height:6px;}
</style>
<?
for ($i=0; $i<count($list); $i++) {
//썸네일 코드 시작
$thumb_width = "100"; //썸네일 가로
$thumb_height = "100"; //썸네일 세로
$thumb_quality = "100";
$data_path = $g4[path]."/data/file/{$list[$i][bo_table]}";
$thumb_path = $data_path.'/thumb_'.$thumb_width.'_'.$thumb_height;
if (!is_dir($thumb_path)) {
@mkdir($thumb_path, 0707);
@chmod($thumb_path, 0707);
}
$filename = $list[$i][bf_file]; // 파일명
$thumb = $thumb_path.'/'.$filename; //썸네일
if (!file_exists($thumb))
{
$file = $data_path.'/'.$filename; //원본
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
continue;
$rate = $thumb_width / $size[0];
$height = (int)($size[1] * $rate);
if ($height < $thumb_height)
$dst = imagecreatetruecolor($thumb_width, $height);
else
$dst = imagecreatetruecolor($thumb_width, $thumb_height);
imagecopyresampled($dst, $src, 0, 0, 0, 0, $thumb_width, $height, $size[0], $size[1]);
imagejpeg($dst, $thumb_path.'/'.$filename, $thumb_quality);
chmod($thumb_path.'/'.$filename, 0707);
}
}
if (file_exists($thumb) && $filename) {
$img = "<img src='{$thumb}' align='absmiddle' border='0'>";
} else {
$img = "";
}
$href = "{$list[$i][href]}";
$subject = $list[$i][subject];
$wr_content = strip_tags($list[$i][content]);
// 이미지
if ($img) {
// 출력
echo <<<HEREDOC
<div>
<table style="width: 510px; border: Gainsboro 2px dashed; padding: 3px;">
<tr>
<td>
<a href='{$href}' onfocus='this.blur()'>{$img}</a> <a href='{$href}' onfocus='this.blur()'>{$subject}</a>
<td>
</tr>
</table>
<div class=photo_v30_sub></div>
</div>
HEREDOC;
}
}
?>
<? if (count($list) == 0) { ?>
<div style="height:25px;" align="center">게시물이 없습니다.</div>
<? } ?>
----------------------------------------------------------------------
불친절한아원 님의 그룹별 최신글 스킨으로 위와 같이 그림과 함께 글을 추출하고 있는데,
저 위에 "새 글이 " xxxx-xx-xx "에 올라왔습니다"를 자동으로 구현화 할 수 있었으면 좋겠습니다.
그룹 이름은 "webtoons" 이고요. 고수 님들의 조언 부탁드립니다. (_ _)
--------------------- main.php -------------------------------
<div id="main">
<div style="float: center; width: 720px;">
<div style="float: left; width: 510px; border: gold 4px solid; padding: 10px;">
<br>
<font size=4><center>새 글이 2008-04-12 에 올라왔습니다!</center></font><br>
<?
$g4_path = ".";
include_once("$g4_path/_common.php");
include_once("$g4[path]/lib/latest.group.lib.php");
// 출력
echo latest_group("red_latest_v30", "webtoons", 4, 55, 0, 14);
?>
</div>
-------------------- 최신글 red_latest 스킨 ------------
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
if (!function_exists("imagecopyresampled")) alert("GD 2.0.1 이상 버전이 설치되어 있어야 사용할 수 있는 스킨 입니다.");
?>
<style type="text/css">
#photo_v30_img, #photo_v30_list{float:left}
#photo_v30_img{width:100px;border:1px solid #CCCCCC;padding:3px;}
#photo_v30_list{width:400px;height:50px;padding:0 0 0 5px;}
.photo_v30_sub{height:6px;}
</style>
<?
for ($i=0; $i<count($list); $i++) {
//썸네일 코드 시작
$thumb_width = "100"; //썸네일 가로
$thumb_height = "100"; //썸네일 세로
$thumb_quality = "100";
$data_path = $g4[path]."/data/file/{$list[$i][bo_table]}";
$thumb_path = $data_path.'/thumb_'.$thumb_width.'_'.$thumb_height;
if (!is_dir($thumb_path)) {
@mkdir($thumb_path, 0707);
@chmod($thumb_path, 0707);
}
$filename = $list[$i][bf_file]; // 파일명
$thumb = $thumb_path.'/'.$filename; //썸네일
if (!file_exists($thumb))
{
$file = $data_path.'/'.$filename; //원본
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
continue;
$rate = $thumb_width / $size[0];
$height = (int)($size[1] * $rate);
if ($height < $thumb_height)
$dst = imagecreatetruecolor($thumb_width, $height);
else
$dst = imagecreatetruecolor($thumb_width, $thumb_height);
imagecopyresampled($dst, $src, 0, 0, 0, 0, $thumb_width, $height, $size[0], $size[1]);
imagejpeg($dst, $thumb_path.'/'.$filename, $thumb_quality);
chmod($thumb_path.'/'.$filename, 0707);
}
}
if (file_exists($thumb) && $filename) {
$img = "<img src='{$thumb}' align='absmiddle' border='0'>";
} else {
$img = "";
}
$href = "{$list[$i][href]}";
$subject = $list[$i][subject];
$wr_content = strip_tags($list[$i][content]);
// 이미지
if ($img) {
// 출력
echo <<<HEREDOC
<div>
<table style="width: 510px; border: Gainsboro 2px dashed; padding: 3px;">
<tr>
<td>
<a href='{$href}' onfocus='this.blur()'>{$img}</a> <a href='{$href}' onfocus='this.blur()'>{$subject}</a>
<td>
</tr>
</table>
<div class=photo_v30_sub></div>
</div>
HEREDOC;
}
}
?>
<? if (count($list) == 0) { ?>
<div style="height:25px;" align="center">게시물이 없습니다.</div>
<? } ?>
----------------------------------------------------------------------
댓글 전체
그냥 g4_write_테이블 에서 wr_id 가 가장 큰거 하나만 뽑아오시죠..