summary refs log tree commit diff stats
path: root/pages/archive.php
diff options
context:
space:
mode:
authorStar Rauchenberger <fefferburbia@gmail.com>2009-06-17 15:04:14 -0400
committerStar Rauchenberger <fefferburbia@gmail.com>2009-06-17 15:04:14 -0400
commitd87d85235d2fa2a3e2bc97344377fcc37f88fa9c (patch)
treed83ecd86dc8abecccae6674a7bf6daa0e3454368 /pages/archive.php
parent223b7f80580a992d79251215a2de4eedcc69736c (diff)
downloadpillowcase-d87d85235d2fa2a3e2bc97344377fcc37f88fa9c.tar.gz
pillowcase-d87d85235d2fa2a3e2bc97344377fcc37f88fa9c.tar.bz2
pillowcase-d87d85235d2fa2a3e2bc97344377fcc37f88fa9c.zip
Added season information to archives
Diffstat (limited to 'pages/archive.php')
-rw-r--r--[-rwxr-xr-x]pages/archive.php48
1 files changed, 41 insertions, 7 deletions
diff --git a/pages/archive.php b/pages/archive.php index c1cd8ab..85a73d5 100755..100644 --- a/pages/archive.php +++ b/pages/archive.php
@@ -1,14 +1,48 @@
1 <H1>Archive</H1> 1 <H1>Archives</H1>
2
3 <TABLE ID="seasons">
4 <TR>
5 <TH>Season</TH>
6 <TH>First Comic</TH>
7 <TH>Last Comic</TH>
8 <TH>Comics</TH>
9 </TR>
2 10
3 <UL ID="archive">
4<?php 11<?php
5 12
6$getcomics = "SELECT * FROM comics WHERE status = \"publish\" ORDER BY comic_id ASC"; 13$getseasons = "SELECT * FROM seasons ORDER BY season_id ASC";
7$getcomics2 = mysql_query($getcomics); 14$getseasons2 = mysql_query($getseasons);
8while ($getcomics3 = mysql_fetch_array($getcomics2)) 15while ($getseasons3 = mysql_fetch_array($getseasons2))
9{ 16{
10?> <LI><A HREF="/comic<?php echo($getcomics3['comic_id']); ?>.htm"><?php echo($getcomics3['title']); ?></A></LI> 17 $getfc = "SELECT * FROM comics WHERE comic_id = " . $getseasons3['first_comic_id'];
18 $getfc2 = mysql_query($getfc);
19 $getfc3 = mysql_fetch_array($getfc2);
20
21 if (!is_null($getseasons3['last_comic_id']))
22 {
23 $getlc = "SELECT * FROM comics WHERE comic_id = " . $getseasons3['last_comic_id'];
24 $getlc2 = mysql_query($getlc);
25 $getlc3 = mysql_fetch_array($getlc2);
26
27 $count = $getseasons3['last_comic_id'] - ($getseasons3['first_comic_id']-1);
28 } else {
29 $getcnt = "SELECT COUNT(*) FROM comics WHERE comic_id >= " . $getseasons3['first_comic_id'];
30 $getcnt2 = mysql_query($getcnt);
31 $getcnt3 = mysql_fetch_array($getcnt2);
32
33 $count = $getcnt3[0];
34 }
35
36?>
37 <TR>
38 <TD><A HREF="/season<?php echo($getseasons3['season_id']); ?>.htm">1</A></TD>
39 <TD><A HREF="/comic<?php echo($getfc3['comic_id']); ?>.htm"><?php echo($getfc3['title']); ?></A><BR />(<?php echo(date('F j Y',strtotime(get_meta($getfc3['id'], 'pubDate')))); ?>)</TD>
40 <TD><?php if (!is_null($getseasons3['last_comic_id'])) { ?><A HREF="/comic<?php echo($getlc3['comic_id']); ?>.htm"><?php echo($getlc3['title']); ?></A><BR />(<?php echo(date('F j Y',strtotime(get_meta($getlc3['id'], 'pubDate')))); ?>)<?php } else { ?><EM>N/A</EM><?php } ?></TD>
41 <TD><?php echo($count); ?></TD>
42 </TR>
11<?php 43<?php
44
12} 45}
13 46
14?> </UL> 47?>
48 </TABLE>