summary refs log tree commit diff stats
path: root/includes/update.php
diff options
context:
space:
mode:
authorStar Rauchenberger <fefferburbia@gmail.com>2009-02-25 15:39:21 -0500
committerStar Rauchenberger <fefferburbia@gmail.com>2009-02-25 15:39:21 -0500
commit4cce41c058cc132df28c891585a8380a68f6ab23 (patch)
tree2b6a98b7b44728a1692a3fff2cc4893a8a038e8a /includes/update.php
parent9f112c2e1668c286bdbf832f6e2f4451b7d52b44 (diff)
downloadpillowcase-4cce41c058cc132df28c891585a8380a68f6ab23.tar.gz
pillowcase-4cce41c058cc132df28c891585a8380a68f6ab23.tar.bz2
pillowcase-4cce41c058cc132df28c891585a8380a68f6ab23.zip
Added RSS feed
Diffstat (limited to 'includes/update.php')
-rw-r--r--includes/update.php28
1 files changed, 28 insertions, 0 deletions
diff --git a/includes/update.php b/includes/update.php new file mode 100644 index 0000000..6c8d9ff --- /dev/null +++ b/includes/update.php
@@ -0,0 +1,28 @@
1<?php
2
3$getlast = "SELECT * FROM config WHERE name = \"lastUpdated\"";
4$getlast2 = mysql_query($getlast);
5$getlast3 = mysql_fetch_array($getlast2);
6
7$last = $getlast3['value'];
8if ($last != date('md'))
9{
10 $getpending = "SELECT * FROM comics WHERE status = \"pending\" ORDER BY id ASC LIMIT 0,1";
11 $getpending2 = mysql_query($getpending);
12 $getpending3 = mysql_fetch_array($getpending2);
13 if (!empty($getpending3))
14 {
15 $id = next_comic_id();
16
17 $setcomic = "UPDATE comics SET status = \"publish\", comic_id = " . $id . " WHERE id = " . $getpending3['id'];
18 $setcomic2 = mysql_query($setcomic) or die($setcomic);
19
20 $insmeta = "INSERT INTO meta (comic_id,name,value) VALUES (" . $getpending3['id'] . ",\"pubDate\",\"" . date('Y-m-d H:i:s') . "\")";
21 $insmeta2 = mysql_query($insmeta) or die($insmeta);
22
23 $setconfig = "UPDATE config SET value = \"" . date('md') . "\" WHERE name = \"lastUpdated\"";
24 $setconfig2 = mysql_query($setconfig);
25 }
26}
27
28?>