Files
window-maker.github.io/dockapps/index.php
Doug Torrance c0dd0c9d7a Add dockapps section.
This patch essentially adds a mini version of the old dockapps.windowmaker.org
to the main webpage for the dockapps which are in the git repository.

Instead of hosting the tarballs, links to git snapshots on repo.or.cz are given.

The images and descriptions came mostly from archive.org's copy of
dockapps.windowmaker.org.  They are stored in a text-based database
(dockapps.db), which is generated locally by a perl script that pulls the
version information from git.
2014-08-11 06:52:47 -06:00

112 lines
3.4 KiB
PHP

<?php
$dockapps = parse_ini_file("dockapps.db", true);
$name = $_GET["name"];
$category = $_GET["category"];
$download = $_GET["download"];
function getCategory($dockapp) {
return $dockapp["category"];
}
if ($download) {
$download=str_replace(" ", "+", $download);
preg_match("/([\w\-+.]+)-([\w+.]+).tar.gz/", $download, $matches);
header("Location: http://repo.or.cz/w/dockapps.git/snapshot/" .
$dockapps[$matches[1]]["version-$matches[2]"] . ".tar.gz");
die();
}
?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta name="generator" content="HTML Tidy for Linux (vers 25 March 2009), see www.w3.org" />
<title>Window Maker: Dockapps</title>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
<link href="../title.css" rel="stylesheet" type="text/css" />
</head>
<?php
echo "<body>\n";
include("../dock.php");
include("../header.php");?>
<div>
<table class="inner" border="0" cellpadding="1" cellspacing="1">
<tr>
<td content="content" colspan="2" valign="top">
<br />
<br />
<h1><a href=".">Dockapps</a></h1>
<?php
if ($name) {
echo "<h2>$name</h2>\n";
echo "<b>Category:</b> <a href=\"?category=" .
$dockapps[$name]["category"] . "\">" .
$dockapps[$name]["category"] .
"</a><br/>\n";
if ($dockapps[$name]["url"])
echo "<b>Website</b>: <a href=\"" . $dockapps[$name]["url"] .
"\">" . $dockapps[$name]["url"] . "</a><br/>\n";
echo "<b>Description:</b> " . nl2br($dockapps[$name]["description"]) .
"<br/>\n";
$images = explode(",", $dockapps[$name]["image"]);
if ($images) {
echo "<h3>Screenshots:</h3>\n";
foreach ($images as $image)
echo "<img src=\"img/$image\"/>\n";
}
echo "<h3>Available Versions:</h3>\n";
$versions = array();
$info = $dockapps[$name];
foreach ($info as $key => $value) {
if (substr($key, 0, 8) == "version-")
array_push($versions,
substr($key, strrpos($key, "-")+1));
}
rsort($versions);
foreach ($versions as $version) {
echo "<a href=\"?download=$name-$version.tar.gz\">" .
"$name-$version</a><br/>\n";
}?>
<p/>
<i>Note:</i> By default, the above tarballs will save as
dockapps-$string.tar.gz, where $string is a long string of hexadecimal
characters. You may wish to right click and use the <i>Save Link As...</i>
option.
<?php
} else if ($category) {
echo "<h2>$category</h2>\n";
$matches = array();
foreach ($dockapps as $dockapp => $info)
if ($info["category"] == $category)
array_push($matches, $dockapp);
sort($matches);
foreach ($matches as $dockapp)
echo "<a href=\"?name=" . urlencode($dockapp) .
"\">$dockapp</a><br/>\n";
} else {?>
Here you can download git snapshots of a number of Window Maker dockapps which
are no longer maintained by their original developers and have been adopted by
the Window Maker Developers Team. You can browse the repository itself at
<a href="http://repo.or.cz/dockapps.git">http://repo.or.cz/dockapps.git</a>.
<p/>
If you would like to submit a patch to an existing dockapp or add a new dockapp
to the repository, please follow <a href="http://repo.or.cz/w/wmaker-crm.git/blob/HEAD:/The-perfect-Window-Maker-patch.txt">these directions</a>.
<h2>Categories</h2>
<?php
$categories = array_unique(array_map("getCategory", $dockapps));
sort($categories);
foreach ($categories as $category)
echo "<a href=\"?category=$category\">$category</a><br/>\n";
}?>
</td>
</tr>
</table>
<?php
include("../footer.php");
?>