그룹 최신글을 불러 오고 싶은데요... 어떻게 수정하면 될까요? 정보
그룹 최신글을 불러 오고 싶은데요... 어떻게 수정하면 될까요?
관련링크
본문
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
$img_width = '700'; //썸네일 가로길이
$img_height = '525'; //썸네일 세로길이
$img_quality = '99'; //퀼리티 100이하로 설정
if (!function_exists("imagecopyresampled")) alert("GD 2.0.1 이상 버전이 설치되어 있어야 사용할 수 있는 갤러리 게시판 입니다.");
$data_path = $g4[path]."/data/file/$bo_table";
$thumb_path = $data_path.'/thumb_plka'; //썸네일 이미지 생성 디렉토리
@mkdir($thumb_path, 0707);
@chmod($thumb_path, 0707);
?>
<link rel="stylesheet" href="<?php echo $latest_skin_path?>/css/pika.css" type="text/css">
<script type="text/javascript" src="<?php echo $latest_skin_path?>/js/jquery.pikachoose.4.js"></script>
<script type="text/javascript" src="<?php echo $latest_skin_path?>/js/jquery.jcarousel.min.js"></script>
<script language="javascript">
<!--
$(document).ready(
function (){
$("#pikame").PikaChoose();
$("#pikame").jcarousel({scroll:4,
initCallback: function(carousel)
{
$(carousel.list).find('img').click(function() {
//console.log($(this).parents('.jcarousel-item').attr('jcarouselindex'));
carousel.scroll(parseInt($(this).parents('.jcarousel-item').attr('jcarouselindex')));
});
}
});
});
-->
</script>
<!-- not really needed, i'm using it to center the gallery. -->
<div class="pikachoose">
<ul id="pikame" class="jcarousel-skin-pika">
<? for ($i=0; $i<count($list); $i++) {
$img = "<img src='$latest_skin_path/img/noimage.gif' width='$img_width' height='$img_height' title='이미지 없음' />";
$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 = $img_width / $size[0];
$get_width = $img_width;
$get_height = (int)($size[1] * $rate);
$temp_h = (int)($img_height / $img_width * $size[0]);
$src_y = (int)(($size[1] - $temp_h) / 2);
if ($get_height < $img_height) {
$rate = $img_height / $size[1];
$get_height = $img_height;
$get_width = (int)($size[0] * $rate);
$src_y = 0;
$temp_w = (int)($img_width / $img_height * $size[1]);
$src_x = (int)(($size[0] - $temp_w) / 2);
}
$dst = @imagecreatetruecolor($img_width, $img_height);
$white = @imagecolorallocate($dst, 255, 255, 255);
@imagefilledrectangle($dst, 0, 0, $img_width, $img_height, $white);
@imagecopyresampled($dst, $src, 0, 0, $src_x, $src_y, $get_width, $get_height, $size[0], $size[1]);
@imagejpeg($dst, $thumb_path.'/'.$list[$i][wr_id], $img_quality);
@chmod($thumb_path.'/'.$list[$i][wr_id], 0606);
} else {
$edit_img = $list[$i]['wr_content'];
if (preg_match("/data\/cheditor4[^<>]*\.(gif|jp[e]?g|png|bmp)/i", $edit_img, $tmp)) { // data/cheditor4------
$file = './' . $tmp[0]; // 파일명
$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 = $img_width / $size[0];
$get_width = $img_width;
$get_height = (int)($size[1] * $rate);
$temp_h = (int)($img_height / $img_width * $size[0]);
$src_y = (int)(($size[1] - $temp_h) / 2);
if ($get_height < $img_height) {
$rate = $img_height / $size[1];
$get_height = $img_height;
$get_width = (int)($size[0] * $rate);
$src_y = 0;
$temp_w = (int)($img_width / $img_height * $size[1]);
$src_x = (int)(($size[0] - $temp_w) / 2);
}
$dst = @imagecreatetruecolor($img_width, $img_height);
$white = @imagecolorallocate($dst, 255, 255, 255);
@imagefilledrectangle($dst, 0, 0, $img_width, $img_height, $white);
@imagecopyresampled($dst, $src, 0, 0, $src_x, $src_y, $get_width, $get_height, $size[0], $size[1]);
@imagejpeg($dst, $thumb_path.'/'.$list[$i][wr_id], $img_quality);
@chmod($thumb_path.'/'.$list[$i][wr_id], 0606);
}
}
}
if (file_exists($thumb)){
$img = "<a href='{$list[$i][href]}'><img src='$thumb' width='$img_width' height='$img_height' title=\"{$list[$i][subject]}\" /></a>";
}
echo "<li>".$img."<span><a href=\"{$list[$i][href]}\">".$list[$i][subject]."</a></span></li>";
} ?>
</ul>
</div>
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
$img_width = '700'; //썸네일 가로길이
$img_height = '525'; //썸네일 세로길이
$img_quality = '99'; //퀼리티 100이하로 설정
if (!function_exists("imagecopyresampled")) alert("GD 2.0.1 이상 버전이 설치되어 있어야 사용할 수 있는 갤러리 게시판 입니다.");
$data_path = $g4[path]."/data/file/$bo_table";
$thumb_path = $data_path.'/thumb_plka'; //썸네일 이미지 생성 디렉토리
@mkdir($thumb_path, 0707);
@chmod($thumb_path, 0707);
?>
<link rel="stylesheet" href="<?php echo $latest_skin_path?>/css/pika.css" type="text/css">
<script type="text/javascript" src="<?php echo $latest_skin_path?>/js/jquery.pikachoose.4.js"></script>
<script type="text/javascript" src="<?php echo $latest_skin_path?>/js/jquery.jcarousel.min.js"></script>
<script language="javascript">
<!--
$(document).ready(
function (){
$("#pikame").PikaChoose();
$("#pikame").jcarousel({scroll:4,
initCallback: function(carousel)
{
$(carousel.list).find('img').click(function() {
//console.log($(this).parents('.jcarousel-item').attr('jcarouselindex'));
carousel.scroll(parseInt($(this).parents('.jcarousel-item').attr('jcarouselindex')));
});
}
});
});
-->
</script>
<!-- not really needed, i'm using it to center the gallery. -->
<div class="pikachoose">
<ul id="pikame" class="jcarousel-skin-pika">
<? for ($i=0; $i<count($list); $i++) {
$img = "<img src='$latest_skin_path/img/noimage.gif' width='$img_width' height='$img_height' title='이미지 없음' />";
$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 = $img_width / $size[0];
$get_width = $img_width;
$get_height = (int)($size[1] * $rate);
$temp_h = (int)($img_height / $img_width * $size[0]);
$src_y = (int)(($size[1] - $temp_h) / 2);
if ($get_height < $img_height) {
$rate = $img_height / $size[1];
$get_height = $img_height;
$get_width = (int)($size[0] * $rate);
$src_y = 0;
$temp_w = (int)($img_width / $img_height * $size[1]);
$src_x = (int)(($size[0] - $temp_w) / 2);
}
$dst = @imagecreatetruecolor($img_width, $img_height);
$white = @imagecolorallocate($dst, 255, 255, 255);
@imagefilledrectangle($dst, 0, 0, $img_width, $img_height, $white);
@imagecopyresampled($dst, $src, 0, 0, $src_x, $src_y, $get_width, $get_height, $size[0], $size[1]);
@imagejpeg($dst, $thumb_path.'/'.$list[$i][wr_id], $img_quality);
@chmod($thumb_path.'/'.$list[$i][wr_id], 0606);
} else {
$edit_img = $list[$i]['wr_content'];
if (preg_match("/data\/cheditor4[^<>]*\.(gif|jp[e]?g|png|bmp)/i", $edit_img, $tmp)) { // data/cheditor4------
$file = './' . $tmp[0]; // 파일명
$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 = $img_width / $size[0];
$get_width = $img_width;
$get_height = (int)($size[1] * $rate);
$temp_h = (int)($img_height / $img_width * $size[0]);
$src_y = (int)(($size[1] - $temp_h) / 2);
if ($get_height < $img_height) {
$rate = $img_height / $size[1];
$get_height = $img_height;
$get_width = (int)($size[0] * $rate);
$src_y = 0;
$temp_w = (int)($img_width / $img_height * $size[1]);
$src_x = (int)(($size[0] - $temp_w) / 2);
}
$dst = @imagecreatetruecolor($img_width, $img_height);
$white = @imagecolorallocate($dst, 255, 255, 255);
@imagefilledrectangle($dst, 0, 0, $img_width, $img_height, $white);
@imagecopyresampled($dst, $src, 0, 0, $src_x, $src_y, $get_width, $get_height, $size[0], $size[1]);
@imagejpeg($dst, $thumb_path.'/'.$list[$i][wr_id], $img_quality);
@chmod($thumb_path.'/'.$list[$i][wr_id], 0606);
}
}
}
if (file_exists($thumb)){
$img = "<a href='{$list[$i][href]}'><img src='$thumb' width='$img_width' height='$img_height' title=\"{$list[$i][subject]}\" /></a>";
}
echo "<li>".$img."<span><a href=\"{$list[$i][href]}\">".$list[$i][subject]."</a></span></li>";
} ?>
</ul>
</div>
댓글 전체
이건 뽑아온 것을 보여주는 페이지일 뿐이니 이 소스를 수정할 것이 아닙니다