DEDECMS上一篇下一篇解决方案-按发布时间排序(pubdate)

修改 dede/include/inc_archives_view.php

最下面两行是原来的,注掉,加入我上面添加的部分, 如果需要在管理文档时也按PUBDATE排序请修改相关文档 content_list.htm, content_list.php.

//add by 沙加 QQ5364241
          $des_arc = $this->dsql->GetOne("Select arc.pubdate from `{$this->MainTable}` arc where arc.ID='$aid'");
          $des_pubdate = $des_arc['pubdate'];
           $next = " arc.pubdate>'$des_pubdate' And arc.arcrank>-1 And typeid='{$this->Fields['typeid']}' order by arc.pubdate asc ";
           $pre = " arc.pubdate<'$des_pubdate' And arc.arcrank>-1 And typeid='{$this->Fields['typeid']}' order by arc.pubdate desc ";
//end add

           //$next = " arc.ID>'$aid' And arc.arcrank>-1 And typeid='{$this->Fields['typeid']}' order by arc.ID asc ";
           //$pre = " arc.ID<'$aid' And arc.arcrank>-1 And typeid='{$this->Fields['typeid']}' order by arc.ID desc ";

posted on 2008-12-01 22:35  沙加  阅读(2061)  评论(0编辑  收藏  举报

导航