Add config option to show HostBrowser link in search result

- ConfigPortal: added checkbox Host Browser
- yacy.init: added search.result.show.hostbrowser as default = on (true)
- fix HostBrowser: broken link to protected WebStructurePicture for public user
pull/1/head
reger 12 years ago
parent 07861cae45
commit e9e0d63897

@ -760,6 +760,7 @@ search.result.show.parser = false
search.result.show.pictures = false
search.result.show.cache = true
search.result.show.proxy = false
search.result.show.hostbrowser = true
search.result.show.tags = false
# search navigators: comma-separated list of default values for search navigation.

@ -82,6 +82,7 @@
<input type="checkbox" name="search.result.show.pictures" value="true" #(search.result.show.pictures)#::checked="checked"#(/search.result.show.pictures)# />Pictures&nbsp;
<input type="checkbox" name="search.result.show.cache" value="true" #(search.result.show.cache)#::checked="checked"#(/search.result.show.cache)# />Cache
<input type="checkbox" name="search.result.show.proxy" value="true" #(search.result.show.proxy)#::checked="checked"#(/search.result.show.proxy)# />Augmented Browsing
<input type="checkbox" name="search.result.show.hostbrowser" value="true" #(search.result.show.hostbrowser)#::checked="checked"#(/search.result.show.hostbrowser)# />Host Browser&nbsp;
<input type="checkbox" name="search.result.show.tags" value="true" #(search.result.show.tags)#::checked="checked"#(/search.result.show.tags)# />Tags
</dd>

@ -96,6 +96,7 @@ public class ConfigPortal {
sb.setConfig("search.result.show.pictures", post.getBoolean("search.result.show.pictures"));
sb.setConfig("search.result.show.cache", post.getBoolean("search.result.show.cache"));
sb.setConfig("search.result.show.proxy", post.getBoolean("search.result.show.proxy"));
sb.setConfig("search.result.show.hostbrowser", post.getBoolean("search.result.show.hostbrowser"));
sb.setConfig("search.result.show.tags", post.getBoolean("search.result.show.tags"));
sb.setConfig(SwitchboardConstants.SEARCH_VERIFY, post.get("search.verify", "ifexist"));
@ -144,6 +145,7 @@ public class ConfigPortal {
sb.setConfig("search.result.show.pictures", false);
sb.setConfig("search.result.show.cache", true);
sb.setConfig("search.result.show.proxy", false);
sb.setConfig("search.result.show.hostbrowser", true);
sb.setConfig("search.result.show.tags", false);
sb.setConfig(SwitchboardConstants.SEARCH_VERIFY, "iffresh");
sb.setConfig(SwitchboardConstants.SEARCH_VERIFY_DELETE, "true");
@ -178,6 +180,7 @@ public class ConfigPortal {
prop.put("search.result.show.pictures", sb.getConfigBool("search.result.show.pictures", false) ? 1 : 0);
prop.put("search.result.show.cache", sb.getConfigBool("search.result.show.cache", false) ? 1 : 0);
prop.put("search.result.show.proxy", sb.getConfigBool("search.result.show.proxy", false) ? 1 : 0);
prop.put("search.result.show.hostbrowser", sb.getConfigBool("search.result.show.hostbrowser", false) ? 1 : 0);
prop.put("search.result.show.tags", sb.getConfigBool("search.result.show.tags", false) ? 1 : 0);
prop.put("search.navigation.hosts", sb.getConfig("search.navigation", "").indexOf("hosts",0) >= 0 ? 1 : 0);

@ -156,9 +156,11 @@ function updatepage(str) {
<div style="width:80px; text-align:right; float: left; white-space:nowrap; overflow:hidden;">#[count]# URLs</div>
</div>
#{/list}#
#(admin)#::
<p style="clear:both"><br/>
<img src="/WebStructurePicture_p.png?host=#[host]#&depth=3&width=1024&height=576&nodes=200&time=1000&colortext=888888&colorback=FFFFFF&colordot0=1111BB&colordota=11BB11&colorline=222222&colorlineend=333333">
</p>
#(/admin)#
</fieldset>
#(/outbound)#

@ -226,6 +226,7 @@ public class HostBrowser {
DigestURI uri = new DigestURI(path);
String host = uri.getHost();
prop.putHTML("outbound_host", host);
if (admin) prop.putHTML("outbound_admin_host", host); //used for WebStructurePicture_p link
prop.putHTML("inbound_host", host);
String hosthash = ASCII.String(uri.hash(), 6, 6);
String[] pathparts = uri.getPaths();

@ -31,8 +31,8 @@
#(showPictures)#::&nbsp;|&nbsp;<a href="yacysearch.html?cat=image&amp;url=#[link]#&amp;query=#[former]#">Pictures</a>#(/showPictures)#
#(showCache)#::&nbsp;|&nbsp;<a href="CacheResource_p.html?url=#[link]#" target="_blank">Cache</a>#(/showCache)#
#(showProxy)#::&nbsp;|&nbsp;<a href="proxy.html?url=#[link]#" target="_blank">Augmented Browsing</a>#(/showProxy)#
#(showHostBrowser)#::&nbsp;|&nbsp;<a href="/HostBrowser.html?path=#[link]#"><img src="/env/grafics/minitree.png" width="15" height="8"/></a>#(/showHostBrowser)#
#(showTags)#::<br/><!--#include virtual="/currentyacypeer/interaction_elements/Tag_part.html?hash=#[urlhash]#&amp;url=#[url]#" -->#(/showTags)#
&nbsp;|&nbsp;<a href="/HostBrowser.html?path=#[link]#"><img src="/env/grafics/minitree.png" width="15" height="8"/></a>
</p>
</div>
::

@ -131,6 +131,7 @@ public class yacysearchitem {
prop.put("content_showPictures", sb.getConfigBool("search.result.show.pictures", true) ? 1 : 0);
prop.put("content_showCache", sb.getConfigBool("search.result.show.cache", true) ? 1 : 0);
prop.put("content_showProxy", sb.getConfigBool("search.result.show.proxy", true) ? 1 : 0);
prop.put("content_showHostBrowser", sb.getConfigBool("search.result.show.hostbrowser", true) ? 1 : 0);
prop.put("content_showTags", sb.getConfigBool("search.result.show.tags", false) ? 1 : 0);
prop.put("content_authorized", authenticated ? "1" : "0");
final String urlhash = ASCII.String(result.hash());
@ -190,6 +191,7 @@ public class yacysearchitem {
prop.put("content_showMetadata_urlhash", resulthashString);
prop.put("content_showCache_link", resultUrlstring);
prop.put("content_showProxy_link", resultUrlstring);
prop.put("content_showHostBrowser_link", resultUrlstring);
prop.put("content_showParser_urlhash", resulthashString);
prop.put("content_showTags_urlhash", resulthashString);
prop.put("content_urlhexhash", Seed.b64Hash2hexHash(resulthashString));

Loading…
Cancel
Save