]> git.ozlabs.org Git - ccan/commitdiff
display a-z index for module search and some fixes
authordinesh <dinesh@dinesh-laptop>
Sat, 16 Aug 2008 17:47:26 +0000 (23:17 +0530)
committerdinesh <dinesh@dinesh-laptop>
Sat, 16 Aug 2008 17:47:26 +0000 (23:17 +0530)
17 files changed:
web/db/ccan.db
web/dispmoduleinfo.php
web/search.html
web/search.php
web/searchengine.php
web/tarball/alloc-test.tar [new file with mode: 0644]
web/tarball/alloc-test_with_deps.tar [new file with mode: 0644]
web/tarball/alloc.tar
web/tarball/alloc_with_deps.tar
web/tarball/string-test.tar [new file with mode: 0644]
web/tarball/string-test_with_deps.tar [new file with mode: 0644]
web/tarball/string_with_deps.tar
web/tarball/talloc_with_deps.tar
web/tarball/typesafe_cb.tar
web/tarball/typesafe_cb_with_deps.tar
web/tools/create_dep_tar
web/tools/infotojson

index 503c7fcc4c2309b8b2b419128731fa0a28e13841..fcb87f86595be94e389b5633408eecc1904a352d 100755 (executable)
Binary files a/web/db/ccan.db and b/web/db/ccan.db differ
index 9c26f9ea72a9881578fd38d66287ed259f60023c..3906d3cc87257ca4261bfe4960d33c09a976d6c6 100644 (file)
@@ -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>
index 3a497b9f75aa9b0bd805383224ad84d3afdc41c2..694dbf25994fc764f4fc915df76132aebb2323ae 100644 (file)
                <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>
index d0c553303014134346bca0aa2377f0ad49fa126d..d518d9f478963f57058a64c351cde9e4c85f576c 100644 (file)
@@ -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>';
 ?>
index 6117f38b864cfbc6aa2198686ded1109ff5e865c..fdc5e9f8d0feea73958f0ea0c8732e4f89284990 100644 (file)
@@ -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;
diff --git a/web/tarball/alloc-test.tar b/web/tarball/alloc-test.tar
new file mode 100644 (file)
index 0000000..32b17f9
Binary files /dev/null and b/web/tarball/alloc-test.tar differ
diff --git a/web/tarball/alloc-test_with_deps.tar b/web/tarball/alloc-test_with_deps.tar
new file mode 100644 (file)
index 0000000..3cb4390
Binary files /dev/null and b/web/tarball/alloc-test_with_deps.tar differ
index f6accbde702e0c961401dd63163d6d9332cef33c..6e90adad749a658af405b86d132b6b3efb557806 100644 (file)
Binary files a/web/tarball/alloc.tar and b/web/tarball/alloc.tar differ
index e302074c8fcd654cf9851d0bb222199135f104de..265e05dd4736f9acec503574a557390eb69588b9 100644 (file)
Binary files a/web/tarball/alloc_with_deps.tar and b/web/tarball/alloc_with_deps.tar differ
diff --git a/web/tarball/string-test.tar b/web/tarball/string-test.tar
new file mode 100644 (file)
index 0000000..affcc51
Binary files /dev/null and b/web/tarball/string-test.tar differ
diff --git a/web/tarball/string-test_with_deps.tar b/web/tarball/string-test_with_deps.tar
new file mode 100644 (file)
index 0000000..bf05534
Binary files /dev/null and b/web/tarball/string-test_with_deps.tar differ
index f7cde0764e82a5856da0f7fb76fafcb8e4e56609..7a9f37faf662a6c592f9582cbd27cb57bbecf616 100644 (file)
Binary files a/web/tarball/string_with_deps.tar and b/web/tarball/string_with_deps.tar differ
index 38c87d394c7f38acbc89771b125506b58c488087..7e222da88bd928cacf923c588dbdf618d9f20445 100644 (file)
Binary files a/web/tarball/talloc_with_deps.tar and b/web/tarball/talloc_with_deps.tar differ
index 937e70977593ce3fb14e4c0bee6490b0008614eb..10fecaaf4168300e5d681ce5b6b2ff8b7f5fbf99 100644 (file)
Binary files a/web/tarball/typesafe_cb.tar and b/web/tarball/typesafe_cb.tar differ
index 79b8e588028ef528fcc288ed644a655a5484e7ea..5fe6dc0477bf1bed8f91c7bad5b27758abaccc1b 100644 (file)
Binary files a/web/tarball/typesafe_cb_with_deps.tar and b/web/tarball/typesafe_cb_with_deps.tar differ
index 50234d80c6e355496c40517608d74996b9ae1990..715fb6ba856c2d501e41284ea4852fe9ba7100db 100755 (executable)
Binary files a/web/tools/create_dep_tar and b/web/tools/create_dep_tar differ
index 9ceaa2fa082d3fef16d8037fe385668608cd89d3..366a79d6d8e104170856d787886ef8e8a0f64976 100755 (executable)
Binary files a/web/tools/infotojson and b/web/tools/infotojson differ