轻松一夏 發表於 2024-2-20 00:00:00

dedecms首页调用专题页描述和链接的实现方法

<p style='margin: 0px; padding: 5px 0px; outline: none; font-size: 14px; line-height: 30px; font-family: tahoma, arial, "Microsoft YaHei";'>
        本文实例讲述了dedecms首页调用专题页描述和链接的实现方法。分享给大家供大家参考。具体分析如下:</p>
<p style='margin: 0px; padding: 5px 0px; outline: none; font-size: 14px; line-height: 30px; font-family: tahoma, arial, "Microsoft YaHei";'>
        因为最近做的站用到专题页,首页调用专题页的描述,找了一些方法都是不成功,后来请一个数据库高手给我写了个sql语句,发现问题原来是出在sql语句上,自己写的语句太过繁琐,而且容易出错,弄了好几天,终于写出来了,先分享给大家,希望能给有此问题的朋友解解疑惑.<br>
         </p>
<div class="msgheader" style='margin: 3px auto 0px; padding: 0px 3px; outline: none; line-height: 21.6px; clear: both; border-width: 1px; border-style: solid; border-color: rgb(0, 153, 204); background: rgb(246, 251, 255); overflow: hidden; font-family: tahoma, arial, "Microsoft YaHei";'>
        <div class="right">
                <span><u>复制代码</u></span>
</div>
        代码如下:</div>
<div class="msgborder" id="phpcode11" style='margin: 0px auto 3px; padding: 0px 3px; outline: none; line-height: 25.2px; font-size: 14px; clear: both; border-right: 1px solid rgb(0, 153, 204); background: rgb(221, 237, 251); overflow: hidden; border-left: 1px solid rgb(0, 153, 204); word-break: break-all; border-bottom: 1px solid rgb(0, 153, 204); word-wrap: break-word; font-family: tahoma, arial, "Microsoft YaHei";'>
        {dede:arclist id=11 row=1 channelid="-1" type="spec." } <br>
         <br>
        global $dsql; <br>
        @me =@me['id']; <br>
        $sql = "select t.description from dede_addonspec a, dede_archives t where a.aid=t.id and t.id=11"; <br>
        $dsql-&gt;Execute('a',$sql); <br>
        $one = $dsql-&gt;GetArray('a'); <br>
        @me =substr(Html2Text($one['description']),0,660); <br>
        ... <br>
         <br>
        {/dede:arclist}</div>
<p style='margin: 0px; padding: 5px 0px; outline: none; font-size: 14px; line-height: 30px; font-family: tahoma, arial, "Microsoft YaHei";'>
         </p>
<p style='margin: 0px; padding: 5px 0px; outline: none; font-size: 14px; line-height: 30px; font-family: tahoma, arial, "Microsoft YaHei";'>
        希望本文所述对大家的dedecms建站有所帮助。</p>
頁: [1]
查看完整版本: dedecms首页调用专题页描述和链接的实现方法