hey there guys...
for some reason im getting an infinite loop somewhere in the following code...
if($topic_num_replys > 14) {
$pages = ceil(($topic_num_replys + 1) / 15);
echo("$pages");
if($pages > 9) {
for($a=0;$a<=2;$a++) {
$b = ($a * 15);
$c = ($a + 1);
if($a == 0) { echo("<a href=\"index.php?board=" . BOARD_ID . "&topic=$topic_id\">$c</a> ");
} else { echo("<a href=\"index.php?board=" . BOARD_ID . "&topic=$topic_id&limit=$b\">$c</a> ");
}
}
echo("... ");
$middle = floor($pages / 2);
$middle_low = $middle - 1;
$middle_high = $middle + 1;
for($d=$middle_low;$d<=$middle_high;$d++) {
$e = ($d - 1) * 15;
$f = ($d + 1);
echo("<a href=\"index.php?board=" . BOARD_ID . "&topic=$topic_id&limit=$e\">$d</a> ");
}
$top2 = $pages - 2;
echo("... ");
for($g=$top2;$g<=$pages;$g++) {
$h = ($g - 1) * 15;
$i = $g + 1;
echo("<a href=\"index.php?board=" . BOARD_ID . "&topic=$topic_id&limit=$h\">$g</a> ");
}
} else {
for($j=0;$a<$pages;$j++) {
$k = ($j * 15);
$l = ($j + 1);
echo("<a href=\"index.php?board=" . BOARD_ID . "&topic=$topic_id&limit=$k\">$l</a> ");
}
}
}
im not really too sure why but its definitely in there somewhere...
any ideas?
ta, stew