diff options
author | Star Rauchenberger <fefferburbia@gmail.com> | 2009-06-17 15:04:14 -0400 |
---|---|---|
committer | Star Rauchenberger <fefferburbia@gmail.com> | 2009-06-17 15:04:14 -0400 |
commit | d87d85235d2fa2a3e2bc97344377fcc37f88fa9c (patch) | |
tree | d83ecd86dc8abecccae6674a7bf6daa0e3454368 | |
parent | 223b7f80580a992d79251215a2de4eedcc69736c (diff) | |
download | pillowcase-d87d85235d2fa2a3e2bc97344377fcc37f88fa9c.tar.gz pillowcase-d87d85235d2fa2a3e2bc97344377fcc37f88fa9c.tar.bz2 pillowcase-d87d85235d2fa2a3e2bc97344377fcc37f88fa9c.zip |
Added season information to archives
-rwxr-xr-x | .htaccess | 2 | ||||
-rw-r--r--[-rwxr-xr-x] | pages/archive.php | 48 | ||||
-rwxr-xr-x | pages/season.php | 34 | ||||
-rwxr-xr-x | style.css | 5 |
4 files changed, 82 insertions, 7 deletions
diff --git a/.htaccess b/.htaccess index 84bfa5b..317cda7 100755 --- a/.htaccess +++ b/.htaccess | |||
@@ -10,4 +10,6 @@ RewriteRule images/ / [R] | |||
10 | RewriteCond %{REQUEST_FILENAME} .png | 10 | RewriteCond %{REQUEST_FILENAME} .png |
11 | RewriteRule images/comics/(.+).png /comic.php?id=$1 [L] | 11 | RewriteRule images/comics/(.+).png /comic.php?id=$1 [L] |
12 | RewriteCond %{REQUEST_FILENAME} .htm | 12 | RewriteCond %{REQUEST_FILENAME} .htm |
13 | RewriteRule season(.+).htm /index.php?area=season&season=$1 [QSA,L] | ||
14 | RewriteCond %{REQUEST_FILENAME} .htm | ||
13 | RewriteRule (.+).htm /index.php?area=$1 [QSA,L] | 15 | RewriteRule (.+).htm /index.php?area=$1 [QSA,L] |
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); |
8 | while ($getcomics3 = mysql_fetch_array($getcomics2)) | 15 | while ($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> | ||
diff --git a/pages/season.php b/pages/season.php new file mode 100755 index 0000000..6b45a27 --- /dev/null +++ b/pages/season.php | |||
@@ -0,0 +1,34 @@ | |||
1 | <?php | ||
2 | |||
3 | if (is_numeric($_GET['season'])) | ||
4 | { | ||
5 | $getseason = "SELECT * FROM seasons WHERE season_id = " . $_GET['season']; | ||
6 | $getseason2 = mysql_query($getseason); | ||
7 | $getseason3 = mysql_fetch_array($getseason2); | ||
8 | } | ||
9 | |||
10 | if (isset($getseason3) && ($getseason3['season_id'] == $_GET['season'])) | ||
11 | { | ||
12 | |||
13 | ?> | ||
14 | <H1>Archive for Season <?php echo($_GET['season']); ?></H1> | ||
15 | |||
16 | <UL ID="archive"> | ||
17 | <?php | ||
18 | |||
19 | $getcomics = "SELECT * FROM comics WHERE status = \"publish\" AND comic_id >= " . $getseason3['first_comic_id'] . " AND comic_id <= " . $getseason3['last_comic_id'] . " ORDER BY comic_id ASC"; | ||
20 | $getcomics2 = mysql_query($getcomics); | ||
21 | while ($getcomics3 = mysql_fetch_array($getcomics2)) | ||
22 | { | ||
23 | ?> <LI><A HREF="/comic<?php echo($getcomics3['comic_id']); ?>.htm"><?php echo($getcomics3['title']); ?></A></LI> | ||
24 | <?php | ||
25 | } | ||
26 | |||
27 | ?> </UL> | ||
28 | <?php | ||
29 | |||
30 | } else { | ||
31 | include('pages/comic.php'); | ||
32 | } | ||
33 | |||
34 | ?> | ||
diff --git a/style.css b/style.css index 0699038..580235b 100755 --- a/style.css +++ b/style.css | |||
@@ -97,3 +97,8 @@ ul#archive { | |||
97 | a img { | 97 | a img { |
98 | border: 0; | 98 | border: 0; |
99 | } | 99 | } |
100 | |||
101 | table#seasons { | ||
102 | text-align: center; | ||
103 | width: 100%; | ||
104 | } | ||