- navigation appear at correct position when opengeodb-results are also presented after a search

- show an about box if about.headline and about.body is set

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@6332 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
orbiter 16 years ago
parent 4db34eea73
commit 23ab6fbca4

@ -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 =

@ -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";
<p>Searching the web with this peer is disabled for unauthorized users. Please <a href="Status.html?login=">log in</a> as administrator to use the search function</p>
#(/num-results)#
<!-- the search results -->
<script type="text/javascript">
var progressbar = new Progressbar(#[results]#, document.getElementById("results"));
</script>
<div style="float:left; width:70%;">
<!-- show openstreetmap tiles if geoinfo was found -->
#(geoinfo)#
::
::
<div class="searchresults">
<h4 class="linktitle">
<img src="http://www.openstreetmap.org/favicon.ico" class="favicon" style="width:16px; height:16px;" alt="" />
@ -150,11 +157,6 @@ document.getElementById("Enter").value = "search again";
</div>
#(/geoinfo)#
<!-- the search results -->
<script type="text/javascript">
var progressbar = new Progressbar(#[results]#, document.getElementById("results"));
</script>
<div style="float:left; width:70%;">
<!-- linklist begin -->
#(resultTable)#::<table width="100%"><tr class="TableHeader"><td width="30%">Media</td><td width="70%">URL</tr>#(/resultTable)#
#{results}#

@ -1,6 +1,6 @@
<div id="sidebar1" style="float: right; margin-top:5px; width: 220px;">
#(nav-domains)#::
<h3 style="padding-left:25px;">Domains</h3>
<h3 style="padding-left:25px;">Domain Navigator</h3>
<div><ul style="padding-left: 0px;">#{element}#
<li>#[url]#</li>
#{/element}#</ul></div>
@ -9,7 +9,7 @@
<div id="sidebar2" style="float: right; margin-top:5px; width: 220px;">
#(nav-authors)#::
<h3 style="padding-left:25px;">Authors</h3>
<h3 style="padding-left:25px;">Author Navigator</h3>
<div><ul style="padding-left: 0px;">#{element}#
<li>#[url]#</li>
#{/element}#</ul></div>
@ -18,12 +18,21 @@
<div id="sidebar3" style="float: right; margin-top:5px; width: 220px;">
#(nav-topics)#::
<h3 style="padding-left:25px;">Topics</h3>
<h3 style="padding-left:25px;">Topic Navigator</h3>
<div><ul style="padding-left: 0px;">#{element}#
<li>#[url]#</li>
#{/element}#</ul></div>
#(/nav-topics)#
</div>
#(nav-about)#::
<div id="sidebarAbout" style="float: right; margin-top:5px; width: 220px;">
<h3 style="padding-left:25px;">#[headline]#</h3>
<div>
#[body]#
</div>
</div>
#(/nav-about)#

@ -104,7 +104,7 @@ public class yacysearchtrailer {
prop.put("nav-authors_element", authorNavigator.size());
}
// attach always the topics
// topics navigator
ArrayList<NavigatorEntry> topicNavigator = theSearch.getTopicNavigator(10);
if (topicNavigator == null || topicNavigator.size() == 0) {
topicNavigator = new ArrayList<NavigatorEntry>();
@ -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;

@ -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();
}
}

@ -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

Loading…
Cancel
Save