💎一站式轻松地调用各大LLM模型接口,支持GPT4、智谱、星火、月之暗面及文生图 广告
# 织梦插件/底层标签开发 include/datalistcp.class.php 动态分页类 DEDEINC 输出include路径:D:/www/dedecms/include 加载模板 include DedeInclude('templets/flash\_edit.htm'); DEDEROOT 织梦根目录 D:/www/wdcms 打包加入菜单 ``` <pre class="calibre14">``` 安装 Delete From `#@__plus` where plusname<span class="token">=</span> <span class="token4">'广告管理插件'</span><span class="token2">;</span> INSERT INTO `#@__plus` <span class="token2">(</span>`plusname`<span class="token2">,</span> `menustring`<span class="token2">,</span> `mainurl`<span class="token2">,</span> `writer`<span class="token2">,</span> `isshow`<span class="token2">,</span> `filelist`<span class="token2">)</span> VALUES <span class="token2">(</span><span class="token4">'广告管理插件'</span><span class="token2">,</span> <span class="token4">'<m:item name='</span><span class="token4">'广告管理插件'</span><span class="token4">' link='</span><span class="token4">'yoby_ad_main.php'</span><span class="token4">' rank='</span><span class="token4">'plus_广告管理插件'</span><span class="token4">' target='</span><span class="token4">'main'</span><span class="token4">' />'</span><span class="token2">,</span> <span class="token4">''</span><span class="token2">,</span> <span class="token4">'Yoby'</span><span class="token2">,</span> <span class="token3">1</span><span class="token2">,</span> <span class="token4">''</span><span class="token2">)</span><span class="token2">;</span> 卸载 Delete From `#@__plus` where plusname<span class="token">=</span> <span class="token4">'广告管理插件'</span><span class="token2">;</span> ``` ``` 动态分页类使用 ``` <pre class="calibre16">``` <span class="token1">require_once</span><span class="token2">(</span><span class="token1">dirname</span><span class="token2">(</span>__FILE__<span class="token2">)</span><span class="token2">.</span><span class="token4">"/include/common.inc.php"</span><span class="token2">)</span><span class="token2">;</span><span class="token6">//载入基础文件</span> <span class="token1">require_once</span><span class="token2">(</span>DEDEINC<span class="token2">.</span><span class="token4">"/datalistcp.class.php"</span><span class="token2">)</span><span class="token2">;</span><span class="token6">//载入动态分页类</span> $dl <span class="token">=</span> <span class="token5">new</span> <span class="token1">DataListCP</span><span class="token2">(</span><span class="token2">)</span><span class="token2">;</span> $dl<span class="token">-</span><span class="token">></span>pageSize <span class="token">=</span> <span class="token3">25</span><span class="token2">;</span> <span class="token6">//设定每页显示记录数(默认25条) </span> $dl<span class="token">-</span><span class="token">></span><span class="token1">SetParameter</span><span class="token2">(</span>tid<span class="token2">,</span>$tid<span class="token2">)</span><span class="token2">;</span> $dl<span class="token">-</span><span class="token">></span><span class="token1">SetTemplate</span><span class="token2">(</span>DEDETEMPLATE<span class="token2">.</span><span class="token4">'/'</span><span class="token2">.</span>$cfg_df_style<span class="token2">.</span><span class="token4">'/list.htm'</span><span class="token2">)</span><span class="token2">;</span><span class="token6">//载入模板 </span> $dl<span class="token">-</span><span class="token">></span><span class="token1">SetSource</span><span class="token2">(</span>$sql<span class="token2">)</span><span class="token2">;</span><span class="token6">//设定查询SQL </span> $dl<span class="token">-</span><span class="token">></span><span class="token1">Display</span><span class="token2">(</span><span class="token2">)</span><span class="token2">;</span> 模板中 <span class="token2">{</span>dede<span class="token2">:</span>datalist<span class="token2">}</span> <span class="token"><</span>li<span class="token">></span><span class="token2">{</span>field<span class="token2">.</span>fieldname1<span class="token">/</span><span class="token2">}</span> <span class="token">-</span> <span class="token2">{</span>field<span class="token2">.</span>fieldname2<span class="token">/</span><span class="token2">}</span><span class="token"><</span><span class="token">/</span>li<span class="token">></span> <span class="token2">{</span><span class="token">/</span>dede<span class="token2">:</span>datalist<span class="token2">}</span> <span class="token2">{</span>tag<span class="token2">:</span>pagelist listitem<span class="token">=</span><span class="token4">"info,index,end,pre,next,pageno"</span> listsize<span class="token">=</span><span class="token4">"5"</span><span class="token">/</span><span class="token2">}</span> ``` ```