Limited number of paging to 10 “pages: 1 … 10”

for ($i=1; $i <= min($pages,10); $i++)