Show link to Tower's dockapps on main dockapp page only.
[whome.git] / dockapps / index.php
blob2e11bd00968c433bec2f3b4f89a1956b9b718109
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 $hosted = $dockapps[$name]["hosted"];
42 echo "<h2>$name</h2>\n";
43 echo "<b>Category:</b> <a href=\"?category=" .
44 $dockapps[$name]["category"] . "\">" .
45 $dockapps[$name]["category"] .
46 "</a><br/>\n";
47 if ($dockapps[$name]["url"]) {
48 echo "<b>";
49 if ($hosted)
50 echo "Original ";
51 echo "Website</b>: <a href=\"" . $dockapps[$name]["url"] .
52 "\">" . $dockapps[$name]["url"] . "</a><br/>\n";
54 echo "<b>Description:</b> " . nl2br($dockapps[$name]["description"]) .
55 "<br/>\n";
56 $images = explode(",", $dockapps[$name]["image"]);
57 if ($images) {
58 echo "<h3>Screenshots:</h3>\n";
59 foreach ($images as $image)
60 echo "<img src=\"img/$image\"/>\n";
62 if ($hosted) {
63 echo "<h3>Available Versions:</h3>\n";
64 $versions = array();
65 $info = $dockapps[$name];
66 foreach ($info as $key => $value) {
67 if (substr($key, 0, 8) == "version-")
68 array_push($versions,
69 substr($key, strrpos($key, "-")+1));
71 foreach ($versions as $version) {
72 echo "<a href=\"?download=$name-$version.tar.gz\">" .
73 "$name-$version</a><br/>\n";
75 echo "<p/>\n<i>Note:</i> By default, the above tarballs will ";
76 echo "save as dockapps-$string.tar.gz, where $string is a ";
77 echo "long string of hexadecimal characters. You may wish to ";
78 echo "right click and use the <i>Save Link As...</i> option.\n";
79 } else {
80 echo "<p/>\nThis dockapp is not maintained by the Window ";
81 echo "Maker Developers Team. Please visit the dockapp's ";
82 echo "website for downloads.\n";
85 <p/>
87 <?php
88 } else if ($category) {
89 echo "<h2>$category</h2>\n";
90 $matches = array();
91 foreach ($dockapps as $dockapp => $info)
92 if ($info["category"] == $category)
93 array_push($matches, $dockapp);
94 sort($matches);
95 foreach ($matches as $dockapp)
96 echo "<a href=\"?name=" . urlencode($dockapp) .
97 "\">$dockapp</a><br/>\n";
99 } else {?>
100 Here you can download git snapshots of a number of Window Maker dockapps which
101 are no longer maintained by their original developers and have been adopted by
102 the Window Maker Developers Team. You can browse the repository itself at
103 <a href="http://repo.or.cz/dockapps.git">http://repo.or.cz/dockapps.git</a>.
104 <p/>
105 If you would like to submit a patch to an existing dockapp or add a new dockapp
106 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>.
107 <p/>
108 Some of the dockapps listed are not maintained by the Window Maker Developers
109 Team. You may download these dockapps at their respective websites.
110 <h2>Categories</h2>
111 <?php
112 $categories = array_unique(array_map("getCategory", $dockapps));
113 sort($categories);
114 foreach ($categories as $category)
115 echo "<a href=\"?category=$category\">$category</a><br/>\n";
117 <p/>
118 Many other dockapps may be found at <a href="http://www.cs.mun.ca/~gstarkes/wmaker/dockapps/">http://www.cs.mun.ca/~gstarkes/wmaker/dockapps/</a>.
119 <?php
121 </td>
122 </tr>
123 </table>
125 <?php
126 include("../footer.php");