discuz 个人空间主题列表图片显示
修改:/source/language/home/lang_template.php
复制代码
如果需要实现该呈现方式,我们需要首先了解discuz封面图片存储原理:
文件路径:/source/function/function_forum.php
修改:/template/default/home/space_thread.htm
添加like 喜欢或查看
封面图片存储路径格式:data/attachment/forum/threadcover/43/ec/81.jpg
实现方法:
{eval
$covername = 'threadcover/'.substr(md5($thread[tid]), 0, 2).'/'.substr(md5($thread[tid]), 2, 2).'/'.$thread[tid].'.jpg';
$coverpath = ($cover < 0 ? $_G['setting']['ftp']['attachurl'] : $_G['setting']['attachurl']).'forum/'.$covername;
}
<li style="width: 227px; left: 0px; top: 0px;float:left;">
<div class="c cl">
<a class="z" title="$thread[subject]" onclick="atarget(this)" href=http://www.ym97.com/discuz/"forum.php?mod=viewthread&tid=$thread[tid]">
<img width="203" alt="$thread[subject]" src=http://www.ym97.com/discuz/"{eval echo $coverpath;}">
</a>
</div>
<h3 class="xw0">
<a href=http://www.ym97.com/discuz/"forum.php?mod=viewthread&tid=$thread[tid]" onclick="atarget(this)" target="_blank" {if $thread['displayorder'] == -1}class="recy"{/if}>$thread[subject]</a>
</h3>
<div class="auth cl">
<cite class="xg1 y">
{lang like}: <em>$thread[views]</em> {lang reply}: <a title="0回复" href=http://www.ym97.com/discuz/"forum.php?mod=viewthread&tid=$thread[tid]">$thread[replies]</a>
</cite>
<a href=http://www.ym97.com/discuz/"home.php?mod=space&uid=$thread[authorid]" target="_blank">$thread[author]</a>$thread[dateline]</div>
</li>
getthreadcover 函数:
function getthreadcover($tid, $cover = 0, $getfilename = 0) {
global $_G;
if(emptyempty($tid)) {
return '';
}
$coverpath = '';
$covername = 'threadcover/'.substr(md5($tid), 0, 2).'/'.substr(md5($tid), 2, 2).'/'.$tid.'.jpg';
if($getfilename) {
return $covername;
}
if($cover) {
$coverpath = ($cover < 0 ? $_G['setting']['ftp']['attachurl'] : $_G['setting']['attachurl']).'forum/'.$covername;
}
return $coverpath;
}
discuz没有将主题列表封面路径存在数据表中,只是在pre_forum_thread表中存了一个cover标识。然后用getthreadcover 函数调取,diy调用的图片也会产生缩略图,可以设置缩略图的质量。
相关热词: discuz
本站内容来源于网络,如有侵权请与我们联系,我们会及时删除,我们深感抱歉!
注:本站所有信息仅供用于网络技术学习参考,学习中请遵循相关法律法规!
本文地址: https://www.juheyunku.com/jz/discuz/2334.shtml
相关文章
热门TAG
命令 权重 外链 企业网站 白帽 php 织梦教程 dedecms修改内容 javascript 织梦 功能 标签 调用 详解 服务器 网站流量 实例解析 Dedecms 织梦cms HTML tags标签 python jquery教程 jquery windows SEO优化 蜘蛛 搜索引擎 网站收录 JSP最新文章
-
Discuz x2.5 伪静态规则成功
时间:2020-12-29
-
discuz X2正式版forum首页的
时间:2020-12-27
-
Discuz伪静态 配置搜索引擎
时间:2020-12-26
-
Discuz登录后总是显示未登
时间:2020-12-23
-
怎么换云服务器? Discuz论坛
时间:2020-12-23
-
Discuz!7.0主题回收站功能详
时间:2020-12-23
-
discuz 修改创始人密码、管
时间:2020-12-23
-
discuz论坛用户通过邮件验
时间:2020-12-23
热门文章
-
去掉discuz列表页的最新公告_Discuz模板开发
时间:2020-12-13
-
修改discuz X3.2论坛标题80个字符的长度限制
时间:2020-12-14
-
discuz 修改创始人密码、管理员登录密码的
时间:2020-12-23
-
discuz主题内容页面的打印按钮代码
时间:2020-12-13
-
Discuz!7.0主题回收站功能详解
时间:2020-12-23
-
footer.htm底部文件$_G['setting']['icp']、{if $
时间:2020-12-13
-
discuz教程_discuz视频教程_discuz论坛模板制
时间:2020-12-14
-
$article['related']Discuz 门户文章内容页的相
时间:2020-12-13
-
discuz教程_discuz视频教程_discuz论坛模板制
时间:2020-12-14
-
Discuz教程:使用微信登陆出现“目前无法
时间:2020-12-15
