|
|
|
<!DOCTYPE html>
|
|
|
|
<html lang="en">
|
|
|
|
<head>
|
|
|
|
<meta charset="utf-8">
|
|
|
|
<link href="styles.css" rel="stylesheet">
|
|
|
|
<title>Benjamin Kraft: Games</title>
|
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
<div id="content">
|
|
|
|
<h1>Benjamin Kraft: Games</h1>
|
|
|
|
<div id="projects-container">
|
|
|
|
<?php
|
|
|
|
require "php/mysql_connect.php";
|
|
|
|
$conn = new MySQLConnection();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$tag = array_key_exists("tag", $_GET) ? $conn->escape($_GET["tag"]) : null;
|
|
|
|
$sort = array_key_exists("sort", $_GET) ? $_GET["sort"] : "0";
|
|
|
|
$queryFiltered =
|
|
|
|
<<<SQL
|
|
|
|
SELECT P.name, P.display_name, P.version, P.info, P.date_updated
|
|
|
|
FROM projects P INNER JOIN project_tags PT ON P.name=PT.project_name
|
|
|
|
WHERE visible=1 AND PT.tag_name='$tag'
|
|
|
|
ORDER BY date_updated DESC
|
|
|
|
SQL;
|
|
|
|
|
|
|
|
$queryUnfiltered =
|
|
|
|
<<<SQL
|
|
|
|
SELECT name, display_name, version, info_text, date_updated
|
|
|
|
FROM projects
|
|
|
|
WHERE visible=1
|
|
|
|
ORDER BY date_updated DESC
|
|
|
|
SQL;
|
|
|
|
|
|
|
|
$result = $conn->query($queryUnfiltered);
|
|
|
|
while ($row = $result->fetch_assoc()) {
|
|
|
|
$name = $row["name"];
|
|
|
|
$displayName = $row["display_name"];
|
|
|
|
$version = $row["version"];
|
|
|
|
$info = $row["info_text"];
|
|
|
|
$dateUpdated = $row["date_updated"];
|
|
|
|
|
|
|
|
$imgAddress = "/projects/$name/thumbnail.png";
|
|
|
|
|
|
|
|
$nameDom = "<h3 class='project-name'>$displayName</h3>";
|
|
|
|
$versionDom = "<h4 class='project-version'>$version</h4>";
|
|
|
|
$infoDom = "<div class='project-info'>$info</div>";
|
|
|
|
$startDom = "<button class='project-start' onclick='window.location = \"projects/$name/\"'>Start</button>";
|
|
|
|
|
|
|
|
$imgDom = "<img class='project-image' src='$imgAddress' alt='Alternative image text'/>";
|
|
|
|
$descriptionDom = "<div class='project-description'>$nameDom$versionDom$infoDom$startDom</div>";
|
|
|
|
|
|
|
|
echo "<div class='project'>$imgDom$descriptionDom</div>";
|
|
|
|
}
|
|
|
|
?>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</body>
|
|
|
|
</html>
|