= 0 && $chapter <= $chapters) $pagemax = $pagecount[$chapter] + 1; else $pagemax = 0; $lb = " "; $tab = " "; $stdtab = $tab . $tab; $stdtab2 = $stdtab . $tab; $stdtab3 = $stdtab2 . $tab; $stdtab4 = $stdtab3 . $tab; $stdtab5 = $stdtab4 . $tab; $stdtab6 = $stdtab5 . $tab; $diamond = "◆"; $chapterlist = ""; for ($c = 0; $c <= $chapters; $c++) { $title = "Chapter $c"; if ($c == 0) $title = "Prologue"; if ($c == $chapter) $title = "$title"; $chapterlist .= ($c > 0? $stdtab5 : "") . "$title
$lb"; } $subtitle = ""; $summary = "Summary"; $characters = "Characters"; $nextpagecontent = $lb; $prevpagecontent = $lb; if ($chapter == -3) // Top { $nextchapter = "?chapter=0"; $content = "\"Top\"$lb"; $nextpagecontent = "window.location.href = \"$nextchapter\";$lb"; } else if ($chapter == -2) // Characters { $characters = "$characters"; $nextchapter = "/other/obsolete/"; $content = "\"Characters\"$lb"; $nextpagecontent = "window.location.href = \"$nextchapter\";$lb"; } else if ($chapter == -1) // Summary { $summary = "$summary"; $nextchapter = "/other/obsolete/"; $content = "\"It$lb"; $nextpagecontent = "window.location.href = \"$nextchapter\";$lb"; } else if ($chapter >= 0 && $chapter <= $chapters) // Real chapter { $subtitle = ": Chapter $chapter"; if ($chapter == 0) $subtitle = ": Prologue"; $content = "\"Page$lb"; for ($p = 2; $p <= $pagecount[$chapter]; $p++) { $pageurl = threeDigits($p) . ".png"; $content .= $stdtab4 . "\"Page$lb"; } $content .= $stdtab4 . "\"Next$lb"; $content .= $stdtab4 . "
$lb" . $stdtab5 . "

$lb"; for ($p = 1; $p <= $pagecount[$chapter]; $p++) { if ($p == 1) $content .= $stdtab6 . "$p$lb"; else $content .= $stdtab6 . "$p$lb"; } $content .= $stdtab5 . "

$lb" . $stdtab4 . "
$lb"; $next = $chapter + 1; $prev = $chapter - 1; $nextchapter = ""; $prevchapter = ""; if ($next <= $chapters) $nextchapter = "?chapter=$next"; else $nextchapter = "/other/obsolete/"; if ($chapter > 0) $prevchapter = "?chapter=$prev"; else $prevchapter = "/other/obsolete/"; $nextpagecontent = "page += 1;$lb" . $stdtab3 . "if (page <= $pagemax)$lb" . $stdtab3 . "{" . "$lb" . $stdtab4 . "document.getElementById(\"page\").src = getPageSrc(page);$lb" . $stdtab4 . "updatePageList();$lb" . $stdtab3 . "}" . "$lb" . $stdtab3 . "else$lb" . $stdtab4 . "window.location.href = \"$nextchapter\";$lb"; $prevpagecontent = "if (page > 1)$lb" . $stdtab3 . "{" . "$lb" . $stdtab4 . "page -= 1;$lb" . $stdtab4 . "document.getElementById(\"page\").src = getPageSrc(page);$lb" . $stdtab4 . "updatePageList();$lb" . $stdtab3 . "}$lb"; /*. $stdtab3 . "else$lb" . $stdtab4 . "window.location.href = \"$prevchapter\";$lb";*/ } else // Non-existing chapter { $content = "
$lb" . $stdtab4 . "No such chapter exists.$lb" . $stdtab3 . "
$lb"; } ?> Obsolete Dream
Obsolete Dream