Discuz7.2 首页四格图片不刷新的解决方案
彻底解决这个问题有点麻烦
要修改3个地方
1.---------------------------------------------------------
修改检索图片的sql语句
pic.php
找到
$fids = $searchfid ? 'AND '."t.fid IN ($searchfid)" : '';
$data = array();
修改下面的sql语句为
$query = $db->query("SELECT attach.aid, attach.attachment, t.tid, t.fid, t.subject FROM {$tablepre}attachments attach LEFT JOIN {$tablepre}threads t ON t.tid=attach.tid WHERE attach.readperm='0' AND displayorder>='0' AND( filetype='image/pjpeg' or filetype='image/jpeg') $fids GROUP BY attach.tid ORDER BY $orderby DESC LIMIT $searchnums");
2.---------------------------------------------------------
批量上传,图片filetype总是application/octet-stream的BUG,及修改办法
/include/post.func.php
找到 list($width) = (array)$imagesize;
在它前面面添加
$imagesize['mime'] && $attach['type'] = $imagesize['mime'];
仅限图片。
3.---------------------------------------------------------
建立一个php文件,写入如下代码
这个文件的作用是
将filetype为"application/octet-stream "的jpg或者png图片数据修改成"image/jpeg "
<?php
$connect = mysql_connect("localhost","root","aaaa");
mysql_select_db("lsf100705",$connect);
$results = mysql_query("select aid,attachment from cdb_attachments");
while($row = mysql_fetch_array($results,MYSQL_NUM)){
$ext = explode(".",$row[1]);
if(($ext[1]=="jpg")or($ext[1]=="png")){
$update = mysql_query("update cdb_attachments set filetype='image/jpeg' where aid=$row[0] ");
//$updateResult = mysql_fetch_array($update,MYSQL_NUM);
printf("%s:%s<br/>",$row[0] ,mysql_affected_rows());
}
}
mysql_free_result($results);
?>
这样就修改好了
LSF(科学之爱永恒)论坛
http://www.lsf.cc
用想象力来阅读!!!
文章来源: blog.csdn.net,作者:fengda2870,版权归原作者所有,如需转载,请联系作者。
原文链接:blog.csdn.net/fengda2870/article/details/5810757
- 点赞
- 收藏
- 关注作者
评论(0)