blob: ebdee99e128f4bb0898d5a04367527dbe834b06a (
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
47
48
49
|
<?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 = "SELECT * FROM config WHERE name = \"lastUpdated\"";
$getlast2 = mysql_query($getlast);
$getlast3 = mysql_fetch_array($getlast2);
$last = $getlast3['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);
}
}
?>
|