summaryrefslogtreecommitdiffstats
path: root/index.php
diff options
context:
space:
mode:
Diffstat (limited to 'index.php')
-rw-r--r--index.php22
1 files changed, 16 insertions, 6 deletions
diff --git a/index.php b/index.php
index a7c71a5..d5654a2 100644
--- a/index.php
+++ b/index.php
@@ -1,16 +1,20 @@
<?php
-require_once(__DIR__.DIRECTORY_SEPARATOR.'lib'.DIRECTORY_SEPARATOR.'commons'.DIRECTORY_SEPARATOR.'functions.common.inc.php');
-require_once(__DIR__.DIRECTORY_SEPARATOR.'lib'.DIRECTORY_SEPARATOR.'functions.stories.inc.php');
+include_once(__DIR__.'/lib/commons/functions.common.inc.php');
+include_once(__DIR__.'/lib/commons/functions.http.inc.php');
+include_once(__DIR__.'/lib/functions.stories.inc.php');
-$storiesDir = __DIR__.DIRECTORY_SEPARATOR.'stories';
+$config = require(__DIR__.'/config/config.inc.php');
+$txt = require(__DIR__.'/config/text.inc.php');
+
+$storiesDir = __DIR__.'/stories';
$storiesDirContent = getDirectoryContent($storiesDir);
$isAuthenticated = true;
$isAdmin = true;
-$currentStory = $_GET['story'];
+$currentStory = getOptionalGetParameter('story');
$currentStoryIsSet = isset($currentStory) && !empty($currentStory);
$stories = array();
$characters = array();
@@ -21,7 +25,7 @@ foreach ($storiesDirContent as $storyName) {
$storyDescription = file_get_contents($storyPath.DIRECTORY_SEPARATOR.'description.txt');
$stories[$storyName] = $storyDescription;
- if ($currentStoryIsSet && $currentStory == $storyName) {
+ if ($currentStoryIsSet && urlencode($currentStory) == $storyName) {
$charactersDirContent = array_diff(scandir($storyPath), array('..', '.'));
foreach ($charactersDirContent as $character) {
@@ -69,6 +73,7 @@ function printEntities($entities, $storyName = NULL) {
<link rel="stylesheet" href="https://www.sl-its.de/css/bootstrap.spacelab.min.css">
<script src="https://www.sl-its.de/js/jquery-1.11.2.min.js"></script>
<script src="js/bootstrap.min.js"></script>
+ <script src="js/stories.js"></script>
<style type="text/css">
.figure-desc {
text-align: justify;
@@ -80,6 +85,9 @@ function printEntities($entities, $storyName = NULL) {
.story-header {
font-size: 2em;
}
+ .navbar {
+ height: 50px;
+ }
.spacer {
height: 55px;
}
@@ -146,7 +154,9 @@ function printEntities($entities, $storyName = NULL) {
<?php
if ($isAuthenticated && $isAdmin) {
if (!$currentStoryIsSet) {
- include(__DIR__.DIRECTORY_SEPARATOR.'lib'.DIRECTORY_SEPARATOR.'new-story-dialog.inc.php');
+ include(__DIR__.'/lib/new-story-dialog.inc.php');
+ } else {
+ include(__DIR__.'/lib/new-character-dialog.inc.php');
}
}
?>