diff --git a/homepage/participo/auth.php b/homepage/participo/auth.php new file mode 100644 index 0000000..c25f3a6 --- /dev/null +++ b/homepage/participo/auth.php @@ -0,0 +1,16 @@ +". + "Datum: ".date("Y-m-d")."
". + "Angemeldet als ".htmlspecialchars($_SESSION['user']['username']).".
". + "Sitzung beenden". + ""; + } +?> diff --git a/homepage/participo/config/participo.php b/homepage/participo/config/participo.php new file mode 100644 index 0000000..d3b7012 --- /dev/null +++ b/homepage/participo/config/participo.php @@ -0,0 +1,8 @@ + diff --git a/homepage/participo/index.php b/homepage/participo/index.php index 202e346..57b6d69 100644 --- a/homepage/participo/index.php +++ b/homepage/participo/index.php @@ -1,120 +1,75 @@ - - - + + + - - - - + + + + + + - - + + + - participo - + participo + - - - - + + + + - - - -menu + + + menu + - - - - Eigene Achievements" ); - echo( htmlUsersUploadBox($dbConnection, $_SESSION['user']['userId']) ); - echo(htmlAchievementListForUser( - $dbConnection, - $achievementGroups, - $_SESSION['user']['userId'], - getUsersAchievements($dbConnection, $_SESSION['user']['userId']) - )); - } - ?> - - ".$k['vorname']." ".$k['name']."" ); - echo( htmlUsersUploadBox($dbConnection, $k['kidId']) ); - echo(htmlAchievementListForUser( - $dbConnection, - $achievementGroups, - $k['id'], - getUsersAchievements($dbConnection, $k['id']) - )); - } - } - ?> - Add Achievements"); - echo(htmlAddAchievementBox()); - - echo("

Update Achievements

"); - $achievements = getAchievements($dbConnection); - foreach($achievements as $a){ - echo( htmlUpdateAchievementBox( - $a['id'], - $a['name'], - $a['description'], - $a['rootId'], - $a['level'] - )); - echo("
"); - } - } - ?> - - +if($_SESSION['login']){ +?> + + + diff --git a/homepage/participo/kyu.php b/homepage/participo/kyu.php new file mode 100644 index 0000000..b04847f --- /dev/null +++ b/homepage/participo/kyu.php @@ -0,0 +1,256 @@ +array(..), 'mdText'=>string) +function loadMarkdownFile($fileName){ + $fileText = file_get_contents($fileName); + + $fileParts = preg_split('/[\n]*[-]{3}[\n]/', $fileText, 3); + + return array( + 'yaml' => Spyc::YAMLLoadString($fileParts[1]) + , 'mdText' => preg_replace("/^#(.*)$/m", "", $fileParts[2]) + ); +} + +/// @brief Gibt die URL der gerade aufgerufenen Seite zurück +function getCurPagesUrl(){ + $pageURL = 'http'; + if ($_SERVER["HTTPS"] == "on"){ + $pageURL .= "s"; + } + $pageURL .= "://"; + if($_SERVER["SERVER_PORT"] != "80"){ + $pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"]; + } + else{ + $pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"]; + } +return $pageURL; +} + +function htmlCardCode($article, $Parsedown){ + if( + empty($article['yaml']) + && empty($article['mdText']) + ) return ""; + $videoFrame = ( + array_key_exists('yaml', $article) + ?( + array_key_exists('video', $article['yaml']) + ?( + "
".html5VideoFrame($article['yaml']['video'])."
" + ) + :"" + ) + :"" + ); + $ytVideoFrame = ( + array_key_exists('yaml', $article) + ?( + array_key_exists('youtube', $article['yaml']) + ?( + ytLightEmbed($article['yaml']['youtube']) + ) + :"" + ) + :"" + ); +return + "
" + ."
" + ."
" + .(!empty($videoFrame)?$videoFrame:$ytVideoFrame) + ."
" + ."
" + ."" + .$article['yaml']['title'] + ."more_vert" + ."" + ."
" + ."
" + ."" + .$article['yaml']['title'] + ."close" + ."" + .$Parsedown->text($article['mdText']) + ."
" + ."
" + ."
"; +} + +//! create the