jjk2 Posted June 13, 2009 Share Posted June 13, 2009 $s = @$_GET['s']; $limit = 6; $news=$s+$limit; $numpages = $numrows / $limit; $numpages = roundup($numpages, 0); $vc = 0; $pagelimit = 116; $slimit = ($pagelimit - 1)*$limit; for ($xx = $pagelimit-1; $xx <= $numpages; $xx+=$pagelimit-1){ for ($tt = 1; $tt <= $numpages; $tt++){ if ($tt < $pagelimit){ echo " <a href=\"$PHP_SELF?s=$vc&searchopt=$cat&q=$var\">" . "$tt" . " </a>"; } if ($tt == $pagelimit) { echo " <a href=\"$PHP_SELF?s=$vc&searchopt=$cat&q=$var\">" . "MORE" . " </a>"; } $vc += $limit; } } basically when ?s= is less than 690, i want all 115 pagination links to appear. then for the next 115~230, i want the next 115 pagination links.......... argh this is so difficult. Quote Link to comment https://forums.phpfreaks.com/topic/162019-help-with-pagination/ Share on other sites More sharing options...
jjk2 Posted June 13, 2009 Author Share Posted June 13, 2009 heres what i decided to do instead this will run for each page. $news=$s+$limit; $numpages = $numrows / $limit; $numpages = roundup($numpages, 0); $vc = 0; $pagelimit = 115; $slimiter = ($pagelimit - 1)*$limit; for ($slimitz=0; $slimitz <= $numpages; $slimitz += $slimiter;){ if ($s < $slimiter && $s > $slimitz){ for ($tt = 1; $tt <= $numpages; $tt++){ if ($tt < $pagelimit){ echo " <a href=\"$PHP_SELF?s=$vc&searchopt=$cat&q=$var\">" . "$tt" . " </a>"; } if ($tt == $pagelimit) { echo " <a href=\"$PHP_SELF?s=$vc&searchopt=$cat&q=$var\">" . "MORE" . " </a>"; } $vc += $limit; } } $slimiter += $slimiter; $pagelimit += $pagelimit; } Quote Link to comment https://forums.phpfreaks.com/topic/162019-help-with-pagination/#findComment-854930 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.