$gorunen = 3;
for ($j = $this->page - $gorunen; $j < ($this->page + $gorunen) + 1; $j++) {
if ($this->page == $j) {
$queryURL = '';
$links[] = ' '.$j.' '; // If we are on the same page as the current item
} else {
$links[] = ' '.$j.' '; // add the link to the array
}
}