Add possibility of fetching messages by Message-Id from the search box
authorAlvaro Herrera <[email protected]>
Sun, 8 Mar 2009 00:22:36 +0000 (00:22 +0000)
committerAlvaro Herrera <[email protected]>
Sun, 8 Mar 2009 00:22:36 +0000 (00:22 +0000)
git-svn-id: file:///Users/dpage/pgweb/svn-repo/trunk@2424 8f5c7a92-453e-0410-a47f-ad33c8a6b003

archives/html/message-by-id.php [new file with mode: 0644]
archives/templates/html/search_box.html

diff --git a/archives/html/message-by-id.php b/archives/html/message-by-id.php
new file mode 100644 (file)
index 0000000..d31a5c7
--- /dev/null
@@ -0,0 +1,4 @@
+<?php
+$host = $_SERVER['HTTP_HOST'];
+header("Location: http://$host/message-id/" . $_GET["q"]);
+?>
index 437307a61771c0f289de9011fbcaec32f7fbdbf7..50ac57061d90e2dba8c975770963fe9b5ed0e588 100644 (file)
@@ -1,10 +1,23 @@
-<form method="get" action="http://search.postgresql.org/archives.search">
+<SCRIPT language="JavaScript">
+function formSubmit() {
+       if (document.pressed == 'Search!') {
+               document.searchform.action =
+               "http://search.postgresql.org/archives.search";
+       } else if (document.pressed == 'Message-Id') {
+               document.searchform.action =
+               "http://archives/message-by-id.php";
+       }
+       return true;
+}
+</SCRIPT>
+
+<form name="searchform" method="get" onSubmit="return formSubmit();">
 <div class="tblBasic">
 
 <table border="0" cellpadding="0" cellspacing="0" class="tblBasicGrey" width="590">
    <tr>
       <td class="colFirstRT">Search archives</td>
-      <td class="colLast"><input type="text" name="q" size="30" value=""/> <input type="submit" value="Search!"/></td>
+      <td class="colLast"><input type="text" name="q" size="30" value=""/> <input type="submit" value="Search!" onClick="document.pressed=this.value" /> <input type="submit" value="Message-Id" onClick="document.pressed=this.value" /></td>
    </tr>
 
 <tr>