diff options
author | steckbrief <steckbrief@chefmail.de> | 2017-11-26 14:40:51 +0100 |
---|---|---|
committer | steckbrief <steckbrief@chefmail.de> | 2017-11-26 14:40:51 +0100 |
commit | 248eb1accdf7e92dd0572cb61bac523141662a69 (patch) | |
tree | 539f755675908102508c5c72ceb07eb68d253b1c /index.php | |
parent | 58cd5cf83f6213139e90c6ad58f0f37bb0a6b8c6 (diff) | |
parent | e753c462386b8dc6a0c9f32c2844f2ee86412e9b (diff) |
Merge branch 'master' of repos.thedevstack.de:user/tristan/serienfiguren
Diffstat (limited to 'index.php')
-rw-r--r-- | index.php | 47 |
1 files changed, 24 insertions, 23 deletions
@@ -1,24 +1,25 @@ <?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'); -$tvSeriesDir = __DIR__.DIRECTORY_SEPARATOR.'stories'; +$storiesDir = __DIR__.DIRECTORY_SEPARATOR.'stories'; -$tvSeriesDirContent = array_diff(scandir($tvSeriesDir), array('..', '.')); +$storiesDirContent = getDirectoryContent($storiesDir); -$currentTvSeries = $_GET["series"]; -$currentTvSeriesIsSet = isset($currentTvSeries) && !empty($currentTvSeries); -$tvSeries = array(); +$currentStory = $_GET['story']; +$currentStoryIsSet = isset($currentStory) && !empty($currentStory); +$stories = array(); $characters = array(); -foreach ($tvSeriesDirContent as $tvSeriesName) { - $tvSeriesPath = $tvSeriesDir.DIRECTORY_SEPARATOR.$tvSeriesName; - if (is_dir($tvSeriesPath)) { - array_push($tvSeries, $tvSeriesName); - if ($currentTvSeriesIsSet && $currentTvSeries == $tvSeriesName) { - $charactersDirContent = array_diff(scandir($tvSeriesPath), array('..', '.')); +foreach ($storiesDirContent as $storyName) { + $storyPath = $storiesDir.DIRECTORY_SEPARATOR.$storyName; + if (is_dir($storyPath)) { + array_push($stories, $storyName); + if ($currentStoryIsSet && $currentStory == $storyName) { + $charactersDirContent = array_diff(scandir($storyPath), array('..', '.')); foreach ($charactersDirContent as $character) { - $characterPath = $tvSeriesPath.DIRECTORY_SEPARATOR.$character; + $characterPath = $storyPath.DIRECTORY_SEPARATOR.$character; if (is_dir($characterPath)) { $characterDescription = file_get_contents($characterPath.DIRECTORY_SEPARATOR.'description.txt'); $characters[$character] = $characterDescription; @@ -28,7 +29,7 @@ foreach ($tvSeriesDirContent as $tvSeriesName) { } } -$currentTvSeriesName = visibleName($currentTvSeries); +$currentStoryName = visibleName($currentStory); ?> <!DOCTYPE html> @@ -37,7 +38,7 @@ $currentTvSeriesName = visibleName($currentTvSeries); <meta name="viewport" content="width=device-width, initial-scale=1.0"> <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="https://www.sl-its.de/js/bootstrap.min.js"></script> + <script src="js/bootstrap.min.js"></script> <style type="text/css"> .figure-desc { text-align: justify; @@ -46,19 +47,19 @@ $currentTvSeriesName = visibleName($currentTvSeries); height: 300px; width: 300px; } - .series-logo { + .story-logo { font-size: 2em; } .spacer { height: 55px; } </style> - <title>Kinderserienfiguren</title> + <title>Kindergeschichten</title> </head> <body> <nav class="navbar navbar-default navbar-fixed-top navbar-right"> <div class="navbar-header"> - <a class="navbar-brand" href="#">Kinderserienfiguren</a> + <a class="navbar-brand" href="#">Kindergeschichten</a> <button type="button" class="navbar-toggle navbar-toggle-si" data-toggle="collapse" data-target=".navbar-collapse"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> @@ -70,11 +71,11 @@ $currentTvSeriesName = visibleName($currentTvSeries); <div class="collapse navbar-collapse" id="myNavbar"> <ul class="nav navbar-nav"> <?php - foreach ($tvSeries as $tvSeriesName) { - $cssClass = ($tvSeriesName == $currentTvSeries) ? " class=\"active\"" : ""; - $visibleName = visibleName($tvSeriesName); + foreach ($stories as $storyName) { + $cssClass = ($storyName == $currentStory) ? " class=\"active\"" : ""; + $visibleName = visibleName($storyName); ?> - <li<?=$cssClass;?>><a href="index.php?series=<?=$tvSeriesName;?>"><?=$visibleName;?></a></li> + <li<?=$cssClass;?>><a href="index.php?story=<?=$storyName;?>"><?=$visibleName;?></a></li> <?php } ?> @@ -86,7 +87,7 @@ $currentTvSeriesName = visibleName($currentTvSeries); <div class="container"> <div class="row"> <div class="col-md-7 text-center"> - <img class="img-fluid mb-3 mb-md-0 series-logo" src="<?=$currentTvSeries?>/logo.png" alt="<?=$currentTvSeriesName;?>" title="<?=$currentTvSeriesName;?>"> + <img class="img-fluid mb-3 mb-md-0 story-logo" src="<?=$currentStory?>/logo.png" alt="<?=$currentStoryName;?>" title="<?=$currentStoryName;?>"> </div> </div> <?php @@ -96,7 +97,7 @@ $currentTvSeriesName = visibleName($currentTvSeries); <!-- <?=$characterName;?> --> <div class="row"> <div class="col-md-7 text-center"> - <img class="img-fluid rounded mb-3 mb-md-0 figure-pic" src="<?=$currentTvSeries?>/<?=$character;?>/passphoto.png" alt="<?=$characterName;?>" title="<?=$characterName;?>"> + <img class="img-fluid rounded mb-3 mb-md-0 figure-pic" src="<?=$currentStory?>/<?=$character;?>/passphoto.png" alt="<?=$characterName;?>" title="<?=$characterName;?>"> </div> <div class="col-md-5"> <h3><?=$characterName;?></h3> |