# There's got to be a cleaner way to do this!
for( $i = 1; $i < $sections; $i++ ) {
$from = $i * $indexMaxperpage;
- $sql = "SELECT cur_title $fromwhere $order LIMIT $from,2";
+ $sql = "SELECT cur_title $fromwhere $order ".wfLimitResult(2,$from);
$res = wfQuery( $sql, DB_READ, $fname );
$s = wfFetchObject( $res );
}
$from = $i * $indexMaxperpage;
- $sql = "SELECT cur_title $fromwhere $order LIMIT " . ($count-1) . ",1";
+ $sql = "SELECT cur_title $fromwhere $order ".wfLimitResult(1,$count-1);
$res = wfQuery( $sql, DB_READ, $fname );
$s = wfFetchObject( $res );
$outpoint = $s->cur_title;
# FIXME: Dynamic column widths, backlink to main list,
# side links to next and previous
$n = 0;
- $out = "<table border=\"0\">\n<tr>";
+ $out = "<table border=\"0\">\n";
while( $s = wfFetchObject( $res ) ) {
$t = Title::makeTitle( 0, $s->cur_title );
if( $t ) {
} else {
$link = "[[" . htmlspecialchars( $s->cur_title ) . "]]";
}
+ if( $n == 0 ) {
+ $out .= "<tr>\n";
+ }
$out .= "<td width=\"33%\">$link</td>";
$n = ++$n % 3;
if( $n == 0 ) {
- $out .= "</tr>\n<tr>";
+ $out .= "</tr>\n";
}
}
if( $n != 0 ) {