최근 게시물 소스 인데 수정 부탁드릴께요! 정보
최근 게시물 소스 인데 수정 부탁드릴께요!본문
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
if (!function_exists("imagecopyresampled")) alert("GD 2.0.1 이상 버전이 설치되어 있어야 사용할 수 있는 스킨 입니다.");
?>
<style type="text/css">
#photo_v30_img, #photo_v30_list, #photo_v30_list2{float:left}
#photo_v30_img{width:100px;border:1px solid #CCCCCC;padding:0px;}
#photo_v30_list{width:100%px;height:80px;padding:0 0 0 5px;}
#photo_v30_list2{width:100%px;height:70px;padding:0 0 0 0px;}
.photo_v30_sub{height:18px;}
body, td, p, input, button, textarea, select, .c1 { font-family:Tahoma,굴림; font-size:9pt; color:#222222; line-height:130% }
</style>
<?
for ($i=0; $i<count($list); $i++) {
//썸네일 코드 시작
$thumb_width = "100"; //썸네일 가로
$thumb_height = "60"; //썸네일 세로
$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 = strip_tags($list[$i][subject]);
$wr_content = strip_tags($list[$i][content]);
// 이미지
if ($img) {
// 출력
echo <<<HEREDOC
<div>
<div id="photo_v30_img"><a href='{$href}' onfocus='this.blur()'>{$img}</a></div>
<div id="photo_v30_list">
<div class="photo_v30_sub"><a href='{$href}'><span class='newscontent'>{$subject}</span></a></div>
<div><a href='{$href}'><font color='#333333'><span class='newscontent1'>{$wr_content}</span></font></a></div>
</div>
</div>
HEREDOC;
} else {
// 출력
echo <<<HEREDOC
<div>
<div id="photo_v30_list2">
<div class="photo_v30_sub"><a href='{$href}'><span class='newscontent'>{$subject}</span></a></div>
<div><a href='{$href}'><font color='#333333'><span class='newscontent1'>{$wr_content}</span></font></a></div>
</div>
</div>
HEREDOC;
}
}
?>
<? if (count($list) == 0) { ?>
<div style="height:25px;" align="center">게시물이 없습니다.</div>
<? } ?>
글쓴이의 이름과 날짜 해당 게시판의 이름 그리고 카테고리명 까지 같이 뜨게 하고 싶습니다 ^^
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
if (!function_exists("imagecopyresampled")) alert("GD 2.0.1 이상 버전이 설치되어 있어야 사용할 수 있는 스킨 입니다.");
?>
<style type="text/css">
#photo_v30_img, #photo_v30_list, #photo_v30_list2{float:left}
#photo_v30_img{width:100px;border:1px solid #CCCCCC;padding:0px;}
#photo_v30_list{width:100%px;height:80px;padding:0 0 0 5px;}
#photo_v30_list2{width:100%px;height:70px;padding:0 0 0 0px;}
.photo_v30_sub{height:18px;}
body, td, p, input, button, textarea, select, .c1 { font-family:Tahoma,굴림; font-size:9pt; color:#222222; line-height:130% }
</style>
<?
for ($i=0; $i<count($list); $i++) {
//썸네일 코드 시작
$thumb_width = "100"; //썸네일 가로
$thumb_height = "60"; //썸네일 세로
$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 = strip_tags($list[$i][subject]);
$wr_content = strip_tags($list[$i][content]);
// 이미지
if ($img) {
// 출력
echo <<<HEREDOC
<div>
<div id="photo_v30_img"><a href='{$href}' onfocus='this.blur()'>{$img}</a></div>
<div id="photo_v30_list">
<div class="photo_v30_sub"><a href='{$href}'><span class='newscontent'>{$subject}</span></a></div>
<div><a href='{$href}'><font color='#333333'><span class='newscontent1'>{$wr_content}</span></font></a></div>
</div>
</div>
HEREDOC;
} else {
// 출력
echo <<<HEREDOC
<div>
<div id="photo_v30_list2">
<div class="photo_v30_sub"><a href='{$href}'><span class='newscontent'>{$subject}</span></a></div>
<div><a href='{$href}'><font color='#333333'><span class='newscontent1'>{$wr_content}</span></font></a></div>
</div>
</div>
HEREDOC;
}
}
?>
<? if (count($list) == 0) { ?>
<div style="height:25px;" align="center">게시물이 없습니다.</div>
<? } ?>
글쓴이의 이름과 날짜 해당 게시판의 이름 그리고 카테고리명 까지 같이 뜨게 하고 싶습니다 ^^
댓글 전체

<div id="photo_v30_list2">
<div class="photo_v30_sub"><a href='{$href}'><span class='newscontent'>{$subject}</span></a></div>
<div><a href='{$href}'><font color='#333333'><span class='newscontent1'>{$wr_content}</span></font></a></div>
이부분이 제목이랑, 내용 출력부분이네요.
<div class="photo_v30_sub"><a href='{$href}'><span class='newscontent'>{$subject}</span></a></div>
<div><a href='{$href}'><font color='#333333'><span class='newscontent1'>{$wr_content}</span></font></a></div>
이부분이 제목이랑, 내용 출력부분이네요.

좀만 올라가보시면,
$subject = strip_tags($list[$i][subject]);
$wr_content = strip_tags($list[$i][content]);
소스가있는데, 그밑에 붙여넣으세요
$date=date("Y-m-d",strtotime($list[$i][wr_datetime]));
$botable=$board[bo_table];
//카테고리는 잘모르겠네요.
$subject = strip_tags($list[$i][subject]);
$wr_content = strip_tags($list[$i][content]);
소스가있는데, 그밑에 붙여넣으세요
$date=date("Y-m-d",strtotime($list[$i][wr_datetime]));
$botable=$board[bo_table];
//카테고리는 잘모르겠네요.

<div id="photo_v30_list2">
<div class="photo_v30_sub"><a href='{$href}'><span class='newscontent'>{$subject}</span></a></div>
<div><a href='{$href}'><font color='#333333'><span class='newscontent1'>{$wr_content}</span></font></a></div>
다시 이부분에서, 밑에 다가..
<div><a href='{$href}'><font color='#333333'><span class='newscontent1'>{$date}</span></font></a></div>
<div><a href='{$href}'><font color='#333333'><span class='newscontent1'>{$botable}</span></font></a></div>
이런식으로 수정해주면 되겠죠. 카테고리도 이런식으로 넣어주면 될거에요.
<div class="photo_v30_sub"><a href='{$href}'><span class='newscontent'>{$subject}</span></a></div>
<div><a href='{$href}'><font color='#333333'><span class='newscontent1'>{$wr_content}</span></font></a></div>
다시 이부분에서, 밑에 다가..
<div><a href='{$href}'><font color='#333333'><span class='newscontent1'>{$date}</span></font></a></div>
<div><a href='{$href}'><font color='#333333'><span class='newscontent1'>{$botable}</span></font></a></div>
이런식으로 수정해주면 되겠죠. 카테고리도 이런식으로 넣어주면 될거에요.
날짜는 되는데 게시판 이름은 안되네요 날짜로 만족 합니다 ^^ 혹시 작성자도 알수 있을까요? ^

작성자는 wr_name으로 $name=strip_tags($list[$i][wr_name]);
하고, {$name}이러시면 될거 같구요.
게시판이름은..... $list 테이블에서 저도 찾아봐야겠네요. ㅎㅎㅎ
저도 초보라.
하고, {$name}이러시면 될거 같구요.
게시판이름은..... $list 테이블에서 저도 찾아봐야겠네요. ㅎㅎㅎ
저도 초보라.