Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance
Java decentralizedintranet-searchintranet-search-enginep2pp2p-networkprivacyprivacy-protectionsearch-enginesearchenginewebweb-search-enginewebsearchwebseearch-engine
Display result favicons only for http or https resources.
luccioman52d05d14c6c8
diff --git a/htroot/yacysearchitem.html b/htroot/yacysearchitem.htmlindex e8b4d1dfd..7f8513a09 100644--- a/htroot/yacysearchitem.html+++ b/htroot/yacysearchitem.html@@ -1,7 +1,9 @@#(content)#::<div class="searchresults"><h4 class="linktitle">- <img width="16" height="16" src="#[faviconUrl]#" id="f#[urlhash]#" class="favicon" style="width:16px; height:16px;" alt="" />+ #(favicon)#::+ <img width="16" height="16" src="#[faviconUrl]#" id="f#[urlhash]#" class="favicon" style="width:16px; height:16px;" alt="" />+ #(/favicon)#<a href="#[link]#" target="#[target]#">#[title]#</a></h4><div class="urlactions">#(heuristic)#::diff --git a/htroot/yacysearchitem.java b/htroot/yacysearchitem.javaindex 8874b2e33..34e258326 100644--- a/htroot/yacysearchitem.java+++ b/htroot/yacysearchitem.java@@ -184,10 +184,15 @@ public class yacysearchitem {String resultFileName = resultURL.getFileName();prop.putHTML("content_target", target);DigestURL faviconURL = null;- if ((fileType == FileType.HTML || fileType == FileType.JSON) && !sb.isIntranetMode()) {+ if ((fileType == FileType.HTML || fileType == FileType.JSON) && (resultURL.isHTTP() || resultURL.isHTTPS())) {faviconURL = getFaviconURL(result, new Dimension(16, 16));}- prop.putHTML("content_faviconUrl", processFaviconURL(ImageViewer.hasFullViewingRights(header, sb), faviconURL));+ if(faviconURL == null) {+ prop.put("content_favicon", 0);+ } else {+ prop.put("content_favicon", 1);+ }+ prop.putHTML("content_favicon_faviconUrl", processFaviconURL(ImageViewer.hasFullViewingRights(header, sb), faviconURL));prop.put("content_urlhash", urlhash);prop.put("content_ranking", Float.toString(result.score()));Date[] events = result.events();diff --git a/htroot/yacysearchitem.json b/htroot/yacysearchitem.jsonindex 0e3aa9664..59f04c10f 100644--- a/htroot/yacysearchitem.json+++ b/htroot/yacysearchitem.json@@ -9,7 +9,7 @@"size": "#[size]#","sizename": "#[sizename]#","guid": "#[urlhash]#",- "faviconUrl": "#[faviconUrl]#",+ #(favicon)#::"faviconUrl": "#[faviconUrl]#",#(/favicon)#"host": "#[host]#","path": "#[path]#","file": "#[file]#",