diff options
author | Starla Insigna <hatkirby@fourisland.com> | 2008-12-19 20:40:26 -0500 |
---|---|---|
committer | Starla Insigna <hatkirby@fourisland.com> | 2008-12-19 20:40:26 -0500 |
commit | c9968db2dddd42760e7adba2e9e5475925c4996c (patch) | |
tree | a83d6d3d0aae9f74cd489aebd87be1e9e02e776e /pages | |
parent | 11565550e7ab6ef9987a298a0729fc016960252b (diff) | |
download | fourisland-c9968db2dddd42760e7adba2e9e5475925c4996c.tar.gz fourisland-c9968db2dddd42760e7adba2e9e5475925c4996c.tar.bz2 fourisland-c9968db2dddd42760e7adba2e9e5475925c4996c.zip |
Fixed Admin's movePending output
The movePending command is used to re-arrange the pending queue. However, it's output had two errors: 1. If the move completed sucessfully, the pending queue would be shown again. However, the URL would still be the movePending command, with it's parameters. Because of this, if the user refreshed, it would try to re-arrange the queue again, which could cause some strange things to happen as the post in question had already been moved. This problem has been fixed by redirecting to the managePending command after executing the movePending command instead of simply running the managePending command internally as used to be the problem. 2. As a collary of the preceding error, if the move failed, the error would simply back up the browser's history and refresh. If the previous page was the output of a sucessful movePending command, strange things would happen. This was fixed dually by the previous solution and the fact that now the error messages simply link to the managePending command.
Diffstat (limited to 'pages')
-rwxr-xr-x | pages/admin.php | 29 |
1 files changed, 11 insertions, 18 deletions
diff --git a/pages/admin.php b/pages/admin.php index a171b6f..50e7abc 100755 --- a/pages/admin.php +++ b/pages/admin.php | |||
@@ -372,8 +372,9 @@ if (isLoggedIn()) | |||
372 | { | 372 | { |
373 | $otherPending = $get2pending3; | 373 | $otherPending = $get2pending3; |
374 | } else { | 374 | } else { |
375 | $template = new FITemplate('msg'); | 375 | $template = new FITemplate('msg2'); |
376 | $template->add('BACK', 'the previous page'); | 376 | $template->add('BACK', 'Back to the pending queue'); |
377 | $template->add('LINK', 'managePending.php'); | ||
377 | $template->add('MSG', 'I\'m sorry, that pending post is already the first.'); | 378 | $template->add('MSG', 'I\'m sorry, that pending post is already the first.'); |
378 | } | 379 | } |
379 | } else if ($_GET['dir'] == 'down') | 380 | } else if ($_GET['dir'] == 'down') |
@@ -386,8 +387,9 @@ if (isLoggedIn()) | |||
386 | { | 387 | { |
387 | $otherPending = $get2pending3; | 388 | $otherPending = $get2pending3; |
388 | } else { | 389 | } else { |
389 | $template = new FITemplate('msg'); | 390 | $template = new FITemplate('msg2'); |
390 | $template->add('BACK', 'the previous page'); | 391 | $template->add('BACK', 'Back to the pending queue'); |
392 | $template->add('LINK', 'managePending.php'); | ||
391 | $template->add('MSG', 'I\'m sorry, that pending post is already the last.'); | 393 | $template->add('MSG', 'I\'m sorry, that pending post is already the last.'); |
392 | } | 394 | } |
393 | } | 395 | } |
@@ -410,22 +412,13 @@ if (isLoggedIn()) | |||
410 | addTags($_GET['id'], $tags2, 'pending'); | 412 | addTags($_GET['id'], $tags2, 'pending'); |
411 | addTags($otherPending['id'], $tags1, 'pending'); | 413 | addTags($otherPending['id'], $tags1, 'pending'); |
412 | 414 | ||
413 | $template = new FITemplate('admin/managePending'); | 415 | header('Location: managePending.php'); |
414 | 416 | exit; | |
415 | $getpending = "SELECT * FROM pending ORDER BY id ASC"; | ||
416 | $getpending2 = mysql_query($getpending); | ||
417 | $i=0; | ||
418 | while ($getpending3[$i] = mysql_fetch_array($getpending2)) | ||
419 | { | ||
420 | $template->adds_block('PENDING', array( 'TITLE' => $getpending3[$i]['title'], | ||
421 | 'AUTHOR' => $getpending3[$i]['author'], | ||
422 | 'ID' => $getpending3[$i]['id'])); | ||
423 | $i++; | ||
424 | } | ||
425 | } | 417 | } |
426 | } else { | 418 | } else { |
427 | $template = new FITemplate('msg'); | 419 | $template = new FITemplate('msg2'); |
428 | $template->add('BACK', 'the previous page'); | 420 | $template->add('BACK', 'Back to the pending queue'); |
421 | $template->add('LINK', 'managePending.php'); | ||
429 | $template->add('MSG', 'I\'m sorry, that pending post doesn\'t exist.'); | 422 | $template->add('MSG', 'I\'m sorry, that pending post doesn\'t exist.'); |
430 | } | 423 | } |
431 | } else if ($_GET['page'] == 'managePosts') | 424 | } else if ($_GET['page'] == 'managePosts') |