latest 최신글에서 두번째 이미지 썸네일 사용하기

latest에서 두번째 또는 세번째... 첨부를 썸네일로 만들기 입니다

extend/user.config.php 또는 extend/default.config.php에 다음 함수를 넣으세요

 

function latest_thumb2($bo_table, $wr_id, $thumb_width, $thumb_height, $bf_no=1){
    global $g5;
$file=sql_fetch(" select bf_file from {$g5['board_file_table']} where bo_table = '$bo_table' and wr_id = $wr_id and bf_no=$bf_no");
$filename = $file['bf_file'];

$filepath = "data/file/{$bo_table}"; 
$thumb_file2 = thumbnail($filename, $filepath, $filepath, $thumb_width, $thumb_height, false, true);
$thumb2 = $filepath."/{$thumb_file2}";
return $thumb2;
}

============

기존 썸네일 만들기 코드 $thumb = get_list_thumbnail(~~~) <== 다음에 넣으세요 

$bf_no=1; // 두번째 첨부화일 썸네일
$thumb2 = latest_thumb2($bo_table, $list[$i]['wr_id'], $thumb_width, $thumb_height, $bf_no);

============

<img src='<?php echo $thumb2;?>'>

 

 

 

|

댓글 5개

감사합니다

감사합니다. 스크랩하갑니다. ^^

감사합니다 ^^

최신글 두번째 썸네일
댓글을 작성하시려면 로그인이 필요합니다.

그누보드5 팁자료실

+
제목 글쓴이 날짜 조회
2년 전 조회 3,502
2년 전 조회 2,588
2년 전 조회 1,951
2년 전 조회 2,030
2년 전 조회 1,679
2년 전 조회 2,314
2년 전 조회 1,293
2년 전 조회 1,655
2년 전 조회 1,144
2년 전 조회 3,658
2년 전 조회 1,814
2년 전 조회 1,973
2년 전 조회 1,332
2년 전 조회 1,858
2년 전 조회 1,786
2년 전 조회 2,367
2년 전 조회 1,783
2년 전 조회 1,226
2년 전 조회 2,094
2년 전 조회 1,543
2년 전 조회 1,433
2년 전 조회 2,364
2년 전 조회 1,842
2년 전 조회 2,341
2년 전 조회 1,473
2년 전 조회 2,311
2년 전 조회 1,140
2년 전 조회 1,907
2년 전 조회 1,696
2년 전 조회 2,961