그룹 인기게시물 추출하기 중 썸네일 이미지 출력이 안됩니다.

그룹 인기게시물 추출하기 중 썸네일 이미지 출력이 안됩니다.

QA

그룹 인기게시물 추출하기 중 썸네일 이미지 출력이 안됩니다.

본문

그룹 내 전체 게시판에서 인기 게시물 순서대로 출력하려고 합니다.

그런데 썸네일 이미지가 출력이 되지 않습니다.

이미지를 첨부파일로 올렸는데, "이미지 없음" 으로 뜹니다.

어느부분이 잘못된건지.. 어디를 수정해야 하는지 모르겠네요 ㅠㅠ 1주일째 이것에 메여있는데

답이 안나와서 질문게시판에 도움을 청합니다...

 

염치 없지만, 조금이나마 도움을 얻을 수 있을까요?

좋은하루되세요! 

읽어주셔서 감사합니다.

 

 

* 그룹 인기 최근글 불러오는 페이지 index.php


<?php
define('_INDEX_', true);
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
 
if (G5_IS_MOBILE) {
    include_once(G5_THEME_MOBILE_PATH.'/index.php');
    return;
}
 
include_once(G5_THEME_PATH.'/head.php');
?>
 
 
 
 
 
<?php include_once(G5_LIB_PATH.'/best10.lib.php'); ?> 
<?php echo izen_group('clean_gallery3_game', 'test', wr_hit, 20, 22, 30); ?>
 
 
 
 
<?php
include_once(G5_THEME_PATH.'/tail.php');
?>

 

 

* 아래는 최근게시물 스킨, lib/best10.lib.php 소스를 나타낸것입니다.

 

 

 

skin/latest/clean_gallery3_game/latest.skin.php


<?php
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
include_once(G5_LIB_PATH.'/thumbnail.lib.php');
 
$imgwidth = 146; //표시할 이미지의 가로사이즈
$imgheight = 102; //표시할 이미지의 세로사이즈
$img_quality = 100;
?>
 
<style>
/*-14px;  최신글의 왼쪽위치*/
#oneshot { position:relative;margin:0 auto;}
#oneshot .la_title{position:absolute; left:0; top:0; z-index:100; background:#000; padding:5px; font-size:1em; color:#fff;margin:0 0 0 0px;filter:alpha(opacity=50);opacity:.5;}
 
/*==라운딩 라인===*
#oneshot .img_border{
border-top-left-radius: 7px;
border-top-right-radius: 7px;
border-bottom-right-radius: 7px;
border-bottom-left-radius: 7px;
background:#fafafa;/
 
margin:0 0 20px 0;
/* 박스라인 */
border:1px solid #BBBBBB;
border-top-color: #A4A4A4;
border-right-color: #A4A4A4;
/*border-bottom-color: #A4A4A4;*/
 
background:#F5F5F5;
/* 2중 박스 그림자 */
box-shadow: 3px -3px #DDDDDD, 4px -4px #999;
 
/*이미지와 박스 간격*/
padding:5px 5px 4px;
position:relative; display:inline-block; overflow:hidden; text-decoration:none}
height:520px;
#oneshot .img_set{
 
/*=======이미지 모서리 라운드======*
border-top-left-radius: 0px;
border-top-right-radius: 7px;
border-bottom-right-radius: 0px;
border-bottom-left-radius: 7px;
background:#fafafa;
/*border-radius:10%; *
border:1px solid #fff; padding:0px;
position:relative; display:inline-block; overflow:hidden; text-decoration:none}
 
#oneshot .img{width:<?php echo $imgwidth ?>px; height:<?php echo $imgheight ?>px; background:#fafafa;padding:0;}
#oneshot .subject_set2{width:<?php echo $imgwidth + 8?>px; height:58px; padding:0px; margin-left:-9px;z-index:1; bottom:0; left:0;
/*박스 높이*/
height:107px
;}
 
/*제목 높이간격, 왼쪽위치*/
#oneshot .subject_set2 .sub_title2{color:#fff;height:8px; overflow:hidden;padding:16px;
padding-left:12px;
/*제목 배경이미지*/
background:url('../img/game_new_subject.png');
font-size:12px;font-family:나눔고딕; NanumBarunGothic,dotum;}
 
/*내용글*
#oneshot .subject_set2 .sub_content{margin-top:2px;color:#8c8a8a;font-size:12px; height:35px;overflow:hidden;padding:3px;
/*내용글 왼쪽간격*/
padding-left:11px;
font-family:dotum;line-height:17px;}
 
/*조회수/추천수등*/
#oneshot .subject_set2 .view{height:20px;
/*조회수/추천수등 왼쪽간격*/
padding-left:11px;
}
 
 
 
#oneshot ul {list-style:none;clear:both; margin:0;padding:0;}
/*이미지간의 간격*/
#oneshot li{float:left;list-style:none;text-decoration:none;margin-left:-15px;padding-right:35px}
.subject_set2  a:link, a:visited {
font-weight:bold; 
/*제목 텍스트 그림자*
text-shadow: 0px 0px 2px rgb(44,44,44);
text-decoration:none}
 
/*제목 마우스오버*
.subject_set2  a:hover {
color:#FFCC33  !important;
text-shadow: 1px 1px 2px rgb(24,24,24);
font-weight:bold; 
text-decoration:none}/
 
/* 폰트불러오기 */
@font-face {font-family:'NanumBarunGothic';src: url('<?php echo $latest_skin_url ?>/NanumBarunGothic.eot');}
@font-face {font-family:'NanumGothic';src: url('<?php echo $latest_skin_url ?>/NanumGothic.eot');}
 
</style>
<div id="oneshot">
	<ul>
	<?php for ($i=0; $i<count($list); $i++) { ?>	
		<li>
		<div class="img_border">
		<div class="img_set">
			<div class="img">
				<a href="<?php echo $list[$i]['href'] ?>">
					<?php                
					 $thumb = get_list_thumbnail($list[$i]['bo_table'], $list[$i]['wr_id'], $imgwidth, $imgheight);    					            
					if($thumb['src']) {
					$img_content = '<img class="img_left" src="'.$thumb['src'].'" alt="'.$list[$i]['subject'].'" width="'.$imgwidth.'" height="'.$imgheight.'">';
					} else {
					$img_content = '이미지 없음';
					}                
					echo $img_content;												               
					?>
				</a>
			</div>
			</div>
			
			<div class="subject_set2">
 
				<div class="sub_title2">
 
 
				<a href="<?php echo $list[$i]['href'] ?>">
				<font color="#000000">
				<?php echo cut_str($list[$i]['subject'], 13, "..") ?></font>
				</a></div>
 
				<div class="sub_content">
				    <?//=cut_str(strip_tags($list[$i]['wr_content']), 30, '..')?>
				<!--게임 간략설명
					<?=cut_str(strip_tags($list[$i][wr_4]),128,"..")?></div>-->
 
<div class="view">
<!--
<span style="margin-right:2px; font-family:Dotum,Verdana,Arial; font-size:12px;"><font color="white">view</font></span>
<span style="font-family:Dotum,Verdana,Arial; font-size:13px;"><font color="#CC6018"><b><?=$list[$i][wr_hit]?></b>
</font></span>
 
<font style="font-family:Dotum,Verdana,Arial; font-size:11px;" color="#D3D3D3"> | </font>
 
<span style="margin-right:2px; font-family:Dotum,Verdana,Arial; font-size:12px;"><font color="#737373">댓글</font></span>
<span style="font-family:Dotum,Verdana,Arial; font-size:13px;"><font color="#CC6018"><b><?=$list[$i][wr_comment]?></b> 
</font>
 
<font style="font-family:Dotum,Verdana,Arial; font-size:11px;" color="#D3D3D3"> | </font>
 
<span style="margin-right:2px; font-family:Dotum,Verdana,Arial; font-size:12px;"><font color="#737373">좋아요</font></span>
<span style="font-family:Dotum,Verdana,Arial; font-size:13px;"><font color="#A9A9A9"><b><?=$list[$i][wr_good]?></b></font></span>
-->
	</div>
			</div>
		</li>
	<?php } ?>
	</ul>
</div>
<div style="clear:both;"></div>
</div>
<div style="padding-bottom:20px"></div>

 

 

 

* lib/best10.lib.php


<?php
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
 
/* 
izen.group.lib.php 
제작일 : 2006-12-08 
 
지정 기간제 히트순 최근 게시물 수정본 
http://www.sir.co.kr/bbs/tb.php/g4_tiptech/7328 
 
그룹 최신글 관련하여 통합하도록 하였다. 
정렬 필드값에 의해서 SQL 문을 추가하도록 하면 된다. 
 
izen_group('스킨', '그룹명', 정렬필드, 출력갯수, 자를 문자열, 최근 몇일간을 출력할 것인가?); 
예) echo izen_group('best10', '06', wr_hit, 10, 28, 30); 
*/ 
 
# 인기글 
function izen_usort1($a, $b) 
{ 
return $b['wr_hit'] - $a['wr_hit']; 
} 
 
# 헤드라인 
function izen_usort2($a, $b) 
{ 
return $b['wr_good'] - $a['wr_good']; 
} 
 
# 최신글 추출 
function izen_group($skin_dir="", $gr_id, $izen_sort, $rows=10, $subject_len=40, $listdate) 
{ 
global $g5; 
 
$nowYmd = date(Ymd); # 시작시간을 구합니다. 
$time = time(); 
$startYmd = date("Ymd",strtotime("-".$listdate." day", $time)); 
 
if (!$skin_dir) $skin_dir = 'basic';
 
    if(G5_IS_MOBILE) {
        $latest_skin_path = G5_MOBILE_PATH.'/'.G5_SKIN_DIR.'/latest/'.$skin_dir;
        $latest_skin_url  = G5_MOBILE_URL.'/'.G5_SKIN_DIR.'/latest/'.$skin_dir;
    } else {
        $latest_skin_path = G5_SKIN_PATH.'/latest/'.$skin_dir;
        $latest_skin_url  = G5_SKIN_URL.'/latest/'.$skin_dir;
    }
 
$list = array(); 
 
$sql= " select bo_table from {$g5['board_table']} "; 
$ress = sql_query($sql); 
for($i=0, $ii=0; $board=sql_fetch_array($ress); $ii++) 
{ 
$tmp_write_table = $g5['write_prefix'] . $board['bo_table']; # 게시판 테이블 전체이름
//$sql = "select * from `$tmp_write_table` where wr_is_comment <> '1' and  date_format(wr_datetime, '%Y%m%d') between '$startYmd' and '$nowYmd' order by $sort desc limit 0, $rows "; 
 
# 정렬 필드에 의해서 전체적으로 정렬, 관리한다. 
if ($izen_sort == 'wr_hit') 
{ 
$sql_gr_Q = " wr_is_comment <> '1' and date_format(wr_datetime, '%Y%m%d') between '$startYmd' and '$nowYmd' order by $izen_sort desc limit 0, $rows "; 
} 
elseif ($izen_sort == 'wr_scrap') 
{ 
$sql_gr_Q = " wr_is_comment <> '1' and date_format(wr_datetime, '%Y%m%d') between '$startYmd' and '$nowYmd' and wr_scrap <> 0 order by $izen_sort desc limit 0, $rows "; 
} 
elseif ($izen_sort == 'wr_datetime') # wr_1 헤드라인 
{ 
$sql_gr_Q = " wr_is_comment <> '1' and date_format(wr_datetime, '%Y%m%d') between '$startYmd' and '$nowYmd' and wr_1 = 1 order by $izen_sort desc limit 0, $rows "; 
} 
elseif ($izen_sort == 'wr_good') # 
{ 
$sql_gr_Q = " wr_is_comment <> '1' and date_format(wr_datetime, '%Y%m%d') between '$startYmd' and '$nowYmd' and wr_good <> '0'  order by $izen_sort desc limit 0, $rows "; 
} 
elseif ($izen_sort == 'wr_id') 
{ 
$sql_gr_Q = " wr_is_comment <> '1' order by $izen_sort desc limit 0, $rows "; 
} 
 
$sql = " select * from `$tmp_write_table` where $sql_gr_Q "; 
$result = sql_query($sql); 
 
#for (; $row=sql_fetch_array($result); $i++) # *오류* 전체 게시물 가운데 날짜에 상관없이 히트순으로 지정한 갯수만큼 출력된다. 
for ($i==0; $row=sql_fetch_array($result); $i++) 
{ 
$list[$i] = get_list($row, $board, $latest_skin_url, $subject_len, $listdate); 
} 
} 
 
if ($izen_sort == 'wr_hit') 
{ 
usort($list, 'izen_usort1'); 
} 
 
elseif ($izen_sort == 'wr_good') 
{ 
usort($list, 'izen_usort2'); 
} 
 
$list= array_slice($list, 0, $rows); 
 
    ob_start();
    include $latest_skin_path.'/latest.skin.php';
    $content = ob_get_contents();
    ob_end_clean();
 
    return $content;
}
?>

이 질문에 댓글 쓰기 :

답변 2

izen_group 함수에서는 자체적으로 파일을 읽어오는 기능이 없네요?


스킨에도 없고요..


파일 정보를 안읽어왔으니 섬네일도 못만들죠..



일단 함수나 스킨에서 게시물의 파일 정보를 읽어와야 하빈다. 


bo_table 이랑 wr_id로 파일 테이블에서 파일명을 읽어와서


폴더명 붙여서 URL과 PATH 생성하셔야 


이미지랑 섬네일이 표시가 되져



직접 만드시던가.. 다른 그룹최신글 함수 찾아보세요



2차 질문이 있어서 썸네일이 안나오는 이유를 알려주려고 코드를 분석해 봤는데 해결책에 대한 답변을 달기도 전에, 금새 2차 질문글을 지웠버렸네요?

 

참고로

썸네일이 안나오는 이유는 izen_usort1 함수에서 썸네일 추출에 필요한 bo_table 값이 $list 배열변수에 정의되지 않아서 그런겁니다. 

답변을 작성하시기 전에 로그인 해주세요.
전체 125,991 | RSS
QA 내용 검색

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1404호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT