Discuz教程网

discuz PHP分页修改问题

[复制链接]
authicon leeepine 发表于 2016-8-9 23:57:06 | 显示全部楼层 |阅读模式
062027wxeezwqici2j4w22.png









062027e3lo3rrldrr6dd6r.png


如图我想把这个分页修改成下面图片中的样子 还望大神帮忙一下






062027teicgvklki49i8vk.png



  1. <?php

  2. if(!defined('IN_DISCUZ')) {exit('Access Denied');}

  3. $perpage = 3;                        //每页显示数
  4. $forumids = array(2,45);        //指定调用的版块ID,如果调用全部,请用array(),如$forumids = array();
  5. $orderby = 'dateline desc';        //排序方式
  6. $threadlist = $post = array();

  7. if ($forumids){
  8.         $filterarr = array('inforum' => $forumids, 'sticky' => 0, 'displayorder' => array(0, 1, 2, 3, 4));
  9.         $count = C::t('forum_thread')->count_search($filterarr, 0);
  10.         $page = intval($_G['page']) ? intval($_G['page']) : 1;
  11.         $start = ($page-1)*$perpage;
  12.         if($start<0) $start = 0;
  13.         if ($count){
  14.                 require_once libfile('function/post');
  15.                 foreach(C::t('forum_thread')->fetch_all_search($filterarr, 0, $start, $perpage, $orderby, '') as $thread) {
  16.                         $thread['post'] = C::t('forum_post')->fetch_threadpost_by_tid_invisible($thread['tid']);
  17.                         $attachment = C::t('forum_attachment_n')->fetch_max_image(getattachtableid($tid), 'pid', $thread['post']['pid']);
  18.                         $thread['aid'] = $attachment['aid'];
  19.                         $threadlist[] = $thread;
  20.                 }
  21.                 $allpages = @ceil($count / $perpage);
  22.                 if ($page > 1){$lastpage = $page-1;}
  23.                 if ($page < $allpages){$nextpage = $page+1;}
  24.         }
  25. }


  26. ?>
复制代码


这是源文件


  1. <div style="margin-top:20px;" class="wp1024 mbw cl">

  2. <p class="{if $lastpage && $nextpage}fd_page2{else}fd_page1{/if}">

  3. <!--{if $lastpage}--><a class="fd_last" href="forum.php?page=$lastpage"></a><!--{/if}-->

  4. <!--{if $nextpage}--><a class="fd_next" href="forum.php?page=$nextpage"></a><!--{/if}-->

  5. </p>

  6. </div>
复制代码





这是输出文件    求大神帮忙改一下



上一篇:柒瑞分类信息墙 5.5 价值489元(2016.08.09更新)
下一篇:Discuz教程网签到记录贴-2016年8月10日
authicon jy4193217 发表于 2016-10-21 21:06:45 | 显示全部楼层
学习学习不知道
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

1314学习网 ( 浙ICP备10214163号 )

GMT+8, 2024-4-20 02:36

Powered by Discuz! X3.4

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表