<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                合規國際互聯網加速 OSASE為企業客戶提供高速穩定SD-WAN國際加速解決方案。 廣告
                ## sp_article (文章列表) > sp_article 函數 是 sp_list 函數的簡化版 >[info] 語法:sp\_article($columnid,?$parentid,?$number,?$options) > 參數:$columnid (必填) > 參數:$cateid (選填 默認:0) > 參數:$number (選填 默認:0) > 參數:options(選填 數組) > 返回值:數組 **調用方法** ``` 方法?1:{assign?name="list"?value=":sp_article(13)"}?? 說明:獲取?columnid=13?所有文章 方法?2:{assign?name="list"?value=":sp_article(13,?8)"}?? 說明:獲取?columnid=13?and?cateid=8?所有文章 方法?3:{assign?name="list"?value=":sp_article(13,?8,?10)"}?? 說明:獲取?columnid=13?and?cateid=8?前?10?條文章 方法?4:{assign?name="list"?value=":sp_article(13,?0,?10)"}?? 說明:獲取?columnid=13?前?10?條文章 方法5:{assign name="list" value=":sp_article(13, 0, 10, ['pageurl'=>'/news-p[page]'])"} 說明:獲取 columnid = 13 的文章,每頁顯示 10 條,分頁地址:/news-p[page] 備注:分頁地址里面 [page] 參考是必須的。分頁地址后面不需要加 .html 系統函數會自動添加。 ``` 使用?php?直接調用: ``` 方法?1:<?php $list?=?sp_article(13); ?> 方法?2:<?php $list?=?sp_article(13,?8); ?> 方法?3:<?php $list?=?sp_article(13,?8,?10); ?>?? 方法?4:<?php $list?=?sp_article(13,?0,?10); ?> 方法 5:<?php $list = sp_article(13, 0, 10, ['pageurl'=>'/news-p[page]']); ?> 方法 6:復雜功能(文章分頁,啟用自定義參數字段,文章列表里調用分類名稱) <?php $option = [ 'where' => 'wsarticle_columnid = 13 and wsarticle_recommend = 1', // 啟用自定義搜索功能(只顯示推薦文章) 'order' = > 'wsarticle_id desc', // 啟用自定義分類 'pageurl' => '/news-p[page]', // 啟用分頁功能 'cate' => true, // 啟用分類顯示 'param' => true, // 啟用自定義參數 ]; $list = sp_article(13, 0, 10, $option); ?> ``` 案例?1: ``` <?php //?$options?數組的內容都是選填。 $options?=?[ //?定義?where?參數后,$columnid,?$cateid?這二個參數將會自動失效 'where'?=>??'wsarticle_columnid?=?10?and?find_in_set(5,?wsarticle_cateid)', //?排序方式?不填寫按默認方式排序 'order'?=>?'wsarticle_sort?asc', //?不設置該參數將不分頁 'pageurl'?=>?'/news-p[page]', //?分類信息,true?時可以在列表中調用分類信息 'cate'?=>?false, //?自定義信息,true?時可以在列表中調用自定義字段 'param'?=>?false, ]; //?獲取?columnid?=?10?and?cateid?=?5?的數據,每頁?10?條數據。 //?生成的?url?為?/news-p1.html,/news-p2.html,/news-p3.html $list?=?sp_article(0,?0,?10,?$options); ?> // 循環打印出文章列表 {volist name="list" id="vo"} <div>新聞ID:$vo['wsarticle_id']</div> <div>新聞標題:$vo['wsarticle_title']</div> {/volist} // 顯示分頁 {$list->render()} ``` 案例?2:演示使用?where?參數?不分頁 ``` <?php $options?=?[ 'where'?=>??'wsarticle_columnid?=?10?and?find_in_set(5,?wsarticle_cateid)', 'order'?=>?'wscate_sort?asc', ]; //?獲取?columnid?=?10?and?cateid?=?5?的所有數據。 $list?=?sp_article(0,?0,?0,?$options); ?> ``` 案例?3:演示欄目分頁 ``` <?php $options?=?[ 'pageurl'?=>?'/news-p[page]',?//?分頁?url?地址?[page]?為必須 ]; $list?=?sp_article(10,?0,?12,?$options); //?或者簡化成以下方式調用 $list?=?sp_article(10,?0,?12,?['pageurl'=>'/news-p[page]']); ?> ``` 案例?4:演示欄目分類分頁 ``` <?php $options?=?[ ?'pageurl'?=>?'/news/industry-news-5-p[page]',?//?分頁?url?地址?[page]?為必須 ]; //?獲取?columnid?=?10?and?cateid?=?5?的數據,每頁?10?條數據。 //?生成的?url?為?/news/industry-news-5-p1.html,/news/industry-news-5-p2.html $list?=?sp_article(10,?5,?10,?$options); ?> ``` 案例?5:搜索分頁功能 ``` <?php $keywords?=?'關鍵詞'; $options?=?[ 'where'?=>?"wsarticle_columnid?=?10?and?wsarticle_title?like?'%".$keywords."%'", 'pageurl'?=>?'/news/industry-news-5-p[page]',?//?分頁?url?地址?[page]?為必須 ]; //?獲取?columnid?=?10?and?cateid?=?5?的數據,每頁?10?條數據。 //?生成的?url?為?/news/industry-news-5-p1.html,/news/industry-news-5-p2.html $list?=?sp_article(10,?5,?10,?$options); ?> ``` **實際案例** ``` <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>{$site_home} - {$site_title}</title> <meta name="keywords" content="{$site_keywords}"> <meta name="description" content="{$site_description}"> </head> <body> <h1>分類列表展示</h1> {assign name="list" value=":sp_article(100)"} {volist name="list" id="vo"} <div><a href="{:url('/news/'.$vo['wsarticle_id'])}">{$vo['wsarticle_title']}</a></div> {/volist} // 分頁顯示 {$list->render()} </body> </html> ``` **支持字段** >[success] 標題:wsarticle\_title > 分類 ID:wsarticle\_cateid > ~~靜態頁面:wsarticle\_page~~ > 簡介:wsarticle\_desc > 關鍵詞:wsarticle\_keywords > 描述:wsarticle\_description > ~~內容:wsarticle\_details~~ > 圖片:wsarticle\_image (使用 getimg 函數調用) > 文件:wsarticle\_file > 瀏覽量:wsarticle\_views > 作者:wsarticle\_author > 來源:wsarticle\_source > 發布時間:wsarticle\_create\_time > 需要更多字段請查看數據表 site_wsarticle
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看