Skip to content

Commit

Permalink
Homepage: Added download pages and the bottom site map
Browse files Browse the repository at this point in the history
  • Loading branch information
skyjake committed Mar 24, 2017
1 parent c73b10a commit 54d3868
Show file tree
Hide file tree
Showing 7 changed files with 327 additions and 38 deletions.
18 changes: 18 additions & 0 deletions web2/addons.php
@@ -0,0 +1,18 @@
<?php
require_once('include/template.inc.php');
$page_title = 'Add-ons';
generate_page_header($page_title);
?>
<body>
<?php
include('include/topbar.inc.php');
generate_page_title($page_title);
?>
<div id='content'>
<div id='page-content'>

</div>
<?php generate_sidebar(); ?>
</div>
<?php generate_sitemap(); ?>
</body>
134 changes: 108 additions & 26 deletions web2/include/template.inc.php
Expand Up @@ -157,6 +157,7 @@ function generate_sidebar()
<li><a href='source'>Source</a></li>
<li><a href='/builds'>Recent builds</a></li>
</ul>
<div class='heading'><a href='addons'>Add-ons</a></div>
<div class='heading'><a href='/manual'>User Manual</a></div>
<ul>
<li><a href='/manual/getting_started'>Getting started</a></li>
Expand All @@ -181,32 +182,113 @@ function generate_sidebar()
</div>");
}

function generate_blog_post_cached($post, $css_class)
{
$date = date_parse($post->date);
$ts = mktime($date['hour'], $date['minute'], $date['second'],
$date['month'], $date['day'], $date['year']);
$nice_date = strftime('%B %d, %Y', $ts);

/*$html = '<div class="block"><article class="'.$css_class
.' content"><header><h1><a href="'.$post->url.'">'
.$post->title.'</a></h1>';
$html .= '<p><time datetime="'.$post->date.'" pubdate>'.$nice_date
.'</time> &mdash; '.$post->author->name.'</p></header><br />';
$html .= '<div class="articlecontent">'.$post->content.'</div></article>';
$html .= '<div class="links">'.$source_link.'</div></div>';*/

$html = "<a class='blog-link' href='$post->url'>$post->title</a> "
."<time datetime='$post->date' pubdate>&ndash; $nice_date</time>";

cache_echo('<li>'.$html.'</li>');
}

function generate_sitemap()
{
echo("<div id='site-map'>
<ul class='map-wrapper'>
<li>
<div>Latest News</div>
<div>Latest Builds</div>
</li>
<li>
Multiplayer Games
</li>
<li>
User Manual
</li>
<li>
<div>Go to...</div>
<div>Alternatives</div>
</li>
</ul>
<div id='credits'>
Doomsday Engine is <a href='https://github.com/skyjake/Doomsday-Engine.git'>open
source software</a> and distributed under
the <a href='http://www.gnu.org/licenses/gpl.html'>GNU General Public License</a> (applications) and <a href='http://www.gnu.org/licenses/lgpl.html'>LGPL</a> (core libraries).
Assets from the original games remain under their original copyright.
Doomsday logo created by Daniel Swanson.
Website design by Jaakko Ker&auml;nen &copy; 2017.
</div>
</div>");
// Check for a cached sitemap.
$ckey = cache_key('home', 'sitemap');
if (!cache_try_load($ckey)) {
// Fetch the cached news and dev blog posts.
cache_try_load(cache_key('news', 'news'), -1);
$news = json_decode(cache_get());
cache_try_load(cache_key('news', 'dev'), -1);
$dev = json_decode(cache_get());
$news_count = min(3, count($news->posts));
$dev_count = min(3, count($dev->posts));

cache_clear();

// Contact the BDB for a list of the latest builds.
$db = Session::get()->database();
$result = db_query($db, "SELECT build, version, type, UNIX_TIMESTAMP(timestamp) FROM "
.DB_TABLE_BUILDS." ORDER BY timestamp DESC");
$new_threshold = time() - 2 * 24 * 3600;
$count = 4;
$build_list = "<ul class='sitemap-list'>";
while ($row = $result->fetch_assoc()) {
$link = '/build'.$row['build'];
$version = omit_zeroes($row['version']);
$label = "$version ".ucwords(build_type_text($row['type']))
." [#".$row['build']."]";
$title = "Build report for $label";
$ts = (int) $row['UNIX_TIMESTAMP(timestamp)'];
$date = gmstrftime('&ndash; %B %d', $ts);
$css_class = ($ts > $new_threshold)? ' class="new-build"' : '';

$build_list .= " <li${css_class}><a title='$title' href='$link'>$label</a> <time>$date</time></li>\n";

if (--$count == 0) break;
}
$build_list .= "<li><a href='/builds'>Autobuilder Index</a></li>\n"
."<li><a href='http://api.dengine.net/1/builds?format=feed'>RSS Feed</a></li></ul>\n";

cache_echo("<div id='site-map'>
<ul class='map-wrapper'>
<li>
<div class='heading'>Latest News</div>
<ul class='sitemap-list'>");

for ($i = 0; $i < $news_count; ++$i) {
generate_blog_post_cached($news->posts[$i], 'newspost');
}
cache_echo("<li><a href='/blog/category/news/feed/atom'
title='Doomsday Engine news via RSS'>RSS Feed</a></li>");

cache_echo("</ul></li><li>
<div class='heading'>Blog Posts</div>
<ul class='sitemap-list'>\n");

for ($i = 0; $i < $dev_count; ++$i) {
generate_blog_post_cached($dev->posts[$i], 'blogpost');
}
cache_echo("<li><a href='/blog/category/dev/feed/atom'
title='Doomsday Engine development blog via RSS'>RSS Feed</a></li>");

cache_echo("</ul></li><li><div class='heading'>Recent Builds</div>
$build_list</li>
<li>
<div class='heading'>Multiplayer Games</div>
</li>
<li>
<div class='heading'>User Manual</div>
</li>
<li>
<div class='heading'>Reference Guide</div>
</li>
</ul>
<div id='credits'>
Doomsday Engine is <a href='https://github.com/skyjake/Doomsday-Engine.git'>open
source software</a> and distributed under
the <a href='http://www.gnu.org/licenses/gpl.html'>GNU General Public License</a> (applications) and <a href='http://www.gnu.org/licenses/lgpl.html'>LGPL</a> (core libraries).
Assets from the original games remain under their original copyright.
Doomsday logo created by Daniel Swanson.
<a href='/'>dengine.net</a> website design by Jaakko Ker&auml;nen &copy; 2017.
</div>
</div>");

cache_store($ckey);
}
cache_dump();
}
55 changes: 55 additions & 0 deletions web2/linux.php
@@ -0,0 +1,55 @@
<?php
require_once('include/template.inc.php');
$page_title = 'Linux Downloads';
generate_page_header($page_title);
?>
<body>
<?php
include('include/topbar.inc.php');
generate_page_title($page_title);
?>
<div id='content'>
<div id='page-content'>

<div class="block">
<article>
<h1>Stable</h1>
<?php
generate_badges('ubuntu16-x86_64', BT_CANDIDATE);
generate_badges('fedora23-x86_64', BT_CANDIDATE);
?>
</article>
</div>
<div class="block">
<article>
<h1>Unstable</h1>
<?php
generate_badges('ubuntu16-x86_64', BT_UNSTABLE);
generate_badges('fedora23-x86_64', BT_UNSTABLE);
?>
</article>
</div>
<div class="block">
<article>
<h1>Other Builds</h1>
<p>Binary packages are available for some Linux distributions. You can also <a href="/manual/devel/compile">compile manually from source</a> (requires CMake 3.1 and Qt 5).</p>

<h2><img src="/images/ubuntu.png" alt="Ubuntu" class="distro-icon">Ubuntu</h2>
<p><a class="link-external" href="https://launchpad.net/~sjke/+archive/ubuntu/doomsday/">skyjake's PPA</a> has Doomsday builds for a number of versions of Ubuntu. The <a class="link-external" href="http://packages.ubuntu.com/xenial/games/doomsday">Ubuntu repositories</a> should also have stable releases of Doomsday.</p>

<h2><img src="/images/debian.png" alt="Debian" class="distro-icon">Debian</h2>
<p>Check Debian's repositories for binary packages.</p>

<h2><img src="/images/gentoo.png" alt="Gentoo" class="distro-icon">Gentoo</h2>
<p><a href="https://packages.gentoo.org/packages/games-fps/doomsday" class="link-external">Doomsday Engine package for Gentoo</a></p>

<h2><img src="/images/opensuse.png" alt="openSUSE" class="distro-icon">openSUSE</h2>
<p>Binary packages for Doomsday are available in the <a href="https://software.opensuse.org/package/doomsday" class="link-external">openSUSE repositories.</a></p>
</article>
</div>

</div>
<?php generate_sidebar(); ?>
</div>
<?php generate_sitemap(); ?>
</body>
4 changes: 2 additions & 2 deletions web2/macos.php
Expand Up @@ -12,7 +12,7 @@
<div id='page-content'>
<div class="block">
<article id="overview">
<p>Doomsday Engine can run on recent 64-bit versions of macOS. If your macOS is more than two years old, please check out the <a href="http://wiki.dengine.net/w/Supported_platforms">older Doomsday releases</a>.</p>
<p>Doomsday Engine can run on recent 64-bit versions of macOS. If your macOS is more than two years old, please check out the <a href="/manual/supported_platforms">older Doomsday releases</a>.</p>
</article>
</div>
<div class="block">
Expand All @@ -31,7 +31,7 @@
<div class="block">
<article>
<h1>Unstable / Nightly</h1>
<p>Unstable builds are made automatically every day when changes are committed to the <a href="http://dengine.net/source">source repository</a>. They contain work-in-progress code and sometimes may crash on you.</p>
<p>Unstable builds are made automatically every day when changes are committed to the <a href="source">source repository</a>. They contain work-in-progress code and sometimes may crash on you.</p>
<?php generate_badges('mac10_10-x86_64', BT_UNSTABLE); ?>
</article>
</div>
Expand Down
47 changes: 47 additions & 0 deletions web2/source.php
@@ -0,0 +1,47 @@
<?php
require_once('include/template.inc.php');
$page_title = 'Source Code';
generate_page_header($page_title);
?>
<body>
<?php
include('include/topbar.inc.php');
generate_page_title($page_title);
?>
<div id='content'>
<div id='page-content'>

<div class="block">
<article>
<h1>Source Packages</h1>
<?php
generate_badges('source', BT_STABLE);
generate_badges('source', BT_UNSTABLE);
?>
</article>
</div>
<div class="block">
<article>
<h1>New to Doomsday Source?</h1>
<p>The best place to begin is the <a href="/manual/devel">Development section of the Manual</a>. Here are a couple of important pages to read first:</p>
<ul>
<li><a href="/manual/devel/getting_started">Getting started</a></li>
<li><a href="/manual/devel/guidelines">Developer guidelines</a></li>
</ul>
<h2>API Documentation</h2>
<ul>
<li><a href="http://source.dengine.net/apidoc/sdk">Doomsday 2 SDK</a></li>
<li><a href="http://source.dengine.net/apidoc/api">Runtime API</a></li>
</ul>
<h2>Git Repositories</h2>
<ul>
<li><a href="https://github.com/skyjake/Doomsday-Engine.git">GitHub: skyjake/Doomsday-Engine</a></li>
<li><a href="http://source.dengine.net/codex">Commit tag index</a></li>
</ul>
</article>
</div>
</div>
<?php generate_sidebar(); ?>
</div>
<?php generate_sitemap(); ?>
</body>

0 comments on commit 54d3868

Please sign in to comment.