summary refs log tree commit diff stats
path: root/pages
diff options
context:
space:
mode:
authorStarla Insigna <hatkirby@fourisland.com>2008-12-13 10:06:40 -0500
committerStarla Insigna <hatkirby@fourisland.com>2008-12-13 10:06:40 -0500
commit1f975f948841eacd2cca2da39cfbe04d10e0e137 (patch)
tree28e0b94ed53a9a9643448d197a2d6caf8821aab1 /pages
parent7eb055141bae63b85cef93e5d6f67e3016219d7b (diff)
downloadfourisland-1f975f948841eacd2cca2da39cfbe04d10e0e137.tar.gz
fourisland-1f975f948841eacd2cca2da39cfbe04d10e0e137.tar.bz2
fourisland-1f975f948841eacd2cca2da39cfbe04d10e0e137.zip
Fixed blog post Next/Previous links
Previously, when a post was deleted, it's adjacent posts displayed nothing for the respective Next/Previous link because there was no post with an ID
exactly one before or after it. Now, blog.php just looks for the next or previous ID, regardless of if it's actually adjacent.
Diffstat (limited to 'pages')
-rwxr-xr-xpages/blog.php4
1 files changed, 2 insertions, 2 deletions
diff --git a/pages/blog.php b/pages/blog.php index 879aa0f..f99ad17 100755 --- a/pages/blog.php +++ b/pages/blog.php
@@ -45,7 +45,7 @@ if (isset($_GET['post']))
45 45
46 $title = stripslashes($getpost3['title']) . ' - Blog Archive'; 46 $title = stripslashes($getpost3['title']) . ' - Blog Archive';
47 47
48 $getback = "SELECT * FROM updates WHERE id = " . ($getpost3['id']-1); 48 $getback = "SELECT * FROM updates WHERE id < " . $getpost3['id'] . " ORDER BY id DESC LIMIT 0,1";
49 $getback2 = mysql_query($getback); 49 $getback2 = mysql_query($getback);
50 $getback3 = mysql_fetch_array($getback2); 50 $getback3 = mysql_fetch_array($getback2);
51 if (isset($getback3['title'])) 51 if (isset($getback3['title']))
@@ -54,7 +54,7 @@ if (isset($_GET['post']))
54 'TITLE' => $getback3['title'])); 54 'TITLE' => $getback3['title']));
55 } 55 }
56 56
57 $getnext = "SELECT * FROM updates WHERE id = " . ($getpost3['id']+1); 57 $getnext = "SELECT * FROM updates WHERE id > " . $getpost3['id'] . " ORDER BY id ASC LIMIT 0,1";
58 $getnext2 = mysql_query($getnext); 58 $getnext2 = mysql_query($getnext);
59 $getnext3 = mysql_fetch_array($getnext2); 59 $getnext3 = mysql_fetch_array($getnext2);
60 if (isset($getnext3['title'])) 60 if (isset($getnext3['title']))