summaryrefslogtreecommitdiffstats
path: root/index.php
diff options
context:
space:
mode:
Diffstat (limited to 'index.php')
-rw-r--r--index.php27
1 files changed, 23 insertions, 4 deletions
diff --git a/index.php b/index.php
index 6ccf8d7..85b72ff 100644
--- a/index.php
+++ b/index.php
@@ -15,7 +15,8 @@ $characters = array();
foreach ($storiesDirContent as $storyName) {
$storyPath = $storiesDir.DIRECTORY_SEPARATOR.$storyName;
if (is_dir($storyPath)) {
- array_push($stories, $storyName);
+ $storyDescription = file_get_contents($storyPath.DIRECTORY_SEPARATOR.'description.txt');
+ $stories[$storyName] = $storyDescription;
if ($currentStoryIsSet && $currentStory == $storyName) {
$charactersDirContent = array_diff(scandir($storyPath), array('..', '.'));
foreach ($charactersDirContent as $character) {
@@ -72,8 +73,8 @@ $currentStoryName = visibleName($currentStory);
<ul class="nav navbar-nav">
<?php
foreach ($stories as $storyName) {
- $cssClass = ($storyName == $currentStory) ? " class=\"active\"" : "";
$visibleName = visibleName($storyName);
+ $cssClass = ($visibleName == $currentStoryName) ? " class=\"active\"" : "";
?>
<li<?=$cssClass;?>><a href="index.php?story=<?=$storyName;?>"><?=$visibleName;?></a></li>
<?php
@@ -85,9 +86,10 @@ $currentStoryName = visibleName($currentStory);
</nav>
<div class="spacer"></div>
<div class="container">
+<?php if ($currentStoryIsSet) { ?>
<div class="row">
<div class="col-md-7 text-center">
- <img class="img-fluid mb-3 mb-md-0 story-logo" src="<?=$currentStory?>/logo.png" alt="<?=$currentStoryName;?>" title="<?=$currentStoryName;?>">
+ <img class="img-fluid mb-3 mb-md-0 story-logo" src="stories/<?=urlencode($currentStory)?>/logo.png" alt="<?=$currentStoryName;?>" title="<?=$currentStoryName;?>">
</div>
</div>
<?php
@@ -97,7 +99,7 @@ $currentStoryName = visibleName($currentStory);
<!-- <?=$characterName;?> -->
<div class="row">
<div class="col-md-7 text-center">
- <img class="img-fluid rounded mb-3 mb-md-0 figure-pic" src="<?=$currentStory?>/<?=$character;?>/passphoto.png" alt="<?=$characterName;?>" title="<?=$characterName;?>">
+ <img class="img-fluid rounded mb-3 mb-md-0 figure-pic" src="stories/<?=urlencode($currentStory)?>/<?=urlencode($character);?>/passphoto.png" alt="<?=$characterName;?>" title="<?=$characterName;?>">
</div>
<div class="col-md-5">
<h3><?=$characterName;?></h3>
@@ -109,6 +111,23 @@ $currentStoryName = visibleName($currentStory);
<hr>
<?php
}
+} else {
+ foreach ($stories as $story=>$storyDescription) {
+ $storyName = visibleName($story);
+?>
+ <div class="row">
+ <div class="col-md-7 text-center">
+ <img class="img-fluid mb-3 mb-md-0 story-logo" src="stories/<?=urlencode($story);?>/logo.png" alt="<?=$storyName;?>" title="<?=$storyName;?>">
+ </div>
+ <div class="col-md-5">
+ <h3><?=$storyName;?></h3>
+ <p class="figure-desc"><?=$storyDescription;?></p>
+ </div>
+ </div>
+ </div>
+<?
+ }
+}
?>
</div>
</body>