Home > Backend Development > PHP Tutorial > 关于dede 5.7 调用discuz x2.5 贴子图片的有关问题

关于dede 5.7 调用discuz x2.5 贴子图片的有关问题

WBOY
Release: 2016-06-13 10:31:41
Original
927 people have browsed it

关于dede 5.7 调用discuz x2.5 贴子图片的问题
dede 5.7 调用discuz x2.5 贴子图片的问题

HTML code
<!--Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->{dede:loop table="pre_forum_thread" fid="2″sort="tid" row="10"}<a href="/bbs/forum.php?mod=viewthread&tid=%5Bfield:tid%20/%5D"><img src="/bbs/attachments/%5Bfield:attachments/%5D" alt="[field:subject/]"    style="max-width:90%"  style="max-width:90%" border="0"></a>{/dede:loop}
Copy after login


这段成功代码调用了 指定版块ID2 的贴子,但贴子的封面图片没被调用成功,图片的alt调用成了(alt="[field:subject/]") 。


关于dede 5.7 调用discuz x2.5 贴子图片的有关问题


------解决方案--------------------
得进行关联查询 pre_forum_thread表中是没有图片路径的
{dede:sql sql="SELECT`cdb_attachments`.`aid`,`cdb_attachments`.`attachment`,`cdb_threads`.`tid`, `cdb_threads`.`fid`,`cdb_threads`.`subject` FROM `cdb_attachments` LEFT JOIN `cdb_threads` 
ON`cdb_threads`.`tid`=`cdb_attachments`.`tid` WHERE `cdb_attachments`.`readperm`='0' AND`displayorder`>='0' AND `filetype`='image/pjpeg' GROUP BY tid LIMIT 0,1 "} 
 
[field:subject/] 
 
{/dede:sql} 你参考下
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template