Supesite文章转换到Discuz!X编辑文章时图片附件破图

主要原因后缀名的定义方式发生了变化。
旧SS图片附件文件名为:
1_200912292317583fjzO.thumb.jpg
DZX图片附件文件名为:
1_200912292317583fjzO.jpg.thumb.jpg

打开source\function\function_portalcp.php文章

查找:

$small_pic = $attach['thumb'] ? ($pic.'.thumb.jpg') : '';

修改为:

if(file_exists($pic.'.thumb.jpg')){
$small_pic = $attach['thumb'] ? ($pic.'.thumb.jpg') : '';
}elseif(file_exists(filemain($pic).'.thumb.jpg')){
$small_pic = $attach['thumb'] ? (filemain($pic).'.thumb.jpg') : '';
}

第一个function前加:

function filemain($filename) {
return trim(substr($filename, 0, strrpos($filename, '.')));
}

随机文章:

1、Java随机一注双色球代码
https://www.onexin.net/the-java-random-a-note-color-ball-code/

2、Javascript /JS 整型
https://www.onexin.net/javascript-js-beautify/

3、利用htaccess文件来禁止ip
https://www.onexin.net/htaccess-file-to-ban-the-use-of-ip/

4、對幾個概念的辨析:正體字、俗體字、簡體字、繁體字、簡化字
https://www.onexin.net/analysis-of-several-concepts-the-traditional-characters-vulgar-traditional-characters-simplified-chinese-traditional-chinese-simplified/

5、如何将网站批量提交搜索引擎?
https://www.onexin.net/how-do-i-submit-a-site-bulk-search-engine/

转载请注明出处:https://www.onexin.net/supesite-articles-converted-to-discuz-x-image-editing-articles-annex-broken-map/

Leave a Reply

Your email address will not be published. Required fields are marked *