Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <div class="ForumCatPageSystem">
- <span>Pages: <?php
- // Find the difference between the current page and the last page number.
- // Figure out if we need to make "..." between them
- $PageDifference = ($NumPages - $Page);
- if ($Page > 1){
- ?>
- <a href="/B?Page=AnimeDirectory&PageNumber=1<?Php echo( (isset($_GET['SearchQ'])) ? "&SearchQ=" . $_GET['SearchQ'] : ""); ?>" class="ForumIndexLink">< First</a> |
- <a href="/B?Page=AnimeDirectory&PageNumber=<?php echo($Page -1); echo( (isset($_GET['SearchQ'])) ? "&SearchQ=" . $_GET['SearchQ'] : ""); ?>" class="ForumIndexLink"><?php echo($Page-1); ?></a>,
- <?php
- }
- if ($PageDifference <= 5){
- $StoppingPage = $Page + $PageDifference;
- for($i = $Page; $i <= ($StoppingPage); $i++){
- if ($i != $Page){
- ?>
- <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) ? ", " : ""); ?>
- <?php
- }else{
- ?>
- <span style="font-size:.9em;" ><?php echo($i); ?></span><?php echo( ($i < $StoppingPage) ? ", " : ""); ?>
- <?php
- }
- }
- }else{
- for($i = $Page; $i <= ($Page + 5); $i++){
- if ($i == $Page){
- ?>
- <span style="font-size:.9em;" ><?php echo($i); ?>,</span>
- <?php
- }else{
- ?>
- <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)) ? ", " : ""); ?>
- <?php
- }
- }
- echo(" ... ");
- ?>
- <a href="/B?Page=AnimeDirectory&PageNumber=<?php echo($NumPages); echo( (isset($_GET['SearchQ'])) ? "&SearchQ=" . $_GET['SearchQ'] : ""); ?>" class="ForumIndexLink"><?php echo($NumPages); ?></a>
- <?php
- }
- if ($Page < $NumPages && $NumPages > 1){
- ?>
- | <a href="/B?Page=AnimeDirectory&PageNumber=<?php echo($Page + 1); echo( (isset($_GET['SearchQ'])) ? "&SearchQ=" . $_GET['SearchQ'] : ""); ?>" class="ForumIndexLink">Next ></a>
- <?php
- }
- ?></span>
- </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement