Add main index page. Needs more polish.
authorRusty Russell <rusty@rustcorp.com.au>
Mon, 11 Aug 2008 05:11:42 +0000 (15:11 +1000)
committerRusty Russell <rusty@rustcorp.com.au>
Mon, 11 Aug 2008 05:11:42 +0000 (15:11 +1000)
web/index.html [deleted file]
web/index.php [new file with mode: 0644]
web/main.html [new file with mode: 0644]
web/menulist.html

diff --git a/web/index.html b/web/index.html
deleted file mode 100644 (file)
index b3e3c95..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-<html>
-<head>
-<title>ccan</title>
-</head>
-<body>
-<META HTTP-EQUIV="Refresh"
-      CONTENT="0; URL=login.php">
-</body>
-</html>
-
diff --git a/web/index.php b/web/index.php
new file mode 100644 (file)
index 0000000..20f400c
--- /dev/null
@@ -0,0 +1,40 @@
+<?php
+session_start();
+include('logo.html');
+include('menulist.html');
+include('configuration');
+include('searchengine.php');
+include('main.html');
+
+if(isset($_POST['search'])) {
+       $searchtext = $_REQUEST['searchtext'];
+       $in = $_REQUEST['searchmenu'];
+       if(trim($searchtext) == '') { 
+               echo '<div align="center"><font color="RED">Please enter some keyword to search</font></div>';
+               exit();
+       }
+}
+else if($_GET['author'] != '') {
+       $searchtext = $_GET['author'];
+       $in = "author";
+}      
+else if ($_GET['disp'] == 'all') {
+       $searchtext = "";
+       $in = "module";
+}      
+else 
+       exit();
+       
+$result = searchdb($searchtext, $in, $db);
+echo '<table align="left" border="0" cellpadding="8" cellspacing="1">';
+if($row = sqlite3_fetch_array($result)) 
+       echo "<tr><td><a href=\"dispmoduleinfo.php?module=".$row['module']."\">".$row["module"]."</a></br>".
+                "<a href=\"search.php?author=".$row["author"]."\">".$row["author"]."</a> : ". $row["title"]." </br> </br></td></tr>";
+else
+       echo '<div align="center"><font color="RED"> No results found</font></div>';
+while($row = sqlite3_fetch_array($result)) {   
+       echo "<tr><td><a href=\"dispmoduleinfo.php?module=".$row['module']."\">".$row["module"]."</a></br>".
+                "<a href=\"search.php?author=".$row["author"]."\">".$row["author"]."</a> : ". $row["title"]." </br> </br></td></tr>";
+}
+echo '</table>';
+?>
diff --git a/web/main.html b/web/main.html
new file mode 100644 (file)
index 0000000..773e3a1
--- /dev/null
@@ -0,0 +1,46 @@
+<p>CCAN provides two kinds of useful C
+code: <a href="http://ccan.ozlabs.org/repo/?cmd=inventory;path=junkcode">junkcode</a> is a
+collection of uploaded code with no particular order, and
+
+<a href="search.php?disp=all">CCAN modules</a> are more structured,
+with documentation, dependencies and testcases.
+
+</p>
+
+<h2>Using The Code</h2>
+
+<p>
+
+You can <a href="search.php">search</a>, <a href="search.php?disp=all">browse summary pages for all the modules</a> or use the
+<a href="http://bazaar-vcs.org/">Bazaar</a> repository
+at <a href="http://ccan.ozlabs.org/repo">http://ccan.ozlabs.org/repo</a>.
+
+</p>
+
+<h2>Contributing Code</h2>
+
+<p>
+You can <a href="upload.php">upload a .tar.gz, .tar.bz, .tar or .zip
+containing C code</a>; if you have not created an account this won't be
+visible until the contents have been checked by a human.
+</p>
+
+<p>"GPLv2 or later" and supersets thereof (eg. LGPLv2+ or BSD)
+licenses preferred.
+</p>
+
+<h2>Questions?</h2>
+
+<p>
+We have a <a href="http://ozlabs.org/mailman/listinfo/ccan">low volume
+mailing list</a> for discussion of CCAN in general, and you're welcome
+to join.
+</p>
+
+<p>
+We also have an IRC channel: #ccan on <a href="http://freenode.net">Freenode</a>.
+</p>
+
+<p>
+We also have a <a href="Wiki/">wiki</a>; feel free to enhance it.
+</p>
index 6e7e63b072c1e2d0c691d8587c992cb63b387e5e..7e0232cb0b606807b0525d7d764d7d8ca4f1709d 100644 (file)
@@ -27,4 +27,4 @@ session_start();
        Logout</a>
   </td>
 </table>
-<hr>
\ No newline at end of file
+<hr>