summary refs log tree commit diff stats
path: root/header.php
blob: 3b0dc8b451969c616d78c5ec99e7b3901bcc53d3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<?php

if (isset($title))
{
	$rtitle = 'Pillowcase - ' . $title;
} else {
	$rtitle = 'Pillowcase';
}

?><HTML>
	<HEAD>
		<TITLE><?php echo($rtitle); ?></TITLE>
		<LINK REL="stylesheet" HREF="/style.css">
	</HEAD>

	<BODY>
		<DIV ID="wrap">
			<DIV ID="header">
				<A HREF="/"><H1>Pillowcase</H1></A>
			</DIV>

<?php

include_once('db.php');

$getlast = mysql_fetch_array(mysql_query("SELECT * FROM config WHERE name = \"lastUpdated\""));
$last = $getlast['value'];
if ($last != date('md'))
{
	$getpending = "SELECT * FROM pending ORDER BY id ASC LIMIT 0,1";
	$getpending2 = mysql_query($getpending);
	$getpending3 = mysql_fetch_array($getpending2);
	if (!empty($getpending3))
	{
	        $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']) . "\")";
	        $inscomic2 = mysql_query($inscomic) or die($inscomic);

	        $delcomic = "DELETE FROM pending WHERE id = " . $getpending3['id'];
	        $delcomic2 = mysql_query($delcomic) or die($delcomic);

		$setconfig = "UPDATE config SET value = \"" . date('md') . "\" WHERE name = \"lastUpdated\"";
		$setconfig2 = mysql_query($setconfig);
	}
}

?>