diff options
| author | Savetheinternet <savetheinternet@n0v4.com> | 2011-02-22 17:52:26 +1100 |
|---|---|---|
| committer | Savetheinternet <savetheinternet@n0v4.com> | 2011-02-22 17:52:26 +1100 |
| commit | 4de6598440fb7bdc76a8c220181829a8096c391a (patch) | |
| tree | 7d07a9d7f99e2b371f01534ced851c26764041d8 /inc/functions.php | |
| parent | 3defed1c0b265895c2058029af98e1f595d8b0bb (diff) | |
Fix for page next/prev buttons in mod.php
Diffstat (limited to 'inc/functions.php')
| -rw-r--r-- | inc/functions.php | 31 |
1 files changed, 21 insertions, 10 deletions
diff --git a/inc/functions.php b/inc/functions.php index dabdbb64..19491d76 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -499,22 +499,33 @@ // There is no previous page. $btn['prev'] = 'Previous'; } else { - $btn['prev'] = '<form action="' . $root . - ($num == 1 ? - $config['file_index'] - : - sprintf($config['file_page'], $num) - ) . - '" method="' . ($mod ? 'post' : 'get') . '"><input type="submit" value="Previous" /></form>'; + $loc = ($mod ? '?/' . $board['uri'] . '/' : '') . + ($num == 1 ? + $config['file_index'] + : + sprintf($config['file_page'], $num) + ); + + $btn['prev'] = '<form action="' . ($mod ? '' : $root . $loc) . '" method="get">' . + ($mod ? + '<input type="hidden" name="status" value="301" />' . + '<input type="hidden" name="r" value="' . htmlentities($loc) . '" />' + :'') . + '<input type="submit" value="Previous" /></form>'; } if($num == count($pages) - 1) { // There is no next page. $btn['next'] = 'Next'; } else { - $btn['next'] = '<form action="' . $root . - sprintf($config['file_page'], $num + 2) . - '" method="' . ($mod ? 'post' : 'get') . '"><input type="submit" value="Next" /></form>'; + $loc = ($mod ? '?/' . $board['uri'] . '/' : '') . sprintf($config['file_page'], $num + 2); + + $btn['next'] = '<form action="' . ($mod ? '' : $root . $loc) . '" method="get">' . + ($mod ? + '<input type="hidden" name="status" value="301" />' . + '<input type="hidden" name="r" value="' . htmlentities($loc) . '" />' + :'') . + '<input type="submit" value="Next" /></form>'; } } } |
