summary refs log tree commit diff stats
path: root/index.php
blob: f163cc8999059a55f49f8523cfc349775d2387a8 (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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
<?php

include('db.php');

ob_start();

if (isset($_GET['id']))
{
	$getimage = "SELECT * FROM images WHERE id = " . $_GET['id'];
} else {
	$getimage = "SELECT * FROM images ORDER BY id DESC LIMIT 0,1";
}
$getimage2 = mysql_query($getimage);
$getimage3 = mysql_fetch_array($getimage2);

?>
			<DIV CLASS="post">
				<DIV CLASS="date" TITLE="<?php echo(date('F jS Y H:i:s', strtotime($getimage3['pubDate']))); ?>">
					<?php echo(date('M',strtotime($getimage3['pubDate']))); ?><BR>
					<?php echo(date('j',strtotime($getimage3['pubDate']))); ?><BR>
					<?php echo(date('Y',strtotime($getimage3['pubDate']))); ?>

				</DIV>

				<DIV CLASS="title">
					<H2><?php echo($getimage3['title']); ?></H2>
<?php

if ($getimage3['author'] != '')
{
?>
					<CENTER><SMALL>Guest comic by <?php echo($getimage3['author']); ?></SMALL></CENTER>
<?php
}

?>
				</DIV>
			</DIV>

			<DIV CLASS="image">
				<IMG SRC="/images/<?php echo($getimage3['filename']); ?>" ALT="<?php echo(htmlentities($getimage3['text'])); ?>" TITLE="<?php echo(htmlentities($getimage3['text'])); ?>">
			</DIV>

			<DIV CLASS="cleardiv"></DIV>

			<UL CLASS="navbar">
<?php

$id = $getimage3['id'];

$cntimages = "SELECT COUNT(*) FROM images";
$cntimages2 = mysql_query($cntimages);
$cntimages3 = mysql_fetch_array($cntimages2);
$all = $cntimages3['COUNT(*)'];

if ($id > 2)
{
?>				<LI><A HREF="/comic1.htm">First</a></LI>
<?php
}

if ($id > 1)
{
?>				<LI><A HREF="/comic<?php echo($id-1); ?>.htm">Back</A></LI>
<?php
}

if ($id < $all)
{
	if ($id != ($all-1))
	{
?>				<LI><A HREF="/comic<?php echo($id+1); ?>.htm">Next</A></LI>
<?php
?>				<LI><A HREF="/">Today</A></LI>
<?php
	} else {
?>				<LI><A HREF="/">Next</A></LI>
<?php
	}
}

$cntpending = "SELECT COUNT(*) FROM pending";
$cntpending2 = mysql_query($cntpending);
$cntpending3 = mysql_fetch_array($cntpending2);
$numpending = $cntpending3['COUNT(*)'];

?>
			</UL>

			<DIV CLASS="cleardiv"></DIV>

			<P>
				pillowcase - the result of an obsession with cute, plush objects that talk nonsense
			</P>

			<P>
				because we luv <A HREF="http://xkcd.com">xkcd</A>, make sure you look for the alt text
			</P>

			<P>
<?php if ($numpending == 1): ?>
				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
<?php elseif ($numpending == 0): ?>
				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
<?php elseif ($numpending > 100): ?>
				OMG! There are <?php echo($numpending); ?> comics in the pending queue! Starla, you relax as long as you want!
<?php else: ?>
				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
<?php endif; ?>
			</P>
<?php

$contents = ob_get_contents();
ob_end_clean();

$title = $getimage3['title'];
include('header.php');

echo($contents);

ob_start();

?>
<script>
var idcomments_acct = '872cea8b0422b8db211ca6ebdbaa199a';
var idcomments_post_id;
var idcomments_post_url = 'http://pillowcase.fourisland.com/comic<?php echo($getimage3['id']); ?>.htm';
var idcomments_post_title = '<?php echo($getimage3['title']); ?>';
</script>
<span id="IDCommentsPostTitle" style="display:none"></span>
<script type='text/javascript' src='http://www.intensedebate.com/js/genericCommentWrapperV2.js'></script>
<?php

$addendum = ob_get_contents();
ob_end_clean();

include('footer.php');

?>