大佬教程收集整理的这篇文章主要介绍了Discuz如何解决手机端图片显示模糊,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
修改文件upload/template/default/touch/forum/post.htm 83行代码
<li style="padding:0px;">
<a href="javascript:;" class="y" style="BACkground:url(static/image/mobile/images/icon_photo.png) no-repeat;overflow:hidden;">
<input type="file" name="Filedata" multiple="multiple" id="filedata" style="width:30px;height:30px;font-size:30px;opacity:0;">
</a>
</li>
修改js文件upload/template/default/touch/forum/post.htm 206行
for (var i=0;i<this.files.length;i++ ) {
var file_data = [];
file_data.push(this.files[i]);
$.buildfileupload({
uploadurl:'misc.PHP?mod=swfupload&operation=upload&type=image&inajax=yes&infloat=yes&simple=2',
files:file_data,
uploadformdata:{uid:"$_G[uid]", hash:"<!--{eval echo md5(substr(md5($_G[config][security][authkey]),8).$_G[uid])}-->"},
uploadinputname:'Filedata',
maxfilesize:"2000",
success:uploadsuccess,
error:function() {
popup.open('上传失败,请稍后再试', 'alert');
}
});
}
修改文件upload/template/default/touch/forum/discuzcode.htm 90行
$fix = count($post[imagelist]) == 1 ? 140 : 1500;
修改完效果:对于上面的这个330应该就是显示图片的宽度的。但是这是在一个机器里边测试的,其他机型肯定有问题。而且图片已经模糊的不能看了。
修改文件upload/template/default/touch/forum/viewthread.htm 174行-183行修改为
<!--{if $_G['forum_thread']['subjectimage']}-->
<!--{loop $_G['forum_thread']['subjectimage'] $imageData}-->
<img src="data/attachment/forum/$imageData[attachment]" alt="">
<!--{/loop}-->
<!--{/if}-->
修改PHP文件upload/source/module/forum/forum_viewthread.PHP:在20行后加上即可
# 主题图片
$subjectimage = DB::fetch_all("SELEct * from pre_forum_attachment where tid= '$tid' limit 1");
$subject_tablEID = $subjectimage[0]['tablEID'];
$subjectData = DB::fetch_all("SELEct attachment from pre_forum_attachment_$subject_tablEID where tid= '$tid'");
$thread['subjectimage'] = $subjectData;
然后实现最终效果
# 主题图片
$subjectimage = DB::fetch_all("SELEct * from pre_forum_attachment where tid= '$tid' limit 1");
$subject_tablEID = $subjectimage[0]['tablEID'];
$subjectData = DB::fetch_all("SELEct attachment from pre_forum_attachment_$subject_tablEID where tid= '$tid'");
$thread['subjectimage'] = $subjectData;
这几个功能是咔咔呕心沥血的折腾了半天才弄出来,网上的文章对于discuz大多数只是停留在后台的功能上,对于模板的二开文章很好。所以咔咔会在这方面给大家奉上一些解决方案,希望可以帮助到大家。
以上是大佬教程为你收集整理的Discuz如何解决手机端图片显示模糊全部内容,希望文章能够帮你解决Discuz如何解决手机端图片显示模糊所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。