modules/document/document.item.php 763번째줄
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
if($this->get('uploaded_count')){ $oFileModel = &getModel('file'); $file_list = $oFileModel->getFiles($this->document_srl, array(), 'file_srl', true); if(count($file_list)) { foreach($file_list as $file) { if($file->direct_download!='Y') continue; if(!preg_match("/^thumbnail\.(jpg|png|jpeg|gif|bmp)$/i",$file->source_filename)) continue; $source_file = $file->uploaded_filename; if(!file_exists($source_file)) $source_file = null; else break; } if (!$source_file) { foreach($file_list as $file) { if($file->direct_download!='Y') continue; if(!preg_match("/\.(jpg|png|jpeg|gif|bmp)$/i",$file->source_filename)) continue; $source_file = $file->uploaded_filename; if(!file_exists($source_file)) $source_file = null; else break; } } }} |
질문자) 이왕이면 파일명에 thumbnail 이라는 단어가 들어가 있다면 thumbnail 파일로 보여지면 더 좋겠습니다. 사진이름내에 thumbnail이라는 단어가 있다면 그 파일을 썸네일 파일로 보여지게요.. 예를 들면 소녀시대(thumbnail).jpg 이런식으로 해도 되게끔 하면 더 좋을듯합니다.
답변자) "/^thumbnail.(jpg|png|jpeg|gif|bmp)$/i" 이 정규식을
"/.*thumbnail.*\.(jpg|png|jpeg|gif|bmp)$/i" 으로 바꿔주시면 됩니다.
p.s 참고로 문하우스는 Xe버전이 1.4대라서 596번째줄입니다.
그리고 thumbnail 이름이 길거나 하면 다른 간단한 이름으로 바꾸어 주어도 됩니다.
저는 "/.*tn.*\.(jpg|png|jpeg|gif|bmp)$/i" 이렇게 tn으로 간단히 바꾸었습니다.
Tip이 도움이 되었다면 댓글과 평가 부탁합니다.
Tip에 대한 궁금한 점은 댓글로 남겨 주시면 성심껏 답변 드립니다. 
