php专区

 首页 > php专区 > PHP应用 > CMS建站 > dedecms列表页上一页下一页翻页单独调用 - DeDecm

dedecms列表页上一页下一页翻页单独调用 - DeDecm

分享到:
【字体:
导读:
          我用织梦dedecms实现列表页上一页下一页翻页单独调用的方法,在列表页单独调用上一页和下一页,以及首页,简单搞了一下,仅作上下翻页,主页类似,可自行添加...

dedecms列表页上一页下一页翻页单独调用

我用织梦dedecms实现列表页上一页下一页翻页单独调用的方法

在列表页单独调用上一页和下一页,以及首页,简单搞了一下,仅作上下翻页,主页类似,可自行添加

在模板中以

  1. {dede:pagelist listitem="up"/}  
  2. {dede:pagelist listitem="down"/} 

来调用、

修改办法如下

includearc.listview.class.php

找到:

  1. /获得上一页和主页的链接  
  2.         if($this->PageNo != 1)  
  3.         {  
  4.             $prepage.="<li>上一页rn";  
  5.             $indexpage="<li>首页rn";  
  6.              
  7.       $uppage.="<a href='".str_replace("{page}",$prepagenum,$tnamerule)."'>上一页rn";  
  8.         }  
  9.         else 
  10.         {  
  11.             $indexpage="<li>首页rn";  
  12.        $uppage.="<a>没有了</a>rn";  
  13.         }  
  14.  
  15.         //下一页,未页的链接  
  16.         if($this->PageNo!=$totalpage && $totalpage>1)  
  17.         {  
  18.             $nextpage.="<li><a href='".str_replace("{page}",$nextpagenum,$tnamerule)."'>下一页rn";  
  19.             $endpage="<li><a href='".str_replace("{page}",$totalpage,$tnamerule)."'>末页rn";  
  20.  
  21.         $downpage.="<a href='".str_replace("{page}",$nextpagenum,$tnamerule)."'>下一页rn";  
  22.         }  
  23.         else 
  24.         {  
  25.             $endpage="<li>末页rn";  
  26.         $downpage.="<a>没有了rn";  
  27.         }  

然后:

  1. $plist = '';
  2. if(preg_match('/up/i'$listitem)) $plist .= $uppage;  
  3. if(preg_match('/down/i'$listitem)) $plist .= $downpage;  
  4.     if(preg_match('/index/i'$listitem)) $plist .= $indexpage;  
  5.     if(preg_match('/pre/i'$listitem)) $plist .= $prepage;  
  6.     if(preg_match('/pageno/i'$listitem)) $plist .= $listdd;  
  7.     if(preg_match('/next/i'$listitem)) $plist .= $nextpage;  
  8.     if(preg_match('/end/i'$listitem)) $plist .= $endpage;  
  9.     if(preg_match('/option/i'$listitem)) $plist .= $optionlist;  
  10.     if(preg_match('/info/i'$listitem)) $plist .= $maininfo
分享到:
dedecms php.ini register_globals must ...
dedecms php.ini register_globals must is Off dedecms出现如下错误:dedecms php.ini register_globals must is Off 办法直接去 include/common.inc.php教程中将如下代码删除。 //禁止 session.auto_start  if ( ini_get(&#039;session.auto_start&#039;) != 0 )  {  ...
DedeCMS Error Warning!修改及解决方法 -...
DedeCMS Error Warning!修改及解决方法 DEDE提示信息: DedeCMS Error Warning! Technical Support: http://bbs.dedecms.com Error page: /dede/ Error infos: DedeCms错误警告:连接数据库失败,,可能数据库密码不对或数据库服务器出错! DedeCMS Error Warning!修改及解决方法: 有时候...
  •         php迷,一个php技术的分享社区,专属您自己的技术摘抄本、收藏夹。
  • 在这里……