diff options
author | Luke Shumaker <LukeShu@sbcglobal.net> | 2012-05-04 09:48:27 -0700 |
---|---|---|
committer | Luke Shumaker <LukeShu@sbcglobal.net> | 2012-05-04 09:48:27 -0700 |
commit | 247f5d615539784c46b5c7c5b35b6ee348e04151 (patch) | |
tree | 6744bd1584ad1239417e4c8e148f98d1d27909eb /issue.php |
Diffstat (limited to 'issue.php')
-rw-r--r-- | issue.php | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/issue.php b/issue.php new file mode 100644 index 0000000..3a3ed6f --- /dev/null +++ b/issue.php @@ -0,0 +1,52 @@ +<!DOCTYPE html> +<?php +function page($page, $count=1) { + if (file_exists("Page${page}.pdf")) { + echo "<td id='page${page}' class='pages-${count}' colspan='${count}'>"; + echo "<img src='Page${page}.small.jpg' />"; + echo "</td>\n"; + } else { + echo "<td class='pages-${count} filler'> </td>\n"; + } +} + +function pages($first, $last) { + if (file_exists("Pages${first}-${last}.pdf")) { + page("s${first}-${last}", ($last-$first)+1); + } else { + $exists = false; + for ($i=$first; $i<=$last; $i++) { + $exists |= file_exists("Page${i}.pdf"); + } + if ($exists) { + for ($i=$first; $i<=$last; $i++) { + page($i); + } + } else { + return false; + } + } + return true; +} + +?> +<html dir="ltr" lang="en-US"> + <head> + <meta charset="UTF-8" /> + <title>North Star issue <?php echo basename(dirname(__FILE__)) ?></title> + <link rel="stylesheet" href="view.css" .> + <script type="text/javascript" src="/wp-includes/js/jquery/jquery.js?ver=1.7.1"></script> + <script type="text/javascript" src="view.js"></script> + </head> + <body> + <div class="menu">Please give the paper a moment to load.</div> + <div class="spacer"> </div> + <table class="paper"> + <?php $i=0; $still_going=true; while ($still_going) { ?> + <tr> + <?php $still_going = pages($i, $i+1); $i+=2; ?> + </tr> + <?php } ?> + </table> + </body> +</html> |