diff --git a/homepage/cwsvJudo/configs/heliohost/config.json b/homepage/cwsvJudo/configs/heliohost/config.json index 1ed5bc7..c9cbb9b 100644 --- a/homepage/cwsvJudo/configs/heliohost/config.json +++ b/homepage/cwsvJudo/configs/heliohost/config.json @@ -1,7 +1,7 @@ { "cwsvJudo": { "db": { - "host": "localhost", + "host": "db", "name": "cwsvjudo_main", "user": "cwsvjudo_marko" } diff --git a/homepage/cwsvJudo/configs/heliohost/pages.config.inc.php b/homepage/cwsvJudo/configs/heliohost/pages.config.inc.php index 3b30301..dc86c31 100644 --- a/homepage/cwsvJudo/configs/heliohost/pages.config.inc.php +++ b/homepage/cwsvJudo/configs/heliohost/pages.config.inc.php @@ -8,7 +8,7 @@ $home = "/home/cwsvjudo.helioho.st"; /// Basis(/Root)-Verzeichnis auf dem Server (für Dateizugriffe, insbesondere phpIncludes) /// (ist eigentlich das serve verzeichnis, aka www-data) - $basePath = join("/", [$home, "httpdocs"]); + $basePath = join(separator: "/", array: [$home, "httpdocs"]); /// Url zum Zugriff auf "shared Data" unter der Hauptadresse $baseUrl = "http://".$baseDomain; diff --git a/homepage/cwsvJudo/docker-compose.yaml b/homepage/cwsvJudo/docker-compose.yaml index fcf9da8..f44b248 100644 --- a/homepage/cwsvJudo/docker-compose.yaml +++ b/homepage/cwsvJudo/docker-compose.yaml @@ -21,10 +21,11 @@ services: image: mariadb:latest restart: always environment: - MYSQL_USER: "cwsvjudo" - MYSQL_DATABASE: "cwsvjudo" + MYSQL_USER: "cwsvjudo_marko" + MYSQL_DATABASE: "cwsvjudo_main" MYSQL_ROOT_PASSWORD_FILE: /run/secrets/db_root_password MYSQL_PASSWORD_FILE: /run/secrets/db_password + MYSQL_TCP_PORT: 3306 volumes: # this line maps the content of ./mysql_data in your pc to the /var/lib/mysql of the container - mysqldata:/var/lib/mysql @@ -44,7 +45,7 @@ services: environment: # name of the host is the name of the db service started above! Why? I don't know! - PMA_HOST=db - - PMA_PORT=1433 + - PMA_PORT=3306 volumes: # data storage for the db mysqldata: {} diff --git a/homepage/cwsvJudo/phpLib/cwsvJudo/newsTableHtml.php b/homepage/cwsvJudo/phpLib/cwsvJudo/newsTableHtml.php index 9798602..48d1ddb 100644 --- a/homepage/cwsvJudo/phpLib/cwsvJudo/newsTableHtml.php +++ b/homepage/cwsvJudo/phpLib/cwsvJudo/newsTableHtml.php @@ -15,8 +15,7 @@ $headerRootLevel = is_positive_integer($someOptions['headerRootLevel'])?$someOpt /// Eine Datenbankverbindung (über pdo) erstellen try{ $db_connection = new PDO( - "mysql:host=".$cwsvJudoConfig["db"]["host"].";". - "dbname=".$cwsvJudoConfig["db"]["name"], + "mysql:host=".$cwsvJudoConfig["db"]["host"].";"."dbname=".$cwsvJudoConfig["db"]["name"], $cwsvJudoConfig["db"]["user"], $cwsvJudoConfig["db"]["password"] ); diff --git a/homepage/cwsvJudo/src/css/materialize/fonts.css b/homepage/cwsvJudo/src/css/materialize/fonts.css index f7c9973..f83fbf6 100644 --- a/homepage/cwsvJudo/src/css/materialize/fonts.css +++ b/homepage/cwsvJudo/src/css/materialize/fonts.css @@ -15,7 +15,7 @@ font-family: 'Material Icons'; font-weight: normal; font-style: normal; - font-size: 24px; + font-size: 1em; line-height: 1; letter-spacing: normal; text-transform: none; diff --git a/homepage/cwsvJudo/src/css/materialize/parallax.css b/homepage/cwsvJudo/src/css/materialize/parallax.css index 7eea56f..1c8afa9 100644 --- a/homepage/cwsvJudo/src/css/materialize/parallax.css +++ b/homepage/cwsvJudo/src/css/materialize/parallax.css @@ -1,5 +1,5 @@ .parallax-container { - height: 50vw; + height: 38vh; } .parallax-container > .parallax > img{ diff --git a/homepage/cwsvJudo/src/md/index.md b/homepage/cwsvJudo/src/md/index.md index c34f926..dbde892 100644 --- a/homepage/cwsvJudo/src/md/index.md +++ b/homepage/cwsvJudo/src/md/index.md @@ -4,11 +4,11 @@ title: "Judo im Chemnitzer WSV - Kinder- und Erwachsenentraining" description: "Informationen zu Trainingszeiten, Wettkämpfen und anderen Veranstaltungen der Abteilung Judo des Chemnitzer Freizeit- und Wohngebiets­sportvereines e. V." author: "marko" keywords: - - "Judo" - - "Chemnitzer Freizeit- und Wohngebietssportverein" + - "Judo" + - "Chemnitzer Freizeit- und Wohngebietssportverein" canonicalPath: "" jsonSdFiles: - - cwsvJudo.json + - cwsvJudo.json ... # Judo im Chemnitzer WSV @@ -20,8 +20,8 @@ und [Wettkampfterminen][cwsvJudoWettkampfKalender]. Ein kleines Wiki bietet [Wissenswertes über Judo][cwsvJudoWiki], wie zum Beispiel das [Programm für die Gürtelprüfungen][cwsvJudoWikiKyu]. - ## Letzte Neuigkeiten + [cwsvHomepage]: http://www.cwsv-sport.de "Homepage des Chemnitzer Freizeit- und Wohngebietssportvereines" diff --git a/homepage/cwsvJudo/src/pages/test/config.php b/homepage/cwsvJudo/src/pages/test/config.php index e806b98..4856c93 100644 --- a/homepage/cwsvJudo/src/pages/test/config.php +++ b/homepage/cwsvJudo/src/pages/test/config.php @@ -1,2 +1,6 @@ "/ressourcen/graphiken/wallpapers", +]; + $mainNav = [ [ "url" => "training", @@ -16,26 +21,72 @@ $sections = [ $wallpapers = [ [ - "src" => "/ressourcen/graphiken/wallpapers/osae-komi.svg", - "data-src" => "/ressourcen/graphiken/wallpapers/osae-komi.jpg" + "src" => $directory_paths['wallpapers']. "/osae-komi.svg", + "data-src" => $directory_paths['wallpapers']. "/osae-komi.jpg" ], [ - "src" => "/ressourcen/graphiken/wallpapers/nage.svg", - "data-src" => "/ressourcen/graphiken/wallpapers/nage.jpg" + "src" => $directory_paths['wallpapers']. "/nage.svg", + "data-src" => $directory_paths['wallpapers']. "/nage.jpg" ], [ - "src" => "/ressourcen/graphiken/wallpapers/kata.svg", - "data-src" => "/ressourcen/graphiken/wallpapers/kata.jpg" + "src" => $directory_paths['wallpapers']. "/kata.svg", + "data-src" => $directory_paths['wallpapers']. "/kata.jpg" ], ]; + +// helper functions +// -html output + +/** + * Inject the html code for the nav targets + * @param mixed $mainNav + * @return void + */ +function mainNavTargets($mainNav){ + echo(''); +} + +function main($sections, $wallpapers){ + foreach($sections as $idx => $section){ + echo( + '
' + .'
' + .'' + .'
' + .'
' + ); + echo( + '
'.$section.'
' + ); + } +} + ?> - - + + + + + @@ -50,20 +101,7 @@ $wallpapers = [ -'); - foreach($mainNav as $nav){ - echo('
  • '); - echo(''); - echo(''.$nav['caption'].''); - echo(''); - echo('
  • '); - } - echo(''); -?> + + + + + + diff --git a/homepage/cwsvJudo/src/pages/test/news.php b/homepage/cwsvJudo/src/pages/test/news.php index 5e9c90c..cfb4e76 100644 --- a/homepage/cwsvJudo/src/pages/test/news.php +++ b/homepage/cwsvJudo/src/pages/test/news.php @@ -2,25 +2,28 @@ require_once("config.php"); $config = json_decode( - file_get_contents($home."/.local/config.json"), - true + json: file_get_contents(filename: $home."/.local/config.json"), + associative: true ); $secrets = json_decode( - file_get_contents($home."/.local/secrets.json"), - true + json: file_get_contents(filename: $home."/.local/secrets.json"), + associative: true ); -var_dump($config); try { $conn = new PDO( - "mysql:host=".$config['cwsvJudo']['db']['host'].";dbname=".$config['cwsvJudo']['db']['name'], - $config['cwsvJudo']['db']['user'], - $secrets['cwsvJudo']['db'][$config['cwsvJudo']['db']['user']] + dsn: join(separator: ";",array: [ + "mysql:host=".$config['cwsvJudo']['db']['host'], + "port=3306", + "dbname=".$config['cwsvJudo']['db']['name'] + ]), + username: $config['cwsvJudo']['db']['user'], + password: $secrets['cwsvJudo']['db'][$config['cwsvJudo']['db']['user']] ); // set the PDO error mode to exception - $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); + $conn->setAttribute(attribute: PDO::ATTR_ERRMODE, value: PDO::ERRMODE_EXCEPTION); echo "Connected successfully"; } catch(PDOException $e) { echo "Connection failed: " . $e->getMessage();