diff options
-rw-r--r-- | .hgignore | 1 | ||||
-rw-r--r-- | .htaccess | 10 | ||||
-rw-r--r-- | about.php | 15 | ||||
-rw-r--r-- | archive.php | 23 | ||||
-rw-r--r-- | contribute.php | 15 | ||||
-rwxr-xr-x | db.php | 8 | ||||
-rw-r--r-- | footer.php | 13 | ||||
-rw-r--r-- | header.php | 46 | ||||
-rwxr-xr-x | index.php | 112 | ||||
-rwxr-xr-x | style.css | 92 | ||||
-rw-r--r-- | title.png | bin | 0 -> 7599 bytes |
11 files changed, 335 insertions, 0 deletions
diff --git a/.hgignore b/.hgignore new file mode 100644 index 0000000..47241b6 --- /dev/null +++ b/.hgignore | |||
@@ -0,0 +1 @@ | |||
images/ | |||
diff --git a/.htaccess b/.htaccess new file mode 100644 index 0000000..b09d5dc --- /dev/null +++ b/.htaccess | |||
@@ -0,0 +1,10 @@ | |||
1 | RewriteEngine On | ||
2 | RewriteRule comic([0-9]+).htm /index.php?id=$1 [QSA,L] | ||
3 | RewriteRule scripts/ / [R] | ||
4 | RewriteRule config.php / [R] | ||
5 | RewriteRule header.php / [R] | ||
6 | RewriteRule footer.php / [R] | ||
7 | RewriteCond %{REQUEST_FILENAME} !.png | ||
8 | RewriteRule images/ / [R] | ||
9 | RewriteCond %{REQUEST_FILENAME} .htm | ||
10 | RewriteRule (.+).htm $1.php [QSA] | ||
diff --git a/about.php b/about.php new file mode 100644 index 0000000..51d7383 --- /dev/null +++ b/about.php | |||
@@ -0,0 +1,15 @@ | |||
1 | <?php | ||
2 | |||
3 | include('header.php'); | ||
4 | |||
5 | ?> | ||
6 | <H1>About</H1> | ||
7 | |||
8 | <P> | ||
9 | This page is soooo under construction. Hopefully Starla'll be bothered to finish it someday. | ||
10 | </P> | ||
11 | <?php | ||
12 | |||
13 | include('footer.php'); | ||
14 | |||
15 | ?> | ||
diff --git a/archive.php b/archive.php new file mode 100644 index 0000000..02fffbf --- /dev/null +++ b/archive.php | |||
@@ -0,0 +1,23 @@ | |||
1 | <?php | ||
2 | |||
3 | include('header.php'); | ||
4 | |||
5 | ?> <H1>Archive</H1> | ||
6 | |||
7 | <UL ID="archive"> | ||
8 | <?php | ||
9 | |||
10 | $getimages = "SELECT * FROM images ORDER BY id ASC"; | ||
11 | $getimages2 = mysql_query($getimages); | ||
12 | while ($getimages3 = mysql_fetch_array($getimages2)) | ||
13 | { | ||
14 | ?> <LI><A HREF="/comic<?php echo($getimages3['id']); ?>.htm"><?php echo($getimages3['title']); ?></A></LI> | ||
15 | <?php | ||
16 | } | ||
17 | |||
18 | ?> </UL> | ||
19 | <?php | ||
20 | |||
21 | include('footer.php'); | ||
22 | |||
23 | ?> | ||
diff --git a/contribute.php b/contribute.php new file mode 100644 index 0000000..363aab3 --- /dev/null +++ b/contribute.php | |||
@@ -0,0 +1,15 @@ | |||
1 | <?php | ||
2 | |||
3 | include('header.php'); | ||
4 | |||
5 | ?> | ||
6 | <H1>Contribute</H1> | ||
7 | |||
8 | <P> | ||
9 | This page is soooo under construction. Hopefully Starla'll be bothered to finish it someday. | ||
10 | </P> | ||
11 | <?php | ||
12 | |||
13 | include('footer.php'); | ||
14 | |||
15 | ?> | ||
diff --git a/db.php b/db.php new file mode 100755 index 0000000..d584c4c --- /dev/null +++ b/db.php | |||
@@ -0,0 +1,8 @@ | |||
1 | <?php | ||
2 | |||
3 | include('../security/pillowcase.php'); | ||
4 | |||
5 | mysql_connect($dbhost, $dbuser, $dbpasswd); | ||
6 | mysql_select_db($dbname); | ||
7 | |||
8 | ?> | ||
diff --git a/footer.php b/footer.php new file mode 100644 index 0000000..f02c8dc --- /dev/null +++ b/footer.php | |||
@@ -0,0 +1,13 @@ | |||
1 | |||
2 | <UL CLASS="navbar"> | ||
3 | <LI><A HREF="/about.htm">About</A></LI> | ||
4 | <LI><A HREF="/archive.htm">Archive</A></LI> | ||
5 | <LI><A HREF="/contribute.htm">Contribute</A></LI> | ||
6 | </UL> | ||
7 | </DIV> | ||
8 | |||
9 | <DIV ID="footer"> | ||
10 | Pillowcase is a <A HREF="http://fourisland.com/">Four Island</A> project. It is owned by Starla Insigna.</A> | ||
11 | </DIV> | ||
12 | </BODY> | ||
13 | </HTML> | ||
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 | |||
3 | if (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 | |||
24 | include_once('db.php'); | ||
25 | |||
26 | $getlast = mysql_fetch_array(mysql_query("SELECT * FROM config WHERE name = \"lastUpdated\"")); | ||
27 | $last = $getlast['value']; | ||
28 | if ($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 | ?> | ||
diff --git a/index.php b/index.php new file mode 100755 index 0000000..a902cce --- /dev/null +++ b/index.php | |||
@@ -0,0 +1,112 @@ | |||
1 | <?php | ||
2 | |||
3 | include('db.php'); | ||
4 | |||
5 | ob_start(); | ||
6 | |||
7 | $posts = array(); | ||
8 | |||
9 | if (isset($_GET['id'])) | ||
10 | { | ||
11 | $getimages = "SELECT * FROM images WHERE id = " . $_GET['id']; | ||
12 | } else { | ||
13 | $getimages = "SELECT * FROM images ORDER BY id DESC LIMIT 0,1"; | ||
14 | } | ||
15 | $getimages2 = mysql_query($getimages); | ||
16 | $getimage3 = mysql_fetch_array($getimages2); | ||
17 | |||
18 | ?> | ||
19 | <DIV CLASS="post"> | ||
20 | <DIV CLASS="date" TITLE="<?php echo(date('F jS Y H:i:s', strtotime($getimage3['pubDate']))); ?>"> | ||
21 | <?php echo(date('M',strtotime($getimage3['pubDate']))); ?><BR> | ||
22 | <?php echo(date('j',strtotime($getimage3['pubDate']))); ?><BR> | ||
23 | <?php echo(date('Y',strtotime($getimage3['pubDate']))); ?> | ||
24 | |||
25 | </DIV> | ||
26 | |||
27 | <DIV CLASS="title"> | ||
28 | <H1><?php echo($getimage3['title']); ?></H1> | ||
29 | </DIV> | ||
30 | </DIV> | ||
31 | |||
32 | <DIV CLASS="image"> | ||
33 | <IMG SRC="/images/<?php echo($getimage3['filename']); ?>" ALT="<?php echo(htmlentities($getimage3['text'])); ?>" TITLE="<?php echo(htmlentities($getimage3['text'])); ?>"> | ||
34 | </DIV> | ||
35 | |||
36 | <DIV CLASS="cleardiv"></DIV> | ||
37 | |||
38 | <UL CLASS="navbar"> | ||
39 | <?php | ||
40 | |||
41 | $id = $getimage3['id']; | ||
42 | $all = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM images")); | ||
43 | $all = $all['COUNT(*)']; | ||
44 | |||
45 | if ($id > 2) | ||
46 | { | ||
47 | ?> <LI><A HREF="/comic1.htm">First</a></LI> | ||
48 | <?php | ||
49 | } | ||
50 | |||
51 | if ($id > 1) | ||
52 | { | ||
53 | ?> <LI><A HREF="/comic<?php echo($id-1); ?>.htm">Back</A></LI> | ||
54 | <?php | ||
55 | } | ||
56 | |||
57 | if ($id < $all) | ||
58 | { | ||
59 | if ($id != ($all-1)) | ||
60 | { | ||
61 | ?> <LI><A HREF="/comic<?php echo($id+1); ?>.htm">Next</A></LI> | ||
62 | <?php | ||
63 | ?> <LI><A HREF="/">Today</A></LI> | ||
64 | <?php | ||
65 | } else { | ||
66 | ?> <LI><A HREF="/">Next</A></LI> | ||
67 | <?php | ||
68 | } | ||
69 | } | ||
70 | |||
71 | $getnpending = "SELECT COUNT(*) FROM pending"; | ||
72 | $getnpending2 = mysql_query($getnpending); | ||
73 | $getnpending3 = mysql_fetch_array($getnpending2); | ||
74 | $numpending = $getnpending3['COUNT(*)']; | ||
75 | |||
76 | ?> | ||
77 | </UL> | ||
78 | |||
79 | <DIV CLASS="cleardiv"></DIV> | ||
80 | |||
81 | <P> | ||
82 | pillowcase - the result of an obsession with cute, plush objects that talk nonsense | ||
83 | </P> | ||
84 | |||
85 | <P> | ||
86 | because we luv <A HREF="http://xkcd.com">xkcd</A>, make sure you look for the alt text | ||
87 | </P> | ||
88 | |||
89 | <P> | ||
90 | <?php if ($numpending == 1): ?> | ||
91 | there is 1 comic in the pending queue, which means that if Starla wants to be lazy and can't be bothered to update, she can relax for 1 more day before she starts getting angry emails | ||
92 | <?php elseif ($numpending == 0): ?> | ||
93 | oh dear, there aren't any comics in the pending queue, which means that if Starla doesn't hurry up, there may not be a comic tomorrow | ||
94 | <?php elseif ($numpending > 100): ?> | ||
95 | OMG! There are <?php echo($numpending); ?> comics in the pending queue! Starla, you relax as long as you want! | ||
96 | <?php else: ?> | ||
97 | there are <?php echo($numpending); ?> comics in the pending queue, which means that if Starla wants to be lazy and can't be bothered to update, she can relax for <?php echo($numpending); ?> days before she starts getting angry emails | ||
98 | <?php endif; ?> | ||
99 | </P> | ||
100 | <?php | ||
101 | |||
102 | $contents = ob_get_contents(); | ||
103 | ob_end_clean(); | ||
104 | |||
105 | $title = $getimage3['title']; | ||
106 | include('header.php'); | ||
107 | |||
108 | echo($contents); | ||
109 | |||
110 | include('footer.php'); | ||
111 | |||
112 | ?> | ||
diff --git a/style.css b/style.css new file mode 100755 index 0000000..bf3f30d --- /dev/null +++ b/style.css | |||
@@ -0,0 +1,92 @@ | |||
1 | div#wrap { | ||
2 | margin: 0 auto; | ||
3 | width: 31.25em; | ||
4 | } | ||
5 | |||
6 | div.post { | ||
7 | clear: both; | ||
8 | } | ||
9 | |||
10 | div.date { | ||
11 | float: left; | ||
12 | background-color: #cccccc; | ||
13 | text-align: center; | ||
14 | text-transform: uppercase; | ||
15 | font-family: Arial; | ||
16 | padding: 4px; | ||
17 | margin-right: 4px; | ||
18 | width: 3em; | ||
19 | height: 3.5em; | ||
20 | } | ||
21 | |||
22 | div.title { | ||
23 | padding: 4px; | ||
24 | width: 25em; | ||
25 | margin-bottom: 1em; | ||
26 | min-height: 3.5em; | ||
27 | margin: 0px 0px 2px; | ||
28 | letter-spacing: -1px; | ||
29 | font-style: "Trebuchet MS", Tahoma, Arial; | ||
30 | line-height: 100%; | ||
31 | padding-bottom: 3px; | ||
32 | } | ||
33 | |||
34 | h1 { | ||
35 | text-align: center; | ||
36 | font-family: Arial; | ||
37 | } | ||
38 | |||
39 | div.cleardiv { | ||
40 | clear: both; | ||
41 | } | ||
42 | |||
43 | a { | ||
44 | text-decoration: none; | ||
45 | color: black; | ||
46 | } | ||
47 | |||
48 | a:hover, a:focus, a:active { | ||
49 | text-decoration: underline; | ||
50 | } | ||
51 | |||
52 | ul.navbar li { | ||
53 | background-color: #cccccc; | ||
54 | text-align: center; | ||
55 | font-family: Arial; | ||
56 | padding: 4px; | ||
57 | text-transform: uppercase; | ||
58 | margin-left: 2px; | ||
59 | margin-right: 2px; | ||
60 | display: inline; | ||
61 | } | ||
62 | |||
63 | ul.navbar { | ||
64 | list-style-type: none; | ||
65 | text-align: center; | ||
66 | padding-left: 0; | ||
67 | } | ||
68 | |||
69 | div.image { | ||
70 | margin: 0 auto; | ||
71 | width: 250px; | ||
72 | } | ||
73 | |||
74 | div#header h1 { | ||
75 | text-indent: -9999px; | ||
76 | background-image: url(/title.png); | ||
77 | height: 115px; | ||
78 | width: 500px; | ||
79 | } | ||
80 | |||
81 | div#footer { | ||
82 | margin-top: 4px; | ||
83 | font-size: x-small; | ||
84 | color: gray; | ||
85 | text-align: center; | ||
86 | } | ||
87 | |||
88 | ul#archive { | ||
89 | list-style-type: none; | ||
90 | text-align: center; | ||
91 | padding-left: 0; | ||
92 | } | ||
diff --git a/title.png b/title.png new file mode 100644 index 0000000..951cc5b --- /dev/null +++ b/title.png | |||
Binary files differ | |||