diff options
| author | Star Rauchenberger <fefferburbia@gmail.com> | 2009-02-21 10:55:14 -0500 | 
|---|---|---|
| committer | Star Rauchenberger <fefferburbia@gmail.com> | 2009-02-21 10:55:14 -0500 | 
| commit | 8abb1350371177d2f001e0aea82c3cc703759918 (patch) | |
| tree | 36e2975a906a17545c2bf786e7a18c6c28f78559 | |
| parent | 0cffae949ce7a7979a76582fd5b1e19f6c192d8b (diff) | |
| download | pillowcase-8abb1350371177d2f001e0aea82c3cc703759918.tar.gz pillowcase-8abb1350371177d2f001e0aea82c3cc703759918.tar.bz2 pillowcase-8abb1350371177d2f001e0aea82c3cc703759918.zip  | |
Neatened the code a bit
| -rw-r--r-- | header.php | 7 | ||||
| -rwxr-xr-x | index.php | 25 | 
2 files changed, 18 insertions, 14 deletions
| diff --git a/header.php b/header.php index 3b0dc8b..ebdee99 100644 --- a/header.php +++ b/header.php | |||
| @@ -23,8 +23,11 @@ if (isset($title)) | |||
| 23 | 23 | ||
| 24 | include_once('db.php'); | 24 | include_once('db.php'); | 
| 25 | 25 | ||
| 26 | $getlast = mysql_fetch_array(mysql_query("SELECT * FROM config WHERE name = \"lastUpdated\"")); | 26 | $getlast = "SELECT * FROM config WHERE name = \"lastUpdated\""; | 
| 27 | $last = $getlast['value']; | 27 | $getlast2 = mysql_query($getlast); | 
| 28 | $getlast3 = mysql_fetch_array($getlast2); | ||
| 29 | |||
| 30 | $last = $getlast3['value']; | ||
| 28 | if ($last != date('md')) | 31 | if ($last != date('md')) | 
| 29 | { | 32 | { | 
| 30 | $getpending = "SELECT * FROM pending ORDER BY id ASC LIMIT 0,1"; | 33 | $getpending = "SELECT * FROM pending ORDER BY id ASC LIMIT 0,1"; | 
| diff --git a/index.php b/index.php index a902cce..951e2bb 100755 --- a/index.php +++ b/index.php | |||
| @@ -4,16 +4,14 @@ include('db.php'); | |||
| 4 | 4 | ||
| 5 | ob_start(); | 5 | ob_start(); | 
| 6 | 6 | ||
| 7 | $posts = array(); | ||
| 8 | |||
| 9 | if (isset($_GET['id'])) | 7 | if (isset($_GET['id'])) | 
| 10 | { | 8 | { | 
| 11 | $getimages = "SELECT * FROM images WHERE id = " . $_GET['id']; | 9 | $getimage = "SELECT * FROM images WHERE id = " . $_GET['id']; | 
| 12 | } else { | 10 | } else { | 
| 13 | $getimages = "SELECT * FROM images ORDER BY id DESC LIMIT 0,1"; | 11 | $getimage = "SELECT * FROM images ORDER BY id DESC LIMIT 0,1"; | 
| 14 | } | 12 | } | 
| 15 | $getimages2 = mysql_query($getimages); | 13 | $getimage2 = mysql_query($getimage); | 
| 16 | $getimage3 = mysql_fetch_array($getimages2); | 14 | $getimage3 = mysql_fetch_array($getimage2); | 
| 17 | 15 | ||
| 18 | ?> | 16 | ?> | 
| 19 | <DIV CLASS="post"> | 17 | <DIV CLASS="post"> | 
| @@ -39,8 +37,11 @@ $getimage3 = mysql_fetch_array($getimages2); | |||
| 39 | <?php | 37 | <?php | 
| 40 | 38 | ||
| 41 | $id = $getimage3['id']; | 39 | $id = $getimage3['id']; | 
| 42 | $all = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM images")); | 40 | |
| 43 | $all = $all['COUNT(*)']; | 41 | $cntimages = "SELECT COUNT(*) FROM images"; | 
| 42 | $cntimages2 = mysql_query($cntimages); | ||
| 43 | $cntimages3 = mysql_fetch_array($cntimages2); | ||
| 44 | $all = $cntimages3['COUNT(*)']; | ||
| 44 | 45 | ||
| 45 | if ($id > 2) | 46 | if ($id > 2) | 
| 46 | { | 47 | { | 
| @@ -68,10 +69,10 @@ if ($id < $all) | |||
| 68 | } | 69 | } | 
| 69 | } | 70 | } | 
| 70 | 71 | ||
| 71 | $getnpending = "SELECT COUNT(*) FROM pending"; | 72 | $cntpending = "SELECT COUNT(*) FROM pending"; | 
| 72 | $getnpending2 = mysql_query($getnpending); | 73 | $cntpending2 = mysql_query($cntpending); | 
| 73 | $getnpending3 = mysql_fetch_array($getnpending2); | 74 | $cntpending3 = mysql_fetch_array($cntpending2); | 
| 74 | $numpending = $getnpending3['COUNT(*)']; | 75 | $numpending = $cntpending3['COUNT(*)']; | 
| 75 | 76 | ||
| 76 | ?> | 77 | ?> | 
| 77 | </UL> | 78 | </UL> | 
