diff options
author | steckbrief <steckbrief@chefmail.de> | 2017-12-10 20:22:33 +0100 |
---|---|---|
committer | steckbrief <steckbrief@chefmail.de> | 2017-12-10 20:22:33 +0100 |
commit | 2ec5cbc2aa2fe992d2cccaf6d160950adef521ef (patch) | |
tree | 726ff2e5907825469d81ea8af9e900a864ebc4a6 /index.php | |
parent | 6bf09a069577fa9fcefdb0f92da81001465a50e0 (diff) |
create story and character improved
Diffstat (limited to '')
-rw-r--r-- | index.php | 22 |
1 files changed, 16 insertions, 6 deletions
@@ -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'); } } ?> |