few updates to News section
[whome.git] / dockapps / index.php
blob5d9cadd1d54df2850ae81a1be40e2fbaab860904
1 <?php
2 $dockapps = parse_ini_file("dockapps.db", true);
4 $name = $_GET["name"];
5 $category = $_GET["category"];
6 $download = $_GET["download"];
8 function getCategory($dockapp) {
9 return $dockapp["category"];
12 if ($download) {
13 $download=str_replace(" ", "+", $download);
14 preg_match("/([\w\-+.]+)-([\w+.]+).tar.gz/", $download, $matches);
15 header("Location: http://repo.or.cz/w/dockapps.git/snapshot/" .
16 $dockapps[$matches[1]]["version-$matches[2]"] . ".tar.gz");
17 die();
20 <html xmlns="http://www.w3.org/1999/xhtml">
21 <head>
22 <meta name="generator" content="HTML Tidy for Linux (vers 25 March 2009), see www.w3.org" />
24 <title>Window Maker: Dockapps</title>
25 <meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
26 <link href="../title.css" rel="stylesheet" type="text/css" />
27 </head>
28 <?php
29 echo "<body>\n";
30 include("../dock.php");
31 include("../header.php");?>
32 <div>
33 <table class="inner" border="0" cellpadding="1" cellspacing="1">
34 <tr>
35 <td content="content" colspan="2" valign="top">
36 <br />
37 <br />
38 <h1><a href=".">Dockapps</a></h1>
39 <?php
40 if ($name) {
41 echo "<h2>$name</h2>\n";
42 echo "<b>Category:</b> <a href=\"?category=" .
43 $dockapps[$name]["category"] . "\">" .
44 $dockapps[$name]["category"] .
45 "</a><br/>\n";
46 if ($dockapps[$name]["url"])
47 echo "<b>Website</b>: <a href=\"" . $dockapps[$name]["url"] .
48 "\">" . $dockapps[$name]["url"] . "</a><br/>\n";
49 echo "<b>Description:</b> " . nl2br($dockapps[$name]["description"]) .
50 "<br/>\n";
51 $images = explode(",", $dockapps[$name]["image"]);
52 if ($images) {
53 echo "<h3>Screenshots:</h3>\n";
54 foreach ($images as $image)
55 echo "<img src=\"img/$image\"/>\n";
57 echo "<h3>Available Versions:</h3>\n";
58 $versions = array();
59 $info = $dockapps[$name];
60 foreach ($info as $key => $value) {
61 if (substr($key, 0, 8) == "version-")
62 array_push($versions,
63 substr($key, strrpos($key, "-")+1));
65 foreach ($versions as $version) {
66 echo "<a href=\"?download=$name-$version.tar.gz\">" .
67 "$name-$version</a><br/>\n";
69 }?>
70 <p/>
71 <i>Note:</i> By default, the above tarballs will save as
72 dockapps-$string.tar.gz, where $string is a long string of hexadecimal
73 characters. You may wish to right click and use the <i>Save Link As...</i>
74 option.
76 <?php
77 } else if ($category) {
78 echo "<h2>$category</h2>\n";
79 $matches = array();
80 foreach ($dockapps as $dockapp => $info)
81 if ($info["category"] == $category)
82 array_push($matches, $dockapp);
83 sort($matches);
84 foreach ($matches as $dockapp)
85 echo "<a href=\"?name=" . urlencode($dockapp) .
86 "\">$dockapp</a><br/>\n";
88 } else {?>
89 Here you can download git snapshots of a number of Window Maker dockapps which
90 are no longer maintained by their original developers and have been adopted by
91 the Window Maker Developers Team. You can browse the repository itself at
92 <a href="http://repo.or.cz/dockapps.git">http://repo.or.cz/dockapps.git</a>.
93 <p/>
94 If you would like to submit a patch to an existing dockapp or add a new dockapp
95 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>.
97 <h2>Categories</h2>
98 <?php
99 $categories = array_unique(array_map("getCategory", $dockapps));
100 sort($categories);
101 foreach ($categories as $category)
102 echo "<a href=\"?category=$category\">$category</a><br/>\n";
104 </td>
105 </tr>
106 </table>
108 <?php
109 include("../footer.php");