summaryrefslogtreecommitdiff
path: root/issue.php
diff options
context:
space:
mode:
Diffstat (limited to 'issue.php')
-rw-r--r--issue.php52
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>