公告:魔扣目录网为广大站长提供免费收录网站服务,提交前请做好本站友链:【 网站目录:https://www.morko.net 】, 免友链快审服务(50元/站),

点击这里在线咨询客服
新站提交
  • 网站:51998
  • 待审:31
  • 小程序:12
  • 文章:1030137
  • 会员:747

discuz X3空间主题列表 图片展现模式,discuz实现个人空间主题列表调用图片模式,discuz home图片列表 

如果需要实现该呈现方式,我们需要首先了解discuz封面图片存储原理:

discuz没有将主题列表封面路径存在数据表中,只是在pre_forum_thread表中存了一个cover标识。然后用getthreadcover 函数调取,diy调用的图片也会产生缩略图,可以设置缩略图的质量。

封面图片存储路径格式:data/attachment/forum/threadcover/43/ec/81.jpg

getthreadcover 函数:

 function getthreadcover($tid, $cover = 0, $getfilename = 0) {
  global $_G;
  if(empty($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;
}
文件路径:/source/function/function_forum.php

实现方法:

修改:/source/language/home/lang_template.php

添加like 喜欢或查看

修改:/template/default/home/space_thread.htm

处理封面图:

{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]" οnclick="atarget(this)" href="forum.php?mod=viewthread&tid=$thread[tid]">
  <img width="203" alt="$thread[subject]" src="{eval echo $coverpath;}">
  </a>
  </div>
  <h3 class="xw0">

  <a href="forum.php?mod=viewthread&tid=$thread[tid]" οnclick="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="forum.php?mod=viewthread&tid=$thread[tid]">$thread[replies]</a>
  </cite>
  <a href="home.php?mod=space&uid=$thread[authorid]" target="_blank">$thread[author]</a>$thread[dateline]</div>
</li>

分享到:
标签:个人空间 主题列表 图片 方法 模式
用户无头像

网友整理

注册时间:

网站:5 个   小程序:0 个  文章:12 篇

  • 51998

    网站

  • 12

    小程序

  • 1030137

    文章

  • 747

    会员

赶快注册账号,推广您的网站吧!
最新入驻小程序

数独大挑战2018-06-03

数独一种数学游戏,玩家需要根据9

答题星2018-06-03

您可以通过答题星轻松地创建试卷

全阶人生考试2018-06-03

各种考试题,题库,初中,高中,大学四六

运动步数有氧达人2018-06-03

记录运动步数,积累氧气值。还可偷

每日养生app2018-06-03

每日养生,天天健康

体育训练成绩评定2018-06-03

通用课目体育训练成绩评定