최근게시물에서 썸네일 출력시
어떻게해야하나요?
게시판에서 이미 썸네일을 생성했는데
최근게시물에서 한번더 생성해야하나요?
따로 생성시키는 부분 없시
그냥 게시판에서 생성되어있는 썸네일을
각각의 게시물에 맞게 뽑아올수는 없나요?
|
댓글을 작성하시려면 로그인이 필요합니다.
로그인
댓글 11개
이미 생성된 썸네일을 바로 불러옵니다.
가로 세로 정렬 가능합니다.
클릭시 팝업이미지 뜨구요.
참고하세요.
latest.skin.php -------------
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
// 이미지 가로 및 세로 정렬 기능 - 그누 썸네일 갤러리 공용 최신글
// 썸네일이 없을경우 원본이미지 불러옴.
$cols = 4; // 이미지 가로갯수 - 이미지 세로 갯수는 메인에서 지정(총 이미지 수)
$image_h = 10; // 이미지 상하 간격
$col_width = (int)(99 / $cols);
$data_path = $g4[path]."/data/file/$bo_table";
$thumb_path = $data_path.'/thumb';
?>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align='center'>
<table width="97%" border="0" cellspacing="0" cellpadding="0">
<tr>
<? for ($i=0; $i<count($list); $i++) {
if ($i>0 && $i%$cols==0) { echo "</tr><tr><td colspan='$cols' height='$image_h'></td></tr><tr>"; }
?>
<td width="<?=$col_width?>%" align="center" valign='top'>
<?
$image = $list[$i][file][0][file]; //원본 리사이즈_아래 자바와 연동_추가
$img=$data_path. "/".$image; //썸네일이 없을경우 원본출력
$thumb = $thumb_path. "/". $list[$i][wr_id];
if ( file_exists($thumb) )
$img = $thumb;
$style = "font-family:돋움; font-size:9pt; color:#636363;";
if ($list[$i][icon_new])
$style = "style='font-family:돋움; font-size:9pt; color:#006F00;' ";
$subject = "<span $style>".cut_str($list[$i][subject],15)."</span>"; //제목 글자수 자르기
// $subject = "<span $style>". $list[$i][subject]. "</span>";
echo $list[$i][icon_reply] . " ";
echo "<table cellpadding=1 cellspacing=1 border=0 bgcolor='#E1E1E1'><tr>";
echo "<td bgcolor='#FFFFFF'><a href=\"javascript:;\" OnClick=\"popupImage('$g4[path]/data/file/$bo_table/$image')\" onFocus=\"this.blur();\" title=\"{$list[$i][subject]}\"><img src='$img' width='100' height='67' border='0'></a></td></tr></table>";
echo "<table cellpadding=0 cellspacing=0 border=0><tr><td height=3></td></tr>";
echo "<tr><td><a href='{$list[$i][href]}' onfocus='this.blur()'>{$subject} {$list[$i][icon_new]}</a></td></tr></table> ";
?>
</td>
<? } ?>
<?
$cnt = ($i%$cols);
for ($k=$cnt; $k<$cols && $cnt; $k++) {
echo "<td width=$col_width%> </td>";
}
?>
<? if (count($list) == 0) { echo "<td height=80 align=center>게시물이 없습니다.</td>"; } ?>
</tr>
</table></td>
</tr>
</table>
<script language="javascript">
function popupImage(imageURL){
imageHandle=open("","popupForImage","toolbar=no,location=no,status=no,manubar=no,scrollbars=no,resizable=no,width=100,height=100,top=0,left=0");
imageHandle.document.write("<title> </title>");
imageHandle.document.write("<style>");
imageHandle.document.write("*{margin:0;padding:0;border:0;}");
imageHandle.document.write("</style>");
imageHandle.document.write("<img src=\""+imageURL+"\" onload=\"window.resizeTo(this.width+6,this.height+55);\" onclick=\"self.close();\" style=\"cursor:hand;\" title=\"클릭하면 닫힙니다.\">");
}
</script>
지금 테스트해보니
이미지는 잘 나오는데
다른이름으로 저장해보니
큰 이미지가 나오네요 ㅜㅜ
그래도 관심갖어주셔서 감사합니다 ㅜㅜ
그래서 다른 이미지가(처음 등록한 이미지) 출력 될수있습니다.
썸네일까지 수정되도록 하려면
게시판스킨 중
write_update.skin.php 을 수정해야 합니다.
그냥 최근게시물에 나온 이미지가 정상적인 썸네일인지 확인 할려구
다름이름으로 저장을 했더니
작은이미지가 아닌 큰 이미지로 나와서요~
제가 말을 분명치 않게해서 오해하신듯 합니다 죄송해요ㅜㅜ
#새로 게시물을 등록하고 이미지를 첨부했는데도 최근게시물에는 첨부된 이미지만 나옵니다~
혹시 스킨을 어떤것을 쓰시는지..
(board스킨을 기본스킨이나 응용한스킨인 경우만 동작합니다.)
스킨에 맞춰서 최신글을 확인해야 할것 갔네요.
도움이 안되서 죄송하네요.
다른스킨이라면
위소스에서 일부만 수정하면 될것 같군요.
즉 경로 부분이나
$thumb = $thumb_path. "/". $list[$i][wr_id]; 부분
최신글 ...
http://sir.co.kr/bbs/tb.php/g4_skin/14064
헐랭이님께는 죄송하지만
적은 포인트나마 알라뷰님께 선물을
알라뷰님, 헐랭이님 진짜 감사합니다