/** * 输出分页 * * @access public * @return void */ public function pageNav() { $query = $this->request->makeUriByRequest('page={page}'); /** 使用盒状分页 */ $nav = new Typecho_Widget_Helper_PageNavigator_Box(false === $this->_total ? $this->_total = $this->size($this->_countSql) : $this->_total, $this->_currentPage, $this->parameter->pageSize, $query); $nav->render(_t('«'), _t('»')); }
/** * 输出分页 * * @access public * @param string $prev 上一页文字 * @param string $next 下一页文字 * @param int $splitPage 分割范围 * @param string $splitWord 分割字符 * @param string $template 展现配置信息 * @return void */ public function pageNav($prev = '«', $next = '»', $splitPage = 3, $splitWord = '...', $template = '') { if ($this->options->commentsPageBreak && $this->_total > $this->options->commentsPageSize) { $default = array('wrapTag' => 'ol', 'wrapClass' => 'page-navigator'); if (is_string($template)) { parse_str($template, $config); } else { $config = $template; } $template = array_merge($default, $config); $pageRow = $this->parameter->parentContent; $pageRow['permalink'] = $pageRow['pathinfo']; $query = Typecho_Router::url('comment_page', $pageRow, $this->options->index); /** 使用盒状分页 */ $nav = new Typecho_Widget_Helper_PageNavigator_Box($this->_total, $this->_currentPage, $this->options->commentsPageSize, $query); $nav->setPageHolder('commentPage'); $nav->setAnchor('comments'); echo '<' . $template['wrapTag'] . (empty($template['wrapClass']) ? '' : ' class="' . $template['wrapClass'] . '"') . '>'; $nav->render($prev, $next, $splitPage, $splitWord, $template); echo '</' . $template['wrapTag'] . '>'; } }
/** * 输出分页 * * @access public * @param string $prev 上一页文字 * @param string $next 下一页文字 * @param int $splitPage 分割范围 * @param string $splitWord 分割字符 * @param string $template 展现配置信息 * @return void */ public function pageNav($prev = '«', $next = '»', $splitPage = 3, $splitWord = '...', $template = '') { if ($this->have()) { $hasNav = false; $default = array('wrapTag' => 'ol', 'wrapClass' => 'page-navigator'); if (is_string($template)) { parse_str($template, $config); } else { $config = $template; } $template = array_merge($default, $config); $total = $this->getTotal(); $this->pluginHandle()->trigger($hasNav)->pageNav($this->_currentPage, $total, $this->parameter->pageSize, $prev, $next, $splitPage, $splitWord); if (!$hasNav && $total > $this->parameter->pageSize) { $query = Typecho_Router::url($this->parameter->type . (false === strpos($this->parameter->type, '_page') ? '_page' : NULL), $this->_pageRow, $this->options->index); /** 使用盒状分页 */ $nav = new Typecho_Widget_Helper_PageNavigator_Box($total, $this->_currentPage, $this->parameter->pageSize, $query); echo '<' . $template['wrapTag'] . (empty($template['wrapClass']) ? '' : ' class="' . $template['wrapClass'] . '"') . '>'; $nav->render($prev, $next, $splitPage, $splitWord, $template); echo '</' . $template['wrapTag'] . '>'; } } }
</h6></td> </tr> <?php } ?> </tbody> </table> <?php //分页 $currUrl = ($request->isSecure() ? 'https://' : 'http://') . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF']; parse_str($_SERVER['QUERY_STRING'], $parseUrl); unset($parseUrl['page']); $query = $currUrl . '?' . http_build_query($parseUrl); $pange_nav = new Typecho_Widget_Helper_PageNavigator_Box($total, $page, $page_size, $query . '&page={page}'); echo '<ul class="typecho-pager" style="width:100%;">'; $pange_nav->render("上一页", "下一页"); echo '</ul>'; ?> </div> </form> </div> </div> </div> </div> <?php include 'copyright.php'; include 'common-js.php';
/** * 输出分页 * * @access public * @param string $prev 上一页文字 * @param string $next 下一页文字 * @param int $splitPage 分割范围 * @param string $splitWord 分割字符 * @return void */ public function pageNav($prev = '«', $next = '»', $splitPage = 3, $splitWord = '...', $class = 'page-navigator', $currentClass = 'current') { if ($this->have()) { $hasNav = false; $this->_total = false === $this->_total ? $this->size($this->_countSql) : $this->_total; $this->pluginHandle()->trigger($hasNav)->pageNav($this->_currentPage, $this->_total, $this->parameter->pageSize, $prev, $next, $splitPage, $splitWord); if (!$hasNav && $this->_total > $this->parameter->pageSize) { $query = Typecho_Router::url($this->parameter->type . (false === strpos($this->parameter->type, '_page') ? '_page' : NULL), $this->_pageRow, $this->options->index); /** 使用盒状分页 */ $nav = new Typecho_Widget_Helper_PageNavigator_Box($this->_total, $this->_currentPage, $this->parameter->pageSize, $query); echo '<ol class="' . $class . '">'; $nav->render($prev, $next, $splitPage, $splitWord, $currentClass); echo '</ol>'; } } }
/** * 输出分页 * * @access public * @param string $prev 上一页文字 * @param string $next 下一页文字 * @param int $splitPage 分割范围 * @param string $splitWord 分割字符 * @return void */ public function pageNav($prev = '«', $next = '»', $splitPage = 3, $splitWord = '...') { if ($this->options->commentsPageBreak && $this->_total > $this->options->commentsPageSize) { $pageRow = $this->parameter->parentContent; $pageRow['permalink'] = $pageRow['pathinfo']; $query = Typecho_Router::url('comment_page', $pageRow, $this->options->index); /** 使用盒状分页 */ $nav = new Typecho_Widget_Helper_PageNavigator_Box($this->_total, $this->_currentPage, $this->options->commentsPageSize, $query); $nav->setPageHolder('commentPage'); $nav->setAnchor('comments'); echo '<ol class="page-navigator">'; $nav->render($prev, $next, $splitPage, $splitWord); echo '</ol>'; } }