다시 최신글 날짜 관련 질문입니다. 정보
다시 최신글 날짜 관련 질문입니다.본문
아래에서 일당천 님께서 "그냥 g4_write_테이블 에서 wr_id 가 가장 큰거 하나만 뽑아오시죠.."라고
설명해주셨는데, 제가 초보인지라 매뉴얼을 들여다 봐도 이해하기 힘드네요. 죄송합니다. (꾸벅)
그래서 다시 한 번 부탁드립니다.
-----------------------------------------------------------------------------------------------------------------
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 "에 올라왔습니다"를 자동으로 구현화 할 수 있었으면 좋겠습니다.
예: 새 글이 2008-4-29에 올라왔습니다.
고수 님들의 조언 부탁드립니다. (_ _)
해당 갤러리의 날짜 출력은
--------------------------- latest.skin.php ---------------------------------------------------------------------
<?
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>
-------------------------- 이부분이 수정필요합니다 (함수 설정이랑 출력이요);;; -----------------------------------
<?
{
$i=0;
$wr_date = $list[$i][$wr_datetime];
document.write("<font size=4><center>새 글이 {$wr_datetime}에 올라왔습니다.</center></font><br>");
}
?>
--------------------------------------------------------------------------------------------------
<div>
<a href="http://www.lulu.com/">
<center>
<img src="/files/TMS_Vol1_nekocover.jpg" width='450' height='340' border='0' alt="">
</a>
<div style="height: 8px;"></div>
<a href="/files/Read.pdf"><font color=blue><u>CLICK HERE to read it</u></font></a><br><br><br>
</center>
</a>
</div>
<?
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;
}
}
?>
설명해주셨는데, 제가 초보인지라 매뉴얼을 들여다 봐도 이해하기 힘드네요. 죄송합니다. (꾸벅)
그래서 다시 한 번 부탁드립니다.
-----------------------------------------------------------------------------------------------------------------
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 "에 올라왔습니다"를 자동으로 구현화 할 수 있었으면 좋겠습니다.
예: 새 글이 2008-4-29에 올라왔습니다.
고수 님들의 조언 부탁드립니다. (_ _)
해당 갤러리의 날짜 출력은
--------------------------- latest.skin.php ---------------------------------------------------------------------
<?
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>
-------------------------- 이부분이 수정필요합니다 (함수 설정이랑 출력이요);;; -----------------------------------
<?
{
$i=0;
$wr_date = $list[$i][$wr_datetime];
document.write("<font size=4><center>새 글이 {$wr_datetime}에 올라왔습니다.</center></font><br>");
}
?>
--------------------------------------------------------------------------------------------------
<div>
<a href="http://www.lulu.com/">
<center>
<img src="/files/TMS_Vol1_nekocover.jpg" width='450' height='340' border='0' alt="">
</a>
<div style="height: 8px;"></div>
<a href="/files/Read.pdf"><font color=blue><u>CLICK HERE to read it</u></font></a><br><br><br>
</center>
</a>
</div>
<?
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;
}
}
?>
댓글 전체
그룹별 최신글 스킨으로 위와 같이 그림과 함께 글을 추출하고 있는데..."
결국은 뽑아 올 테이블의 그룹은 미리 알고 있으니
g4_board_new에서 이 그룹에 해당하는 것 중에서 마지막 것에 날짜를 가져 오면 되겠네요.
결국은 뽑아 올 테이블의 그룹은 미리 알고 있으니
g4_board_new에서 이 그룹에 해당하는 것 중에서 마지막 것에 날짜를 가져 오면 되겠네요.