Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance
Java decentralizedintranet-searchintranet-search-enginep2pp2p-networkprivacyprivacy-protectionsearch-enginesearchenginewebweb-search-enginewebsearchwebseearch-engine
fixed picture tag and presentation
orbiterd0dd8b14d2b0
diff --git a/htroot/yacysearch.html b/htroot/yacysearch.htmlindex 3fdc2196c..a867f7a78 100644--- a/htroot/yacysearch.html+++ b/htroot/yacysearch.html@@ -119,7 +119,7 @@ available for everyone. Then stay online to support crawls from other peers. Tha<span class="#(snippet)#snippetLoading::snippetLoaded#(/snippet)#" id="#[urlhash]#">#(snippet)#loading snippet ...::#[text]##(/snippet)#</span><br><img src="/env/grafics/empty.gif" border="0"> <a id="url#[urlhash]#" href="#[url]#">#[urlname]#</a><br><img src="/env/grafics/empty.gif"><span class="ResultDateYBR"> #[date]#</span> |-<span class="ResultDateYBR">YBR-#[ybr]#</span> | <a href="ViewFile.html?urlHash=#[urlhash]#&words=#[words]#">Info</a> | <a href="yacysearch.html?cat=image&url=#[url]">Pictures</a>+<span class="ResultDateYBR">YBR-#[ybr]#</span> | <a href="ViewFile.html?urlHash=#[urlhash]#&words=#[words]#">Info</a> | <a href="yacysearch.html?cat=image&url=#[url]#">Pictures</a><br></p><!-- link end -->@@ -147,11 +147,17 @@ You can enrich the search results by using the 'global' option; you must also sw#(/resultbottomline)#</p>::+<table border="0" cellspacing="16" cellpadding="0">#{results}#-<p style="border-bottom:1px #000 dashed; padding-bottom: 1em;">-<a href="#[url]#"><img src="/ViewImage.png?maxwidth=64&maxheight=64&url=#[url]#" border="0"></a>-</p>+<tr valign="bottom">+#{line}#+<td>+<a href="#[url]#"><img src="/ViewImage.png?maxwidth=96&maxheight=96&url=#[url]#" border="0"></a><br><a href="#[url]#">#[name]#</a>+</td>+#{/line}#+</tr>#{/results}#+</table>#(/type)#<br><hr>diff --git a/htroot/yacysearch.java b/htroot/yacysearch.javaindex 211a7104f..58bac30fa 100644--- a/htroot/yacysearch.java+++ b/htroot/yacysearch.java@@ -314,21 +314,32 @@ public class yacysearch {}- if ((post.get("cat", "href").equals("image")) && (querystring.startsWith("http://"))) {+ if (post.get("cat", "href").equals("image")) {int depth = post.getInt("depth", 0);+ int columns = post.getInt("columns", 6);URL url = null;- try {url = new URL(querystring);} catch (MalformedURLException e) {}+ try {url = new URL(post.get("url", ""));} catch (MalformedURLException e) {}plasmaSearchImages si = new plasmaSearchImages(sb.snippetCache, 6000, url, depth);Iterator i = si.entries();htmlFilterImageEntry ie;- int c = 0;+ int line = 0;while (i.hasNext()) {- ie = (htmlFilterImageEntry) i.next();- prop.put("type_results_" + c + "_url", ie.url().toString());- c++;+ int col = 0;+ for (col = 0; col < columns; col++) {+ if (!i.hasNext()) break;+ ie = (htmlFilterImageEntry) i.next();+ String urls = ie.url().toString();+ String name = "";+ int p = urls.lastIndexOf('/');+ if (p > 0) name = urls.substring(p + 1);+ prop.put("type_results_" + line + "_line_" + col + "_url", urls);+ prop.put("type_results_" + line + "_line_" + col + "_name", name);+ }+ prop.put("type_results_" + line + "_line", col);+ line++;}- prop.put("type_results", c);+ prop.put("type_results", line);prop.put("cat", "image");prop.put("type", 1); // set type of result: image listdiff --git a/source/de/anomic/plasma/plasmaSearchImages.java b/source/de/anomic/plasma/plasmaSearchImages.javaindex a5023f5fa..539c720bb 100644--- a/source/de/anomic/plasma/plasmaSearchImages.java+++ b/source/de/anomic/plasma/plasmaSearchImages.java@@ -64,7 +64,7 @@ public final class plasmaSearchImages {plasmaParserDocument document = sc.parseDocument(url, res);// add the image links- this.addAll(document.getImages());+ if (document != null) this.addAll(document.getImages());// add also links from pages one step deeper, if depth > 0if (depth > 0) {