Açıklama Yok
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

a.htm 2.5KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. <!--分页开始-->
  2. <div class="page">
  3. <?php
  4. //需要变量
  5. $request = request();
  6. $url = $request->url();
  7. if (strpos($url, '-') !== false) {
  8. $url = explode('-', $url);
  9. $url = $url[0];
  10. } else {
  11. }
  12. $total = count($matches[0]);
  13. $pagesize = 1;
  14. $total_page = ceil($total / $pagesize);
  15. $curpage = $pa;
  16. $total_page_for = $total_page + 1;
  17. $pro_page = $pa - 1;
  18. $pev_page = $pa + 1;
  19. ?>
  20. <div class="page-a">
  21. {eyou:if condition='((int)$total_page > 1)'}
  22. {eyou:if condition='((int)$curpage === 1)'}
  23. <li><a>首页</a></li>
  24. <li><a>上一页</a></li>
  25. {eyou:else /}
  26. <li><a href="{$url}">首页</a></li>
  27. {eyou:if condition='((int)$curpage === 2)'}
  28. <li><a href="{$url}">上一页</a></li>
  29. {eyou:else /}
  30. <li><a href="{$url}-{$pro_page}">上一页</a></li>
  31. {/eyou:if}
  32. {/eyou:if}
  33. {eyou:for start='1' end="$total_page_for"}
  34. {eyou:if condition='((int)$i === 1)'}
  35. {eyou:if condition='((int)$curpage === $i)'}
  36. <li class="active-1"><a>{$i}</a></li>
  37. {eyou:else /}
  38. <li><a href="{$url}" data-ey_fc35fdc="html" data-tmp="1">{$i}</a></li>
  39. {/eyou:if}
  40. {eyou:else /}
  41. {eyou:if condition='((int)$curpage === $i)'}
  42. <li class="active-1"><a>{$i}</a></li>
  43. {eyou:else /}
  44. <?php
  45. if ($total_page > 10) {
  46. if (((int)$curpage - 2) < $i && ((int)$curpage + 2) > $i || ((int)$total_page - 1) < $i && ((int)$total_page + 1) > $i || 0 < $i && 2 > $i) { ?>
  47. <li><a href="{$url}-{$i}" data-ey_fc35fdc="html" data-tmp="1">{$i}</a></li>
  48. <?php } else { ?>
  49. <?php }
  50. } else { ?>
  51. <li><a href="{$url}-{$i}" data-ey_fc35fdc="html" data-tmp="1">{$i}</a></li>
  52. <?php } ?>
  53. {/eyou:if}
  54. {/eyou:if}
  55. {/eyou:for}
  56. {eyou:if condition='((int)$curpage === (int)$total_page)'}
  57. <li><a>下一页</a></li>
  58. <li><a>末页</a></li>
  59. {eyou:else /}
  60. <li><a href="{$url}-{$pev_page}" data-ey_fc35fdc="html" data-tmp="1">下一页</a></li>
  61. <li><a href="{$url}-{$total_page}" data-ey_fc35fdc="html" data-tmp="1">末页</a></li>
  62. {/eyou:if}
  63. {/eyou:if}
  64. </div>
  65. <div class="page-b">
  66. 共<strong>
  67. {eyou:php}
  68. echo $total_page;
  69. {/eyou:php}
  70. </strong>页 <strong>{$total}</strong>条
  71. </div>
  72. </div>
  73. <!--分页结束--->