我要追求梦想 發表於 2024-2-15 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";'>
        dedecms软件及分类信息的采集方法:这几天正苦恼分类信息该如何采集,今天无意中看了后台登录目录dede/templets/co_add_step0.htm这个文件,看看有没有什么,因为采集的第一次选择类型就是这个模板嘛。看来看去没发现什么,最终看到这么一段代码:<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="phpcode14" 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";'>
        &lt;?php <br>
        $dsql-&gt;SetQuery("Select id,typename From `dede_channeltype` where id in(1,2) order by id asc "); <br>
        $dsql-&gt;Execute(); <br>
        while($row = $dsql-&gt;GetObject()) <br>
        { <br>
        echo "&lt;option value='http://www.jb51.net/cms/{$row-&gt;id}'&gt;{$row-&gt;typename}&lt;/option&gt;\r\n"; <br>
        } <br>
        ?&gt;</div>
<br style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'><span style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'>我看了一下,1,2分类代表的是文章和图集,没有分类信息,于是报着试试看的心情把分类信息ID(-8)写在了后面,测试采集,居然成功了.配置里面完完整整是分类信息的参数.太兴奋了,同理,软件的应该也一样,我测试了一下,结果一点错都没有</span><br style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'><br style='font-family: tahoma, arial, "Microsoft YaHei"; font-size: 14px;'><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="phpcode15" 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";'>
        &lt;?php <br>
        $dsql-&gt;SetQuery("Select id,typename From `dede_channeltype` where id in(1,2,3,-8) order by id asc "); <br>
        $dsql-&gt;Execute(); <br>
        while($row = $dsql-&gt;GetObject()) <br>
        { <br>
        echo "&lt;option value='http://www.jb51.net/cms/{$row-&gt;id}'&gt;{$row-&gt;typename}&lt;/option&gt;\r\n"; <br>
        } <br>
        ?&gt;</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软件源码及分类信息采集功能的方法