Location: PHPKode > scripts > WH Board > wh_board/framework/navi_extended.php
<?php

    $path = $_SERVER['PHP_SELF'];
    $total = intval(mysql_num_rows($count));
    $allsites = ceil($total / $entries);

    if(empty($_GET['page'])) {
        $page = 1;

    }elseif($_GET['page'] <= 0 || $_GET['page'] > $allsites) {
        $page = 1;

        }else{

        $page = mysql_real_escape_string($_GET['page']);
        }

    $links = array();

    if(($page - $shwosites) < 1){ $before = $page - 1;
        }else {

        $before = $shwosites;
        }

    if(($page + $shwosites) > $allsites){ $after = $allsites - $page;
        }else{

        $after = $shwosites;
        }

        $off = ($page - $before);

    if($page- $before > 1) {
        $first = 1;
        $links[] = '<a href="' . $path . '?id=' . $id . '&page=' . $first . '" class="navigation">&laquo; ' . $lang['first_page'] . ' ...</a>';
        }

    if($page != 1) {
        $prev = $page-1;
        $links[] = '<a href="' . $path . '?id=' . $id . '&page=' . $prev . '" class="navigation"> &laquo;</a>';
        }

    for($i = $off; $i <= ($page + $after); $i++) {

        if($i != $page) {
            $links[] = '<a href="' . $path . '?id=' . $id . '&page=' . $i . '" class="navigation">' . $i . '</a>';

            }elseif($i == $allsites) {
            $links[] = '<span class="current">' . $i . '</span>';

            }elseif($i == $page) {
            $links[] = '<span class="current">' . $i . '</span>';
            }
        }

    if($page != $allsites) {
        $next = $page+1;
        $links[] = '<a href="' . $path . '?id=' . $id . '&page=' . $next . '" class="navigation"> &raquo;</a>';
        }

    if($allsites - $page - $shwosites > 0 ) {
        $last = $allsites;
        $links[] = '<a href="' . $path . '?id=' . $id . '&page=' . $last . '" class="navigation">... ' . $lang['last_page'] . ' &raquo;</a>';
        }

    $start = ($page-1) * $entries;
    $link_string = implode(" ", $links);

?>
Return current item: WH Board