婷婷综合国产,91蜜桃婷婷狠狠久久综合9色 ,九九九九九精品,国产综合av

主頁 > 網站建設 > 建站知識 > 織夢模板DEDECMS的首頁調用問答模塊內容的教程

織夢模板DEDECMS的首頁調用問答模塊內容的教程

POST TIME:2021-05-23 02:12

利用SQL來實現,以下是我的源碼,要根據你的數據庫表名自行改動:
{dede:sql sql="select as_ask.id,as_ask.title,as_askanswer.content from as_ask LEFT JOIN as_askanswer on as_ask.id=as_askanswer.askid where as_askanswer.ifanswer=1 and as_askanswer.ifcheck=1 or as_ask.bestanswer=as_askanswer.id order by as_ask.id desc LIMIT 0,1"}<br /><strong>問:</srtong><a href="/ask/question.php?id=[field:id/]" class="link3">[field:title function=cn_substr(@me,46)/]</a><br /><p><strong>答:</srtong>[field:content function=cn_substr(html2text(@me),40)/],...<a href="/ask/question.php?id=[field:id/]" class="link2">詳情>></a></p><br />{/dede:sql}
放在首頁任意位置調用就可以了。
里面調用條數,長度,可以根據自己的需求進行調整 。
可在在全局標記測試效果。
 如果需要分欄目調用,那么加入as_ask.tid2=XX,如我的整形欄目為as_ask.tid2=7,調用如下:
{dede:sql sql="select as_ask.id,as_ask.title,as_askanswer.content from as_ask LEFT JOIN as_askanswer on as_ask.id=as_askanswer.askid and as_ask.tid2=7 where as_askanswer.ifanswer=1 and as_askanswer.ifcheck=1 or as_ask.bestanswer=as_askanswer.id order by as_ask.id desc LIMIT 0,1"}<br /><strong>問:</srtong><a href="/ask/question.php?id=[field:id/]" class="link3">[field:title function=cn_substr(@me,46)/]</a><br /><p><strong>答:</srtong>[field:content function=cn_substr(html2text(@me),40)/],...<a href="/ask/question.php?id=[field:id/]" class="link2">詳情>></a></p><br />{/dede:sql}
 


收縮
  • 微信客服
  • 微信二維碼
  • 電話咨詢

  • 400-1100-266
主站蜘蛛池模板: 佛坪县| 丰原市| 通辽市| 石阡县| 高唐县| 富蕴县| 平顶山市| 四川省| 宁强县| 安国市| 尖扎县| 洪泽县| 奉贤区| 临高县| 邯郸县| 红河县| 龙泉市| 花莲市| 田东县| 龙山县| 应城市| 镇巴县| 临清市| 大化| 呼和浩特市| 炎陵县| 晋州市| 景德镇市| 海阳市| 南汇区| 南乐县| 赤城县| 于都县| 砀山县| 信丰县| 浑源县| 新蔡县| 石林| 龙山县| 土默特右旗| 广丰县|