Advertisement
StefanBashkir

Untitled

Nov 17th, 2014
179
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.34 KB | None | 0 0
  1. <div class="ForumCatPageSystem">
  2.         <span>Pages: <?php
  3.             // Find the difference between the current page and the last page number.
  4.             // Figure out if we need to make "..." between them
  5.             $PageDifference = ($NumPages - $Page);
  6.             if ($Page > 1){
  7.                 ?>
  8.                 <a href="/B?Page=AnimeDirectory&PageNumber=1<?Php echo( (isset($_GET['SearchQ'])) ? "&SearchQ=" . $_GET['SearchQ'] : ""); ?>" class="ForumIndexLink">&lt; First</a> |
  9.                 <a href="/B?Page=AnimeDirectory&PageNumber=<?php echo($Page -1); echo( (isset($_GET['SearchQ'])) ? "&SearchQ=" . $_GET['SearchQ'] : ""); ?>" class="ForumIndexLink"><?php echo($Page-1); ?></a>,
  10.                 <?php  
  11.             }
  12.             if ($PageDifference <= 5){
  13.                 $StoppingPage = $Page + $PageDifference;
  14.                 for($i = $Page; $i <= ($StoppingPage); $i++){  
  15.                     if ($i != $Page){
  16.                         ?>
  17.                         <a href="/B?Page=AnimeDirectory&PageNumber=<?php echo($i); echo( (isset($_GET['SearchQ'])) ? "&SearchQ=" . $_GET['SearchQ'] : ""); ?>" class="ForumIndexLink"><?php echo($i); ?></a><?php echo( ($i < $StoppingPage) ? ", " : ""); ?>
  18.                         <?php
  19.                     }else{
  20.                         ?>
  21.                         <span style="font-size:.9em;" ><?php echo($i); ?></span><?php echo( ($i < $StoppingPage) ? ", " : ""); ?>
  22.                         <?php
  23.                     }
  24.                 }
  25.             }else{
  26.                 for($i = $Page; $i <= ($Page + 5); $i++){
  27.                     if ($i == $Page){  
  28.                     ?>
  29.                     <span style="font-size:.9em;" ><?php echo($i); ?>,</span>
  30.                     <?php
  31.                     }else{
  32.                     ?>
  33.                     <a href="/B?Page=AnimeDirectory&PageNumber=<?php echo($i); echo( (isset($_GET['SearchQ'])) ? "&SearchQ=" . $_GET['SearchQ'] : ""); ?>" class="ForumIndexLink"><?php echo($i); ?></a><?php echo( ($i < ($Page + 5)) ? ", " : ""); ?>
  34.                     <?php
  35.                     }
  36.                 }
  37.                 echo(" ... ");
  38.                 ?>
  39.                 <a href="/B?Page=AnimeDirectory&PageNumber=<?php echo($NumPages);  echo( (isset($_GET['SearchQ'])) ? "&SearchQ=" . $_GET['SearchQ'] : ""); ?>" class="ForumIndexLink"><?php echo($NumPages); ?></a>
  40.                 <?php
  41.             }
  42.             if ($Page < $NumPages && $NumPages > 1){
  43.                 ?>
  44.                  | <a href="/B?Page=AnimeDirectory&PageNumber=<?php echo($Page + 1); echo( (isset($_GET['SearchQ'])) ? "&SearchQ=" . $_GET['SearchQ'] : ""); ?>" class="ForumIndexLink">Next &gt;</a>
  45.                 <?php  
  46.             }
  47.         ?></span>
  48.     </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement