diff --git a/web2/.htaccess b/web2/.htaccess
new file mode 100644
index 0000000000..01d6e01e3e
--- /dev/null
+++ b/web2/.htaccess
@@ -0,0 +1,6 @@
+RewriteEngine on
+RewriteBase /web2
+
+RewriteCond %{REQUEST_FILENAME} !-f
+RewriteCond %{REQUEST_FILENAME} !-d
+RewriteRule (.*) $1.php [L,QSA]
diff --git a/web2/include/template.inc.php b/web2/include/template.inc.php
index c14da25dd8..89aed3d804 100644
--- a/web2/include/template.inc.php
+++ b/web2/include/template.inc.php
@@ -1,19 +1,29 @@
\n"
."\n"
."
\n"
." \n"
." \n"
- ." $title \n"
+ ." Doomsday Engine$title \n"
."\n");
}
+function generate_page_title($title)
+{
+ echo("
+
$title
+ ");
+}
+
function platform_download_link()
{
switch (detect_user_platform()) {
@@ -53,3 +63,150 @@ function generate_download_button()
}
cache_dump();
}
+
+function generate_download_badge($db, $file_id)
+{
+ // Fetch all information about this file.
+ $result = db_query($db, "SELECT * FROM ".DB_TABLE_FILES." WHERE id=$file_id");
+ $file = $result->fetch_assoc();
+
+ $build = db_get_build($db, $file['build']);
+ $build_type = ucwords(build_type_text($build['type']));
+ if ($build_type == 'Candidate') {
+ $build_type = 'RC';
+ }
+ $version = $build['version'];
+
+ $result = db_query($db, "SELECT * FROM ".DB_TABLE_PLATFORMS." WHERE id=$file[plat_id]");
+ $plat = $result->fetch_assoc();
+
+ $ext = pathinfo($file['name'], PATHINFO_EXTENSION);
+ // Special case for making a distinction between old .dmg files.
+ if ($ext == 'dmg' && strpos($file['name'], '_apps') != FALSE) {
+ $fext = 'Applications';
+ }
+ else if ($plat['os'] == 'macx') {
+ $fext = $ext;
+ }
+ else {
+ $fext = $ext." ($plat[cpu_bits]-bit)";
+ }
+
+ $title = "Doomsday ".omit_zeroes($version);
+ if ($build['type'] != BT_STABLE) {
+ $title = omit_zeroes($version).' '
+ .$build_type." #$build[build]";
+ }
+ if ($plat['platform'] == 'source') {
+ $title .= " (Source)";
+ }
+ else {
+ $title .= " – $fext";
+ }
+ $full_title = "Doomsday ".human_version($version, $build['build'], build_type_text($build['type']))
+ ." for ".$plat['name']." (".$plat['cpu_bits']."-bit)";
+ $download_url = 'http://api.dengine.net/1/builds?dl='.$file['name'];
+
+ $metadata = '';
+ $metadata .= ''
+ .substr($build['timestamp'], 0, 10)
+ .' · ';
+ if ($plat['os'] != 'any') {
+ $metadata .= $plat['cpu_bits'].'-bit '.$plat['name'].' (or later)';
+ }
+ else {
+ $metadata .= "Source code .tar.gz";
+ }
+ $metadata .= ' ';
+
+ echo('
'
+ ."
$title "
+ .$metadata
+ ."
\n");
+}
+
+function generate_badges($platform, $type)
+{
+ // Find the latest suitable files.
+ $db = Session::get()->database();
+ $result = db_latest_files($db, $platform, $type);
+ $latest_build = 0;
+ while ($row = $result->fetch_assoc()) {
+ // All suitable files of the latest build will be shown.
+ if ($latest_build == 0) {
+ $latest_build = $row['build'];
+ }
+ else if ($latest_build != $row['build']) {
+ break;
+ }
+ generate_download_badge($db, $row['id']);
+ }
+}
+
+function generate_sidebar()
+{
+ echo(
+ "");
+}
+
+function generate_sitemap()
+{
+ echo("
+
+
+ Latest News
+ Latest Builds
+
+
+ Multiplayer Games
+
+
+ User Manual
+
+
+ Go to...
+ Alternatives
+
+
+
+ Doomsday Engine is
open
+ source software and distributed under
+ the
GNU General Public License (applications) and
LGPL (core libraries).
+ Assets from the original games remain under their original copyright.
+ Doomsday logo created by Daniel Swanson.
+ Website design by Jaakko Keränen © 2017.
+
+
");
+}
diff --git a/web2/index.php b/web2/index.php
index 12c993f5e7..352683d194 100644
--- a/web2/index.php
+++ b/web2/index.php
@@ -1,6 +1,6 @@
@@ -41,29 +41,5 @@
-
-
-
- Manual
-
-
- Latest news
- Latest builds
-
-
- Multiplayer servers
-
-
- Go to...
-
-
-
- Doomsday Engine is
open
- source software and distributed under
- the
GNU General Public License (applications) and
LGPL (core libraries).
- Assets from the original games remain under their original copyright.
- Doomsday logo created by Daniel Swanson.
- Website design by Jaakko Keränen © 2017.
-
-
+
diff --git a/web2/macos.php b/web2/macos.php
new file mode 100644
index 0000000000..2718790a9c
--- /dev/null
+++ b/web2/macos.php
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+
+ Doomsday Engine can run on recent 64-bit versions of macOS. If your macOS is more than two years old, please check out the older Doomsday releases .
+
+
+
+
+
+ Release Candidate
+ Release candidate of the next upcoming stable build.
+
+
+
+
+
+ Unstable / Nightly
+ Unstable builds are made automatically every day when changes are committed to the source repository . They contain work-in-progress code and sometimes may crash on you.
+
+
+
+
+
+
+
+
diff --git a/web2/theme/images/site-banner.jpg b/web2/theme/images/site-banner.jpg
new file mode 100644
index 0000000000..0bbb2936a8
Binary files /dev/null and b/web2/theme/images/site-banner.jpg differ
diff --git a/web2/theme/stylesheets/site.css b/web2/theme/stylesheets/site.css
index dba7d20136..bcf6f1e031 100644
--- a/web2/theme/stylesheets/site.css
+++ b/web2/theme/stylesheets/site.css
@@ -1,4 +1,4 @@
-@import url("http://fonts.googleapis.com/css?family=Open+Sans:400italic,400,300,700");
+@import url("http://fonts.googleapis.com/css?family=Open+Sans:300,400,700");
@import url("topbar.css");
body {
@@ -11,8 +11,25 @@ body {
margin: 0;
}
+#page-title {
+ width: 100%;
+ height: 14em;
+ text-align: center;
+ text-shadow: 0 0 1em black;
+ background: #282D2B url("../images/site-banner.jpg") no-repeat;
+ background-size: cover;
+}
+#page-title h1 {
+ margin: 0;
+ padding-top: 3.5em;
+ padding-bottom: 3.5em;
+ font-weight: bold;
+ font-size: 200%;
+ color: white;
+}
+
#content {
- max-width: 65em;
+ max-width: 60em;
margin: 1em auto 0 auto;
}
#content a {
@@ -90,20 +107,59 @@ body {
font-size: 60%;
}
+#hero, #features {
+ margin: 5em 0em;
+}
+
div.block {
- margin: 5em 1em;
+ margin: 0 0 1em 0;
+ background-color: rgba(0, 0, 0, 0.15);
+ padding: 2em;
+}
+div.block:not(:first-child) {
+ margin-top: 1em;
}
div.block h1 {
text-transform: uppercase;
font-weight: 400;
- margin-left: 0;
+ margin-top: 0;
color: #eee;
}
div.block p {
color: #b0b0b0;
}
+#page-content {
+ float: right;
+ max-width: 45em;
+ width: 75%;
+}
+
+#overview p {
+ margin: 0;
+}
+
+#sidebar {
+ font-size: 95%;
+ width: 20em;
+ margin: 0 1em;
+}
+#sidebar .heading {
+ text-transform: uppercase;
+ margin: 1em 0 0 0;
+ font-size: 90%;
+ font-weight: bold;
+}
+#sidebar ul {
+ list-style-type: none;
+ padding: 0;
+ padding-left: 1em;
+ margin-top: 0.5ex;
+ margin-bottom: 1em;
+}
+
#site-map {
+ clear: both;
width: 100%;
margin: 5em 0 0 0;
padding: 2em 0 2em 0;