Dogs and things wrote: So how should the code look like?
The original line you propose to alter looks like this:What should I turn that into?Code: Select all
LIMIT $start, ".(isset($finish)? ((($finish - $start) > 0)? ($finish - $start): -$finish): $board_config['posts_per_page']);
If you look for this:
Original phpBB2:
Code: Select all
ORDER BY p.post_time $post_time_order
LIMIT $start, ".$board_config['posts_per_page'];
Code: Select all
ORDER BY p.post_time $post_time_order
LIMIT $start, ".(isset($finish)? ((($finish - $start) > 0)? ($finish - $start): -$finish): $board_config['posts_per_page']);
Code: Select all
ORDER BY p.post_time $post_time_order ";
//MOD printer-friendly
// $sql .= " LIMIT $start, ".$board_config['posts_per_page'];
$start = intval($start);
if (isset($finish)) {
$fin = (($finish - $start) > 0) ? (intval($finish) - $start) : -(intval($finish));
} else {
$fin = $board_config['posts_per_page'];
}
$sql .= " LIMIT $start, $fin";
//MOD END printer-friendly
Hope that helps.
NB: The reason I've intval()'d the values is to stop any sql injection from getting through.