返回列表 发帖
查看: 14|回复: 0

[技术交流] X5搜索不显示图片AI解决办法

7

主题

20

回帖

1

粉丝

初学乍练

贡献
0 点
金币
6 个
发表于 1 小时前 |四川| 查看全部 |阅读模式
X5搜索不显示图片AI解决办法,声明我不是专业的哈,替换文件自行备份
/template/default/search/thread_list.php
原始代码(第28-28行)

  1. <p><!--{if !$thread['price'] && !$thread['readperm']}-->$thread[message]<!--{else}-->{lang thread_list_message1}<!--{/if}--></p>
  2. <p>
  3.     <span>$thread[dateline]</span>
复制代码
修改后代码(第28-57行),默认是5张,自己要几张把5改成几就是了
  1. <p><!--{if !$thread['price'] && !$thread['readperm']}-->$thread[message]<!--{else}-->{lang thread_list_message1}<!--{/if}--></p>

  2. <!--{eval $thumbs = DB::fetch_all("SELECT aid,attachment FROM ".DB::table('forum_attachment_'.substr($thread['tid'],-1,1))." WHERE tid='".$thread['tid']."' and width>100 and isimage=1 order by dateline asc LIMIT 0,5");}-->
  3. <!--{if $thumbs}-->
  4. <div class="thread-imglist">
  5.     <!--{loop $thumbs $thumb}-->
  6.     <!--{eval $imagethumb = getforumimg($thumb['aid'], 0, 120, 90);}-->
  7.     <a href="forum.php?mod=viewthread&tid=$thread[tid]&highlight=$index[keywords]" target="_blank" $thread[highlight]>
  8.         <img src="$imagethumb" alt="" onerror="this.parentNode.style.display='none'" />
  9.     </a>
  10.     <!--{/loop}-->
  11. </div>
  12. <!--{/if}-->

  13. <p>
  14.     <span>$thread[dateline]</span>
  15.     ...
  16. </p>
  17. <style>
  18. .thread-imglist { margin: 8px 0; overflow: hidden; }
  19. .thread-imglist a { display: inline-block; margin: 0 6px 6px 0; width: 100px; height: 75px; overflow: hidden; border-radius: 4px; }
  20. .thread-imglist img { width: 100%; height: 100%; object-fit: cover; }
  21. </style>
复制代码
截图202605161236013307.jpg





回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

  • 关注公众号
  • 有偿服务微信
  • 有偿服务QQ

手机版|小黑屋|Discuz! 官方交流社区 ( 皖ICP备16010102号 |皖公网安备34010302002376号 )|网站地图|star

GMT+8, 2026-5-16 14:20 , Processed in 0.050820 second(s), 11 queries , Redis On.

Powered by Discuz! X5.0 Licensed

© 2001-2026 Discuz! Team.

关灯 在本版发帖
有偿服务QQ
有偿服务微信
返回顶部
快速回复 返回顶部 返回列表