mark: A photo of Mark kneeling on top of the Taal Volcano in the Philippines. It was a long hike. (Default)
Mark Smith ([staff profile] mark) wrote in [site community profile] changelog2009-04-18 04:42 am

[dw-free] lynx scheme needs search option

[commit: http://hg.dwscoalition.org/dw-free/rev/59215454fe9b]

http://bugs.dwscoalition.org/show_bug.cgi?id=845

Search in Lynx scheme is now useful.

Patch by [personal profile] rho.

Files modified:
  • cgi-bin/bml/scheme/lynx.look
  • htdocs/tools/search.bml
  • htdocs/tools/search.bml.text
--------------------------------------------------------------------------------
diff -r 972523ff650d -r 59215454fe9b cgi-bin/bml/scheme/lynx.look
--- a/cgi-bin/bml/scheme/lynx.look	Sat Apr 18 04:10:55 2009 +0000
+++ b/cgi-bin/bml/scheme/lynx.look	Sat Apr 18 04:42:53 2009 +0000
@@ -59,7 +59,7 @@ _code?>
          $ret .= "<a href='<?siteroot?>/login'><?_ml lynx.nav.login _ml?></a> | ";
     }
 
-    $ret .= "<a href='<?siteroot?>/site/search'><?_ml lynx.nav.search _ml?></a> | ";
+    $ret .= "<a href='<?siteroot?>/tools/search.bml'><?_ml lynx.nav.search _ml?></a> | ";
     $ret .= "<a href='<?siteroot?>/manage/settings/'><?_ml lynx.nav.siteopts _ml?></a> | ";
     $ret .= "<a href='<?siteroot?>/site/'><?_ml lynx.nav.sitemap _ml?></a> ]</p>";
 
diff -r 972523ff650d -r 59215454fe9b htdocs/tools/search.bml
--- a/htdocs/tools/search.bml	Sat Apr 18 04:10:55 2009 +0000
+++ b/htdocs/tools/search.bml	Sat Apr 18 04:42:53 2009 +0000
@@ -1,73 +1,45 @@
 <?page
-title=>Search a Journal
-body<=
+
+# tools/search.bml
+#
+# Basic search page.
+#
+# Authors:
+#      Rachel Walmsley <rho@rho.me.uk>
+#
+# Copyright (c) 2009 by Dreamwidth Studios, LLC.
+#
+# This program is free software; you may redistribute it and/or modify it under
+# the same terms as Perl itself.  For a copy of the license, please reference
+# 'perldoc perlartistic' or 'perldoc perlgpl'.
+#
+
+title<=
 <?_code
 {
     use strict;
-    use vars qw(%GET %ML);
-
-    LJ::set_active_crumb('feedstersearch');
-
-    if ($LJ::DISABLED{'offsite_journal_search'}) {
-        return LJ::bad_input('This search tool is currently disabled');
-    }
-
-    my $u = defined $GET{'journal'} ? LJ::load_user($GET{'journal'}) : LJ::get_remote();
-    return LJ::bad_input($ML{'error.nojournal'}) unless $u;
-
-    my $ljuser = LJ::ljuser($u);
-
-    my $ret;
-
-    # Allow sites to define a custom offsite search tool
-    $ret .= LJ::run_hook('offsite_journal_search', $u);
-
-    unless ($LJ::DISABLED{'feedster_search'}) {
-        $ret .= qq{
-            <?h1 Feedster Search h1?>
-                <?p
-                <b>Note:</b> This search is provided by an independent company, <a href='http://www.feedster.com/'>Feedster.com</a>, and is provided solely as a convenience.  We are not responsible for the resulting content or search results.
-                p?>
-
-                <?standout
-                <form action='http://www.feedster.com/search.php' method='get' style='display:inline'>
-            };
-
-        my $rss_feed = LJ::journal_base($u) . '/data/rss';
-        $ret .= LJ::html_hidden('hl' => 'en', 'ie' => 'UTF-8', 'inrss' => $rss_feed);
-
-        $ret .= qq{
-            <table cellpadding='3'>
-                <tr>
-                <td align='left'>Searching in:</td>
-                <td align='left'>$ljuser</td>
-                </tr>
-                <tr>
-                <td align='left'>Search for:</td>
-                <td align='left'><input maxlength='256' size='45' name='q' value='' /></td>
-                </tr>
-                <tr>
-                <td align='left'>Sort by:</td>
-                <td align='left'>
-                <div>
-                <input type='radio' value='date' name='sort' id='date' checked='checked' /><label for='date'>Date</label>
-                <input type='radio' value='' name='sort' id='relevance' /><label for='relevance'>Relevance</label>
-                <input type='radio' value='blogrank' name='sort' id='blogrank' /><label for='blogrank'>Blogrank</label><br/>
-                </div>
-                </td>
-                </tr>
-                <tr>
-                <td>&nbsp;</td>
-                <td align='left'><input type='submit' value='Search' name='btnG' /></td>
-                </tr>
-                </table>
-                </form>
-                standout?>
-            };
-    }
-
-    return $ret;
+    return BML::ml( ".title", { sitename => $LJ::SITENAMESHORT } );
 }
 _code?>
+<=title
+
+body<=
+
+<?_code
+{
+    use strict;
+    my $ret = "<p>" . BML::ml( ".intro", { sitename => $LJ::SITENAMESHORT } ) . "</p>\n";
+    $ret .= LJ::Widget::Search->render;
+
+    $ret .="<ul>\n<li>";
+    $ret .= BML::ml( ".directory", { aopts => "href='$LJ::SITEROOT/directorysearch.bml'" } );
+    $ret .= " &mdash; <?_ml .directory.desc _ml?> </li>\n<li>";
+    $ret .= BML::ml( ".commsearch", { aopts => "href='$LJ::SITEROOT/community/search.bml'" } );
+    $ret .= " &mdash; <?_ml .commsearch.desc _ml?> </li>\n</ul>\n";
+
+    return $ret
+}
+_code?>
+
 <=body
 page?>
diff -r 972523ff650d -r 59215454fe9b htdocs/tools/search.bml.text
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/htdocs/tools/search.bml.text	Sat Apr 18 04:42:53 2009 +0000
@@ -0,0 +1,12 @@
+;; -*- coding: utf-8 -*-
+.commsearch=<a [[aopts]]>Community Search</a>
+
+.commsearch.desc=Search for communities.
+
+.directory=<a [[aopts]]>Directory Search</a>
+
+.directory.desc=Search for users.
+
+.intro=Search [[sitename]] using the box below, or use one of our advanced search options.
+
+.title=Search [[sitename]]
\ No newline at end of file
--------------------------------------------------------------------------------

Post a comment in response:

This account has disabled anonymous posting.
If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting

If you are unable to use this captcha for any reason, please contact us by email at support@dreamwidth.org