Browse Source

Add main index page. Needs more polish.

Rusty Russell 17 years ago
parent
commit
58e2f5cb46
4 changed files with 87 additions and 11 deletions
  1. 0 10
      web/index.html
  2. 40 0
      web/index.php
  3. 46 0
      web/main.html
  4. 1 1
      web/menulist.html

+ 0 - 10
web/index.html

@@ -1,10 +0,0 @@
-<html>
-<head>
-<title>ccan</title>
-</head>
-<body>
-<META HTTP-EQUIV="Refresh"
-      CONTENT="0; URL=login.php">
-</body>
-</html>
-

+ 40 - 0
web/index.php

@@ -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>';
+?>

+ 46 - 0
web/main.html

@@ -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>

+ 1 - 1
web/menulist.html

@@ -27,4 +27,4 @@ session_start();
 	Logout</a>
 	Logout</a>
   </td>
   </td>
 </table>
 </table>
-<hr>
+<hr>