summary refs log tree commit diff stats
path: root/includes/header.php
diff options
context:
space:
mode:
authorStar Rauchenberger <fefferburbia@gmail.com>2009-02-22 13:15:37 -0500
committerStar Rauchenberger <fefferburbia@gmail.com>2009-02-22 13:15:37 -0500
commiteee98526c48b9154cd9e9bc8bc3e07769e6a39ea (patch)
tree9d8d719a2ccea91de86435ccd985241ddb3fa0cb /includes/header.php
parent653c7b3a488488d4b161a8fae41ada5851bf7685 (diff)
downloadpillowcase-eee98526c48b9154cd9e9bc8bc3e07769e6a39ea.tar.gz
pillowcase-eee98526c48b9154cd9e9bc8bc3e07769e6a39ea.tar.bz2
pillowcase-eee98526c48b9154cd9e9bc8bc3e07769e6a39ea.zip
Rewrote Pillowcase
NOTE: There is a new database schema now, so the database from the testing server has to be copied over to the production server, otherwise this code
will fail.
Diffstat (limited to 'includes/header.php')
-rw-r--r--includes/header.php52
1 files changed, 52 insertions, 0 deletions
diff --git a/includes/header.php b/includes/header.php new file mode 100644 index 0000000..0f5b075 --- /dev/null +++ b/includes/header.php
@@ -0,0 +1,52 @@
1<?php
2
3if (isset($title))
4{
5 $rtitle = 'Pillowcase - ' . $title;
6} else {
7 $rtitle = 'Pillowcase';
8}
9
10?><HTML>
11 <HEAD>
12 <TITLE><?php echo($rtitle); ?></TITLE>
13 <LINK REL="stylesheet" HREF="/style.css">
14 </HEAD>
15
16 <BODY>
17 <DIV ID="wrap">
18 <DIV ID="header">
19 <A HREF="/"><H1>Pillowcase</H1></A>
20 </DIV>
21
22<?php
23
24include_once($_SERVER['DOCUMENT_ROOT'] . '/db.php');
25include_once($_SERVER['DOCUMENT_ROOT'] . '/functions.php');
26
27$getlast = "SELECT * FROM config WHERE name = \"lastUpdated\"";
28$getlast2 = mysql_query($getlast);
29$getlast3 = mysql_fetch_array($getlast2);
30
31$last = $getlast3['value'];
32if ($last != date('md'))
33{
34 $getpending = "SELECT * FROM comics WHERE status = \"pending\" ORDER BY id ASC LIMIT 0,1";
35 $getpending2 = mysql_query($getpending);
36 $getpending3 = mysql_fetch_array($getpending2);
37 if (!empty($getpending3))
38 {
39 $id = next_comic_id();
40
41 $setcomic = "UPDATE comics SET status = \"publish\", comic_id = " . $id . " WHERE id = " . $getpending3['id'];
42 $setcomic2 = mysql_query($setcomic) or die($setcomic);
43
44 $insmeta = "INSERT INTO meta (comic_id,name,value) VALUES (" . $getpending3['id'] . ",\"pubDate\",\"" . date('Y-m-d H:i:s') . "\")";
45 $insmeta2 = mysql_query($insmeta) or die($insmeta);
46
47 $setconfig = "UPDATE config SET value = \"" . date('md') . "\" WHERE name = \"lastUpdated\"";
48 $setconfig2 = mysql_query($setconfig);
49 }
50}
51
52?>