From 0acc7002a464781c939d12171c9dcd909d6fa42d Mon Sep 17 00:00:00 2001 From: Benjamin Kraft Date: Sat, 19 Nov 2022 19:31:56 +0100 Subject: [PATCH] added images, dotenv --- public/index.php | 81 +++++++++++++++++++--------------- public/php/dotenv.php | 4 ++ public/php/get_nodejs_port.php | 3 -- public/php/mysql_connect.php | 9 ++-- 4 files changed, 54 insertions(+), 43 deletions(-) create mode 100644 public/php/dotenv.php delete mode 100644 public/php/get_nodejs_port.php diff --git a/public/index.php b/public/index.php index 71b1c47..0d84aec 100644 --- a/public/index.php +++ b/public/index.php @@ -1,42 +1,51 @@ - - - - - - Benjamin Kraft: Games - - -
-

Benjamin Kraft: Games

-
-

Hi, here you can find some games I wrote with Javascript, Typescript or C#

-
-
- query("SELECT name, display_name, version, info, image_path FROM projects WHERE visible=1"); - while ($row = $result->fetch_assoc()){ - $name = $row["name"]; - $displayName = $row["display_name"]; - $version = $row["version"]; - $info = $row["info"]; - $imgPath = $row["image_path"]; + + + + + + Benjamin Kraft: Games + + +
+

Benjamin Kraft: Games

+
+

Hi, here you can find some games I wrote with Javascript, Typescript or C#

+
+
+ query( + <<fetch_assoc()) { + $name = $row["name"]; + $displayName = $row["display_name"]; + $version = $row["version"]; + $info = $row["info"]; + $dateUpdated = $row["date_updated"]; - $nameDom = "

$displayName

"; - $versionDom = "

$version

"; - $infoDom = "
$info
"; - $startDom = ""; + $imgAddress = "/$name/thumbnail.png"; - $imgDom = "Alternative image text"; //TODO get img from database - $description = "
$nameDom$versionDom$infoDom$startDom
"; + $nameDom = "

$displayName

"; + $versionDom = "

$version

"; + $infoDom = "
$info
"; + $startDom = ""; - echo "
$imgDom$description
"; - } - ?> -
-
- + $imgDom = "Alternative image text"; + $descriptionDom = "
$nameDom$versionDom$infoDom$startDom
"; + + echo "
$imgDom$descriptionDom
"; + } + ?> +
+
+ \ No newline at end of file diff --git a/public/php/dotenv.php b/public/php/dotenv.php new file mode 100644 index 0000000..d435df8 --- /dev/null +++ b/public/php/dotenv.php @@ -0,0 +1,4 @@ + $value) + putenv("$key=$value"); diff --git a/public/php/get_nodejs_port.php b/public/php/get_nodejs_port.php deleted file mode 100644 index 734cfad..0000000 --- a/public/php/get_nodejs_port.php +++ /dev/null @@ -1,3 +0,0 @@ -host = 'localhost'; - $this->port = $env['MYSQL_PORT']; - $this->user = $env['MYSQL_USER']; - $this->pass = $env['MYSQL_PASSWORD']; + $this->port = intval(getenv('MYSQL_PORT')); + $this->user = getenv('MYSQL_USER'); + $this->pass = getenv('MYSQL_PASSWORD'); $this->createConn(); }