diff --git a/defaults/yacy.init b/defaults/yacy.init index bf0c048d6..a0e1ee316 100644 --- a/defaults/yacy.init +++ b/defaults/yacy.init @@ -915,3 +915,8 @@ content.phpbb3.dbuser = notroot content.phpbb3.dbpw = joshua content.phpbb3.ppf = 1000 content.phpbb3.dumpfile = + +# search engine teaser: an about box in search results +# this is only shown, if the about.body is filled +about.headline = +about.body = diff --git a/htroot/yacysearch.html b/htroot/yacysearch.html index 974c3613c..bca85169c 100644 --- a/htroot/yacysearch.html +++ b/htroot/yacysearch.html @@ -56,6 +56,7 @@ $(function() { $("#sidebar2").accordion('activate', false); $("#sidebar3").accordion({}); $("#sidebar3").accordion('activate', false); + $("#sidebarAbout").accordion({}); $("#search").focus(); }); //]]> @@ -128,9 +129,15 @@ document.getElementById("Enter").value = "search again";

Searching the web with this peer is disabled for unauthorized users. Please log in as administrator to use the search function

#(/num-results)# + + +
+ #(geoinfo)# - :: + ::

@@ -150,11 +157,6 @@ document.getElementById("Enter").value = "search again";

#(/geoinfo)# - - -
#(resultTable)#::#(/resultTable)# #{results}# diff --git a/htroot/yacysearchtrailer.html b/htroot/yacysearchtrailer.html index 741b0ba3c..e6f868031 100644 --- a/htroot/yacysearchtrailer.html +++ b/htroot/yacysearchtrailer.html @@ -1,6 +1,6 @@
#(nav-domains)#:: -

Domains

+

Domain Navigator

    #{element}#
  • #[url]#
  • #{/element}#
@@ -9,7 +9,7 @@
#(nav-authors)#:: -

Authors

+

Author Navigator

    #{element}#
  • #[url]#
  • #{/element}#
@@ -18,12 +18,21 @@
#(nav-topics)#:: -

Topics

+

Topic Navigator

    #{element}#
  • #[url]#
  • #{/element}#
#(/nav-topics)#
+#(nav-about)#:: +
+

#[headline]#

+
+#[body]# +
+
+#(/nav-about)# + diff --git a/htroot/yacysearchtrailer.java b/htroot/yacysearchtrailer.java index 950b99cd5..46848e79a 100644 --- a/htroot/yacysearchtrailer.java +++ b/htroot/yacysearchtrailer.java @@ -104,7 +104,7 @@ public class yacysearchtrailer { prop.put("nav-authors_element", authorNavigator.size()); } - // attach always the topics + // topics navigator ArrayList topicNavigator = theSearch.getTopicNavigator(10); if (topicNavigator == null || topicNavigator.size() == 0) { topicNavigator = new ArrayList(); @@ -132,6 +132,17 @@ public class yacysearchtrailer { prop.put("nav-topics_element", i); } + // about box + String aboutBody = env.getConfig("about.body", ""); + String aboutHeadline = env.getConfig("about.headline", ""); + if (aboutBody.length() == 0 && aboutHeadline.length() == 0) { + prop.put("nav-about", 0); + } else { + prop.put("nav-about", 1); + prop.put("nav-about_headline", aboutHeadline); + prop.put("nav-about_body", aboutBody); + } + serverProfiling.update("SEARCH", new ProfilingGraph.searchEvent(theQuery.id(true), SearchEvent.FINALIZATION + "-" + "bottomline", 0, 0), false); return prop; diff --git a/source/de/anomic/document/parser/html/ContentScraper.java b/source/de/anomic/document/parser/html/ContentScraper.java index df42c9295..e1b4f5174 100644 --- a/source/de/anomic/document/parser/html/ContentScraper.java +++ b/source/de/anomic/document/parser/html/ContentScraper.java @@ -324,9 +324,9 @@ public class ContentScraper extends AbstractScraper implements Scraper { public byte[] getText(final String charSet) { try { - return content.toString().getBytes(charSet); + return content.getBytes(charSet); } catch (final UnsupportedEncodingException e) { - return content.toString().getBytes(); + return content.getBytes(); } } diff --git a/source/de/anomic/server/serverCharBuffer.java b/source/de/anomic/server/serverCharBuffer.java index 735197c75..ed2f815cd 100644 --- a/source/de/anomic/server/serverCharBuffer.java +++ b/source/de/anomic/server/serverCharBuffer.java @@ -28,6 +28,7 @@ import java.io.File; import java.io.FileNotFoundException; import java.io.FileReader; import java.io.IOException; +import java.io.UnsupportedEncodingException; import java.io.Writer; import java.util.Properties; @@ -267,6 +268,18 @@ public final class serverCharBuffer extends Writer { System.arraycopy(buffer, offset + start, tmp, 0, end - start); return tmp; } + + public byte[] getBytes(String charset) throws UnsupportedEncodingException { + return new String(buffer, offset, length).getBytes(charset); + } + + public byte[] getBytes() { + try { + return getBytes("UTF-8"); + } catch (UnsupportedEncodingException e) { + return null; + } + } public serverCharBuffer trim(final int start) { // the end value is outside (+1) of the wanted target array
MediaURL