테스트 사이트 - 개발 중인 베타 버전입니다

타 솔루션 -> 그누보드 데이터 마이그레이션시 갤러리 썸네일 출력 되지 않는 문제 해결 방법

· 5년 전 · 3857 · 1

1. lib/thumbnail.lib.php 파일을 편집기로 열어줍니다.

 

1
2
3
4
5
6
7
8
9
10
11
<?php
if (!defined('_GNUBOARD_')) exit;
 
@ini_set('memory_limit''-1');
 
// 게시글리스트 썸네일 생성
function get_list_thumbnail($bo_table$wr_id$thumb_width$thumb_height$is_create=false$is_crop=false$crop_mode='center'$is_sharpen=false$um_value='80/0.5/3')
{
    global $g5$config;
    $filename = $alt = "";
    $edt = false;
cs

 

위의 11번줄 바로 아래에 위치한 $sql 구문을 다음과 같이 변경합니다.

 

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
 
$migration_date = '2019-11-20'// YYYY-mm-dd HH:ii:ss 형식으로 자유롭게 적으면 됨.
    $sql = " select bf_file, bf_content from {$g5['board_file_table']}
                where bo_table = '$bo_table' and wr_id = '$wr_id' and (
                (`bf_datetime`<='{$migration_date}' and `bf_file` like '%.png')
                || (`bf_datetime`<='{$migration_date}' and `bf_file` like '%.PNG')
                || (`bf_datetime`<='{$migration_date}' and `bf_file` like '%.gif')
                || (`bf_datetime`<='{$migration_date}' and `bf_file` like '%.GIF')
                || (`bf_datetime`<='{$migration_date}' and `bf_file` like '%.jpg')
                || (`bf_datetime`<='{$migration_date}' and `bf_file` like '%.jpeg')
                || (`bf_datetime`<='{$migration_date}' and `bf_file` like '%.JPG')
                || (`bf_datetime`<='{$migration_date}' and `bf_file` like '%.JPEG')
                || bf_type between '1' and '3'
                )
                order by bf_no limit 0, 1 ";
cs

 

타 솔루션에서 그누보드로 데이터를 이전하면서 파일 형식을 모두 0혹은 그 이외의 값으로 지정하여 이전하더라도 지정한 날짜를 포함한 그 이전의 자료는 모두 출력할 수 있게 처리합니다.

 

MySQL은 일단 대소문자를 구분하지 않으니, 대문자 부분이 거슬리신다면 빼셔도 됩니다.

 

매우 간단한 팁이었습니다. :)

댓글 작성

댓글을 작성하시려면 로그인이 필요합니다.

로그인하기

댓글 1개

좋은 정보 감사합니다 :)

게시글 목록

번호 제목
24318
24317
24315
24309
24294
24293
24277
24262
24260
24253
24251
24236
24233
24228
24226
24221
24214
24203
24201
24199
24196
24195
24194
24192
24191
24187
24185
24183
24172
24168