在编辑器中上传一张图片,插入多次后编辑器里会显示多次,但发布后帖子里只显示一次
修改文件source/function/function_attachment.php
查找
  1. foreach($findattach[$pid] as $aid => $find) {
  2.        $postlist[$pid]['message'] = preg_replace($find, attachinpost($postlist[$pid]['attachments'][$aid], $postlist[$pid]), $postlist[$pid]['message'], 1);
  3.        $postlist[$pid]['message'] = preg_replace($find, '', $postlist[$pid]['message']);
  4. }
复制代码
替换为
  1. foreach($findattach[$pid] as $aid => $find) {
  2.          //$postlist[$pid]['message'] = preg_replace($find, attachinpost($postlist[$pid]['attachments'][$aid], $postlist[$pid]), $postlist[$pid]['message'], 1);
  3.         //$postlist[$pid]['message'] = preg_replace($find, '', $postlist[$pid]['message']);

  4.         preg_match_all($find, $postlist[$pid]['message'], $sameattach);
  5.         foreach($sameattach[0] as $key => $value){
  6.                 $tempattach = $postlist[$pid]['attachments'][$aid]['aid'];
  7.                if(count($sameattach[0]) > 1 && $key > 0) {
  8.                           $postlist[$pid]['attachments'][$aid]['aid'] = $postlist[$pid]['attachments'][$aid]['aid'].'_'.$key;
  9.                           $GLOBALS['aimgs'][$pid][] = $postlist[$pid]['attachments'][$aid]['aid'];
  10.                }
  11.                $postlist[$pid]['message'] = preg_replace($find, attachinpost($postlist[$pid]['attachments'][$aid], $postlist[$pid]), $postlist[$pid]['message'], 1);
  12.                $postlist[$pid]['attachments'][$aid]['aid'] = $tempattach;
  13.         }
  14. }
复制代码


体验版logo,1小时内极速出!
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Powered by Discuz! X3.5 © 2001-2016 Comsenz Inc.

返回顶部