按照mysql数据库中的表进行调试了(如果你安装在不同的数据库,需要在sql中指定数据库,我这边是ultrax ,与公司的织梦dedecms不是安装在同库中),不断调试,失败了几次后,调试出来代码了,现在分享在这边,为了方便自己以后浏览。
调用图文帖子的方法:
{dede:sql sql="SELECT ultrax.pre_forum_threadimage.tid, ultrax.pre_forum_threadimage.attachment, ultrax.pre_forum_thread.tid, ultrax.pre_forum_thread.fid, ultrax.pre_forum_thread.subject FROM ultrax.pre_forum_threadimageLEFT JOIN ultrax.pre_forum_thread ON ultrax.pre_forum_thread.tid = ultrax.pre_forum_threadimage.tid WHERE displayorder >=0 LIMIT 0 , 2"} <li><A href="/bbs/forum.php?mod=viewthread&tid=[field:tid /]"><IMG src="bbs/data/attachment/forum/[field:attachment/]" width="153px" height="100px"></A></li> <li><A href="/bbs/forum.php?mod=viewthread&tid=[field:tid /]">[field:subject function="cn_substr('@me',28)" /]</A></li> {/dede:sql} |