Location: PHPKode > scripts > WH Social > wh_social/framework/functions/pagination.php
<?php

    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 - $p) < 1){ $davor = $page - 1;  }else { $davor = $p; }
	if(($page + $p) > $allsites){ $danach = $allsites - $page; }else{ $danach = $p; }

	$off = ($page - $davor);

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

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

	for($i = $off; $i <= ($page + $danach); $i++) {
        if($i != $page) {
        $links[] = '<a href="' . $path . '?page=' . $i . '">' . $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 . '?page=' . $next . '" title="' . $lang['site_forward'] . '"> &raquo; </a>';
        }

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

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

?>
Return current item: WH Social