Browse Source

display a-z index for module search and some fixes

dinesh 17 years ago
parent
commit
8d43fa7458

BIN
web/db/ccan.db


+ 2 - 2
web/dispmoduleinfo.php

@@ -13,12 +13,12 @@ $row = sqlite3_fetch_array($result);
 <tr align="center" bgcolor="FFFFCC">
 <td width="50%">
 	<?php 
-		if(file_exists($tar_dir . $_GET['module']."_dependencies.tar"))
+		if(file_exists($tar_dir . $_GET['module'].".tar"))
 			echo '<a href='. $tar_dir . $_GET['module'] . '.tar>Download</a>';
 	?>
 <td>
 	<?php 
-		if(file_exists($tar_dir . $_GET['module']."_dependencies.tar"))
+		if(file_exists($tar_dir . $_GET['module']."_with_deps.tar"))
 			echo '<a href='. $tar_dir . $_GET['module'] . '_with_deps.tar>Download Dependencies</a>';
 	?>
 </td>

+ 11 - 0
web/search.html

@@ -24,4 +24,15 @@
 		<td align="left"><a href=search.php?disp=all>Display all</a></td>
 		</tr>
 		</table>
+		<table align="center">
+ 				<tr align="left">
+ 				<?php
+ 					for ($i = "a"; $i != "aa"; $i++) {
+ 						echo '<td><a href=search.php?disp='. $i . '>'. $i .'</a></td>';
+ 					}
+ 				?>
+				</tr> 					
+ 			</td>
+ 		</tr>
+		</table>
 		</form>

+ 13 - 5
web/search.php

@@ -12,16 +12,22 @@ if(isset($_POST['search'])) {
 	if(trim($searchtext) == '') { 
 		echo '<div align="center"><font color="RED">Please enter some keyword to search</font></div>';
 		exit();
-	}
+	} 
+	$searchtext = '%'.$searchtext.'%';
 }
 else if($_GET['author'] != '') {
-	$searchtext = $_GET['author'];
+	$searchtext = '%'.$_GET['author'].'%';
 	$in = "author";
 }	
 else if ($_GET['disp'] == 'all') {
-	$searchtext = "";
+	$searchtext = "%";
+	$in = "module";
+}
+else if ($_GET['disp'] != '') {
+	$searchtext = $_GET['disp'].'%';
 	$in = "module";
 }	
+	
 else 
 	exit();
 	
@@ -29,12 +35,14 @@ $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>";
+		 		"<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>";
+		 		"<a href=\"search.php?author=".$row["author"]."\">".$row["author"]."</a> : ". $row["title"].
+		 			" </br> </br></td></tr>";
 }
 echo '</table>';
 ?>

+ 6 - 3
web/searchengine.php

@@ -4,11 +4,14 @@ function searchdb($text, $in, $db)
 	//search db 
 	$handle = sqlite3_open($db) or die("Could not open database");
 	if($in == 'module')
-		$query = "select * from search where title LIKE \"%$text%\"";
+		$query = "select * from search where title LIKE \"$text\" order by module,
+						author";
 	else if($in == 'author')
-		$query = "select * from search where author LIKE \"%$text%\"";
+		$query = "select * from search where author LIKE \"$text\" order by module, 
+						author";
 	else 	
-		$query = "select * from search where title LIKE \"%$text%\" or author LIKE \"%$text%\"";
+		$query = "select * from search where title LIKE \"$text\" or author LIKE \"$text\" 
+						order by module, author";
 		
 	$result = sqlite3_query($handle, $query) or die("Error in query: ".sqlite3_error($handle));
 	return $result;

BIN
web/tarball/alloc-test.tar


BIN
web/tarball/alloc-test_with_deps.tar


BIN
web/tarball/alloc.tar


BIN
web/tarball/alloc_with_deps.tar


BIN
web/tarball/string-test.tar


BIN
web/tarball/string-test_with_deps.tar


BIN
web/tarball/string_with_deps.tar


BIN
web/tarball/talloc_with_deps.tar


BIN
web/tarball/typesafe_cb.tar


BIN
web/tarball/typesafe_cb_with_deps.tar


BIN
web/tools/create_dep_tar


BIN
web/tools/infotojson