From 7c7a1832c679729e7e97657be90a6d5de0cd37db Mon Sep 17 00:00:00 2001 From: Starla Insigna Date: Fri, 19 Dec 2008 20:49:10 -0500 Subject: Fixed Admin's movePending EIIEOIAFOA syndrome The admin panel's movePending was suffering the same Every Item Is Exactly One ID Away From One Another syndrome that the main blog was facing in changeset 8c0096629f88 (Fixed blog post Next/Previous links) --- pages/admin.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'pages/admin.php') diff --git a/pages/admin.php b/pages/admin.php index 50e7abc..a3dbffc 100755 --- a/pages/admin.php +++ b/pages/admin.php @@ -364,11 +364,11 @@ if (isLoggedIn()) { if ($_GET['dir'] == 'up') { - $get2pending = "SELECT * FROM pending WHERE id = " . ($_GET['id']-1); + $get2pending = "SELECT * FROM pending WHERE id < " . $_GET['id'] . " LIMIT 0,1"; $get2pending2 = mysql_query($get2pending); $get2pending3 = mysql_fetch_array($get2pending2); - if ($get2pending3['id'] == ($_GET['id']-1)) + if (isset($get2pending3['id'])) { $otherPending = $get2pending3; } else { @@ -379,11 +379,11 @@ if (isLoggedIn()) } } else if ($_GET['dir'] == 'down') { - $get2pending = "SELECT * FROM pending WHERE id = " . ($_GET['id']+1); + $get2pending = "SELECT * FROM pending WHERE id > " . $_GET['id'] . " LIMIT 0,1"; $get2pending2 = mysql_query($get2pending); $get2pending3 = mysql_fetch_array($get2pending2); - if ($get2pending3['id'] == ($_GET['id']+1)) + if (isset($get2pending3['id'])) { $otherPending = $get2pending3; } else { -- cgit 1.4.1