io: always make fds O_NONBLOCK.
[ccan] / web / staticmoduleinfo.php
index ba73265696383d7b7898bf38b79b1f6dabf4a5ea..2174f7a598c8c78ef11bed1141010e46684a7791 100644 (file)
@@ -4,16 +4,18 @@ include('logo.html');
 include('menulist.html');
 include('static-configuration');
 $module_path=$argv[1];
-$module=basename($module_path);
+$module=$argv[2];
 $maintainer=extract_field('maintainer',$module_path);
 $author=extract_field('author',$module_path);
 $summary=extract_field('summary',$module_path);
+$see_also=extract_field('see_also',$module_path);
 $description=htmlize_field('description',$module_path);
 $example=extract_field('example',$module_path);
 $dependencies=htmlspecialchars(shell_exec('tools/ccan_depends --direct '.$module_path));
 $extdepends=htmlspecialchars(shell_exec('tools/ccan_depends --compile --non-ccan '.$module_path));
 $licence=extract_field('licence',$module_path);
 $license=extract_field('license',$module_path);
+$url_prefix = getenv("URLPREFIX");
 ?>
 <table align="center" bgcolor="lightblue" width="70%" border="0" cellpadding="3" cellspacing="1">
 <tr align="center" bgcolor="FFFFCC">
@@ -21,8 +23,8 @@ $license=extract_field('license',$module_path);
 <a href="<?=$repo_base.$module?>">Browse Source</a>
 </td>
 <td>
-<a href="../<?=$tar_dir?>/with-deps/<?=$module?>.tar.bz2">Download</a>
-<a href="../<?=$tar_dir?>/<?=$module?>.tar.bz2">(without any required ccan dependencies)</a>
+<a href="<?=$url_prefix?><?=$tar_dir?>/with-deps/<?=$module?>.tar.bz2">Download</a>
+<a href="<?=$url_prefix?><?=$tar_dir?>/<?=$module?>.tar.bz2">(without any required ccan dependencies)</a>
 </tr>
 </table>
 
@@ -86,7 +88,20 @@ if ($extdepends) {
 <tr align="left" bgcolor="FFFFCC">
 <td><h3>Description: </h3> <?=$description;?> </td>
 </tr>
+
 <?php 
+if ($see_also) {
+?>
+<tr align="left" bgcolor="FFFFCC">
+<td><h3>See Also: </h3> <pre> <?php
+       foreach (preg_split("/[\s,]+/", trim($see_also)) as $see) {
+               echo '<a href="'.substr($see, 5).'.html">'.$see.'</a> ';
+        }
+?></pre></td>
+</tr>
+<?php
+}
+
 if ($example) {
 ?>
 <tr align="left" bgcolor="FFFFCC">