에디터로 올린 이미지 최신글 이미지로 어찌 뽑을 까요? 정보
에디터로 올린 이미지 최신글 이미지로 어찌 뽑을 까요?
본문
검색 봤는데요.
소스가 달라서 인지 잘 모르겠어서요.;;
cheditor4를 사용중입니다.
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
include_once("$latest_skin_path/skin.lib.php");
$img_width = 125; // 이미지 가로 사이즈
$img_height = 165; // 이미지 세로 사이즈
$mod = 5; // 한줄 출력개수
$data_path = $g4[path]."/data/file/$bo_table";
$thumb_path = $data_path.'/latest_thumb';
@mkdir($thumb_path, 0707);
@chmod($thumb_path, 0707);
?>
<style type="text/css">
.latestList {position:relative; margin-bottom:15px; padding-bottom:15px; border-bottom:1px solid #ddd; font-size:12px; }
.latestList * {margin:0; padding:0; border:none;}
.latestList h2 {margin-bottom:5px; padding:8px; font-size:12px; color:#222;}
.latestList h2 a {text-decoration:none; color:#222;}
.latestList li {list-style:none; line-height:160%; font-size:12px;}
.latestList ul.thumb li {position:relative; display:inline; float:left; margin-left:10px;}
.latestList ul.thumb li.first {margin-left:0;}
.latestList ul.thumb li img {vertical-align:top; width:124px;}
.latestList ul.thumb li span {position:absolute; left:0; bottom:0; width:<?=$img_width?>px; overflow:hidden; text-align:center; font-size:11px; color:#fff; background:#000; opacity:.7; filter:alpha(opacity=70);}
.latestList .btnPage {position:absolute; top:7px; right:0;}
.latestList .btnPage li {display:inline; float:left;}
.latestList.h2bg {border-bottom:none;}
.latestList.h2bg ul.btnPage {right:10px;}
.latestList.h2bg h2 {background:#f5f5f5; -moz-border-radius: 5px;}
.latestList.h2bg h2 a {color:#000;}
</style>
<div class="latestList h2bg" style="clear:both;">
<h2><a href="<?=$g4[bbs_path]?>/board.php?bo_table=<?=$bo_table?>"><?=$board[bo_subject]?></a></h2>
<ul class="btnPage">
<li><a href="<?=$g4[bbs_path]?>/board.php?bo_table=<?=$bo_table?>"><img src="<?=$latest_skin_path?>/img/btn_more.gif" alt="전체보기" title="전체보기" /></a></li>
</ul>
<ul class="thumb">
<?
for ($i=0; $i<count($list); $i++) {
?>
<li <?if($i==0){echo "class='first'";}?>>
<?
if($list[$i][file][0][view]){
$src = $list[$i][file][0][path]."/".$list[$i][file][0][file];
$get_img = getimagesize($src); // 파일정보를 가져옴
// 관리자가 이미지 사이즈를 바꾸었을때를 대비하여 리사이징 크기를 이름에 포함과 이미지 재 첨부시 바뀜
$img_step1 = explode("_",$list[$i][file][0][file]);
$img_step2 = explode(".",$img_step1[1]);
$new_imgname = $img_step2[0];
$thumb_file_list = "{$thumb_path}/{$img_width}x{$img_height}_{$new_imgname}_{$list[$i][wr_id]}_list";
if(!file_exists($thumb_file_list)){
// gd lib 체크
$gd = gd_info();
$gdversion = substr(preg_replace("/[^0-9]/", "", $gd['GD Version']), 0, 2); // gd 버전이 2.0 이상인지 체크
if(!$gdversion){
$thumb_file_view = $src; // gd 2.0 이하면 강제적으로 줄임
}else{
if($img_width > $get_img[0] || $img_height > $get_img[1]){
$thumb_file_list = $src;
}else{
createThumb_list($img_width,$img_height,$src, $thumb_file_list, $get_img); // list 페이지 썸네일
}
}
}
$img = "<a href='{$list[$i]['href']}'><img src=\"$thumb_file_list\" border=\"0\" width=\"$img_width\" height=\"$img_height\"/><span>{$list[$i]['subject']}</span></a>";
}else{
// no 이미지를 비율적으로 만들어났음
$img = "<a href='{$list[$i]['href']}'><img src=\"$latest_skin_path/img/no_image.gif\" border=\"0\" height=\"{$img_height}\" width=\"{$img_width}\"/><span>{$list[$i]['subject']}</span></a>";
}
echo $img;
?>
</li>
<?}?>
<? if (count($list) == 0) { ?><li>게시물이 없습니다.</li><? } ?>
</ul>
</div>
소스가 달라서 인지 잘 모르겠어서요.;;
cheditor4를 사용중입니다.
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
include_once("$latest_skin_path/skin.lib.php");
$img_width = 125; // 이미지 가로 사이즈
$img_height = 165; // 이미지 세로 사이즈
$mod = 5; // 한줄 출력개수
$data_path = $g4[path]."/data/file/$bo_table";
$thumb_path = $data_path.'/latest_thumb';
@mkdir($thumb_path, 0707);
@chmod($thumb_path, 0707);
?>
<style type="text/css">
.latestList {position:relative; margin-bottom:15px; padding-bottom:15px; border-bottom:1px solid #ddd; font-size:12px; }
.latestList * {margin:0; padding:0; border:none;}
.latestList h2 {margin-bottom:5px; padding:8px; font-size:12px; color:#222;}
.latestList h2 a {text-decoration:none; color:#222;}
.latestList li {list-style:none; line-height:160%; font-size:12px;}
.latestList ul.thumb li {position:relative; display:inline; float:left; margin-left:10px;}
.latestList ul.thumb li.first {margin-left:0;}
.latestList ul.thumb li img {vertical-align:top; width:124px;}
.latestList ul.thumb li span {position:absolute; left:0; bottom:0; width:<?=$img_width?>px; overflow:hidden; text-align:center; font-size:11px; color:#fff; background:#000; opacity:.7; filter:alpha(opacity=70);}
.latestList .btnPage {position:absolute; top:7px; right:0;}
.latestList .btnPage li {display:inline; float:left;}
.latestList.h2bg {border-bottom:none;}
.latestList.h2bg ul.btnPage {right:10px;}
.latestList.h2bg h2 {background:#f5f5f5; -moz-border-radius: 5px;}
.latestList.h2bg h2 a {color:#000;}
</style>
<div class="latestList h2bg" style="clear:both;">
<h2><a href="<?=$g4[bbs_path]?>/board.php?bo_table=<?=$bo_table?>"><?=$board[bo_subject]?></a></h2>
<ul class="btnPage">
<li><a href="<?=$g4[bbs_path]?>/board.php?bo_table=<?=$bo_table?>"><img src="<?=$latest_skin_path?>/img/btn_more.gif" alt="전체보기" title="전체보기" /></a></li>
</ul>
<ul class="thumb">
<?
for ($i=0; $i<count($list); $i++) {
?>
<li <?if($i==0){echo "class='first'";}?>>
<?
if($list[$i][file][0][view]){
$src = $list[$i][file][0][path]."/".$list[$i][file][0][file];
$get_img = getimagesize($src); // 파일정보를 가져옴
// 관리자가 이미지 사이즈를 바꾸었을때를 대비하여 리사이징 크기를 이름에 포함과 이미지 재 첨부시 바뀜
$img_step1 = explode("_",$list[$i][file][0][file]);
$img_step2 = explode(".",$img_step1[1]);
$new_imgname = $img_step2[0];
$thumb_file_list = "{$thumb_path}/{$img_width}x{$img_height}_{$new_imgname}_{$list[$i][wr_id]}_list";
if(!file_exists($thumb_file_list)){
// gd lib 체크
$gd = gd_info();
$gdversion = substr(preg_replace("/[^0-9]/", "", $gd['GD Version']), 0, 2); // gd 버전이 2.0 이상인지 체크
if(!$gdversion){
$thumb_file_view = $src; // gd 2.0 이하면 강제적으로 줄임
}else{
if($img_width > $get_img[0] || $img_height > $get_img[1]){
$thumb_file_list = $src;
}else{
createThumb_list($img_width,$img_height,$src, $thumb_file_list, $get_img); // list 페이지 썸네일
}
}
}
$img = "<a href='{$list[$i]['href']}'><img src=\"$thumb_file_list\" border=\"0\" width=\"$img_width\" height=\"$img_height\"/><span>{$list[$i]['subject']}</span></a>";
}else{
// no 이미지를 비율적으로 만들어났음
$img = "<a href='{$list[$i]['href']}'><img src=\"$latest_skin_path/img/no_image.gif\" border=\"0\" height=\"{$img_height}\" width=\"{$img_width}\"/><span>{$list[$i]['subject']}</span></a>";
}
echo $img;
?>
</li>
<?}?>
<? if (count($list) == 0) { ?><li>게시물이 없습니다.</li><? } ?>
</ul>
</div>
댓글 전체
$edit_img = $list[$i]['wr_content'];
if ( eregi("data/cheditor4/[^<>]*\.(gif|jpg|png|bmp)", $edit_img, $tmp) ) {
$temp_thumb = $g4["path"]."/".$tmp[0];
}
$tmp 에 이미지 명이 배열로 들어가요
if ( eregi("data/cheditor4/[^<>]*\.(gif|jpg|png|bmp)", $edit_img, $tmp) ) {
$temp_thumb = $g4["path"]."/".$tmp[0];
}
$tmp 에 이미지 명이 배열로 들어가요
답변감사합니다.
그런데 어찌 삽입을 해야 할까요?
그런데 어찌 삽입을 해야 할까요?