= $vars['limit']) break;
}
}
$baseurl = $_SERVER['REQUEST_URI'];
$baseurl = $baseurl = preg_replace('/[\&\?]offset\=[0-9]*/',"",$baseurl);
$nav = '';
if (sizeof($vars['items']) > $vars['limit']) {
$newoffset = $vars['offset'] + $vars['limit'];
$urladdition = 'offset='.$newoffset;
if (substr_count($baseurl,'?')) $nexturl=$baseurl . '&' . $urladdition; else $nexturl=$baseurl . '?' . $urladdition;
$nav .= '' . elgg_echo('previous') . ' ';
}
if ($vars['offset'] > 0) {
$newoffset = $vars['offset'] - $vars['limit'];
if ($newoffset < 0) $newoffset = 0;
$urladdition = 'offset='.$newoffset;
if (substr_count($baseurl,'?')) $prevurl=$baseurl . '&' . $urladdition; else $prevurl=$baseurl . '?' . $urladdition;
$nav .= '' . elgg_echo('next') . ' ';
}
if (!empty($nav)) {
echo '';
}
?>