<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace ModStart\Core\Util; class PageHtmlUtil { private static function itemRender($JCIt8, $HBrrp, $Gf_1i, $tpgiq) { goto WK23f; vjP1x: for ($tMyPy = $JCIt8; $tMyPy <= $HBrrp; $tMyPy++) { if ($tMyPy == $Gf_1i) { $Q1WHV[] = '<span class="current">' . $tMyPy . '</span>'; } else { $Q1WHV[] = '<a class="page" href="' . str_replace('{page}', $tMyPy, $tpgiq) . '">' . $tMyPy . '</a>'; } } goto DYq_q; DYq_q: return join('', $Q1WHV); goto KYKnA; WK23f: $Q1WHV = array(); goto vjP1x; KYKnA: } public static function nextPageUrl($XSvPH, $MNp5Y, $Gf_1i, $tpgiq = '/url/for/path?page={page}') { goto Y0BkS; WbWJ3: if ($Gf_1i < $r7V97) { return str_replace('{page}', $Gf_1i + 1, $tpgiq); } goto HHYKP; HHYKP: return null; goto SRxqw; Y0BkS: $r7V97 = ceil($XSvPH / $MNp5Y); goto WbWJ3; SRxqw: } public static function prevPageUrl($XSvPH, $MNp5Y, $Gf_1i, $tpgiq = '/url/for/path?page={page}') { if ($Gf_1i > 1) { return str_replace('{page}', $Gf_1i - 1, $tpgiq); } return null; } public static function render($XSvPH, $MNp5Y, $Gf_1i, $tpgiq = '/url/for/path?page={page}') { goto pLHyW; q_MCN: $Q1WHV[] = '<div class="pages">'; goto UWuIN; UWuIN: if ($r7V97 < 6) { if ($r7V97 > 0) { $Q1WHV[] = self::itemRender(1, $r7V97, $Gf_1i, $tpgiq); } } else { goto FXQ89; wt2Ty: if ($WE992 < $r7V97 - 3) { $Q1WHV[] = '<span class="more">...</span>'; } goto DyE0P; a3leu: if ($WIu_T > 3 + 1) { $Q1WHV[] = '<span class="more">...</span>'; } goto ubsoV; DyE0P: $Q1WHV[] = self::itemRender($r7V97 - 2, $r7V97, $Gf_1i, $tpgiq); goto XDpIn; INPHq: $WIu_T = $Gf_1i - 3; goto mEoug; mEoug: $WE992 = $Gf_1i + 3; goto fShaf; ubsoV: $Q1WHV[] = self::itemRender($WIu_T, $WE992, $Gf_1i, $tpgiq); goto wt2Ty; Ao7lk: if ($WE992 > $r7V97 - 3) { $WE992 = $r7V97 - 3; } goto a3leu; fShaf: if ($WIu_T < 4) { $WIu_T = 4; } goto Ao7lk; FXQ89: $Q1WHV[] = self::itemRender(1, 3, $Gf_1i, $tpgiq); goto INPHq; XDpIn: } goto mq6Xb; s5oMx: if ($Gf_1i < $r7V97) { $Q1WHV[] = '<a class="page" href="' . str_replace('{page}', $Gf_1i + 1, $tpgiq) . '">下一页</a>'; } goto CZKYM; CZKYM: $Q1WHV[] = '</div>'; goto a2r9I; MxwOW: if ($Gf_1i < 1) { $Gf_1i = 1; } else { if ($Gf_1i > $r7V97) { $Gf_1i = $r7V97; } } goto c0ZzW; a2r9I: return join('', $Q1WHV); goto ur76K; c0ZzW: $Q1WHV = array(); goto q_MCN; mq6Xb: if ($Gf_1i > 1) { $Q1WHV[] = '<a class="page" href="' . str_replace('{page}', $Gf_1i - 1, $tpgiq) . '">上一页</a>'; } goto s5oMx; pLHyW: $r7V97 = ceil($XSvPH / $MNp5Y); goto MxwOW; ur76K: } }