summary refs log tree commit diff stats
path: root/header.php
diff options
context:
space:
mode:
Diffstat (limited to 'header.php')
-rw-r--r--header.php46
1 files changed, 46 insertions, 0 deletions
diff --git a/header.php b/header.php new file mode 100644 index 0000000..3b0dc8b --- /dev/null +++ b/header.php
@@ -0,0 +1,46 @@
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('db.php');
25
26$getlast = mysql_fetch_array(mysql_query("SELECT * FROM config WHERE name = \"lastUpdated\""));
27$last = $getlast['value'];
28if ($last != date('md'))
29{
30 $getpending = "SELECT * FROM pending ORDER BY id ASC LIMIT 0,1";
31 $getpending2 = mysql_query($getpending);
32 $getpending3 = mysql_fetch_array($getpending2);
33 if (!empty($getpending3))
34 {
35 $inscomic = "INSERT INTO images (title,filename, text) VALUES (\"" . mysql_real_escape_string($getpending3['title']) . "\",\"" . mysql_real_escape_string($getpending3['filename']) . "\",\"" . mysql_real_escape_string($getpending3['text']) . "\")";
36 $inscomic2 = mysql_query($inscomic) or die($inscomic);
37
38 $delcomic = "DELETE FROM pending WHERE id = " . $getpending3['id'];
39 $delcomic2 = mysql_query($delcomic) or die($delcomic);
40
41 $setconfig = "UPDATE config SET value = \"" . date('md') . "\" WHERE name = \"lastUpdated\"";
42 $setconfig2 = mysql_query($setconfig);
43 }
44}
45
46?>