fixed picture tag and presentation

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@2014 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
orbiter 19 years ago
parent 51999578bf
commit d0dd8b14d2

@ -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> <span class="#(snippet)#snippetLoading::snippetLoaded#(/snippet)#" id="#[urlhash]#">#(snippet)#loading snippet ...::#[text]##(/snippet)#</span><br>
<img src="/env/grafics/empty.gif" border="0">&nbsp;<a id="url#[urlhash]#" href="#[url]#">#[urlname]#</a><br> <img src="/env/grafics/empty.gif" border="0">&nbsp;<a id="url#[urlhash]#" href="#[url]#">#[urlname]#</a><br>
<img src="/env/grafics/empty.gif"><span class="ResultDateYBR">&nbsp;#[date]#</span> | <img src="/env/grafics/empty.gif"><span class="ResultDateYBR">&nbsp;#[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> <br>
</p> </p>
<!-- link end --> <!-- link end -->
@ -147,11 +147,17 @@ You can enrich the search results by using the 'global' option; you must also sw
#(/resultbottomline)# #(/resultbottomline)#
</p> </p>
:: ::
<table border="0" cellspacing="16" cellpadding="0">
#{results}# #{results}#
<p style="border-bottom:1px #000 dashed; padding-bottom: 1em;"> <tr valign="bottom">
<a href="#[url]#"><img src="/ViewImage.png?maxwidth=64&maxheight=64&url=#[url]#" border="0"></a> #{line}#
</p> <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}# #{/results}#
</table>
#(/type)# #(/type)#
<br><hr> <br><hr>

@ -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 depth = post.getInt("depth", 0);
int columns = post.getInt("columns", 6);
URL url = null; 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); plasmaSearchImages si = new plasmaSearchImages(sb.snippetCache, 6000, url, depth);
Iterator i = si.entries(); Iterator i = si.entries();
htmlFilterImageEntry ie; htmlFilterImageEntry ie;
int c = 0; int line = 0;
while (i.hasNext()) { while (i.hasNext()) {
ie = (htmlFilterImageEntry) i.next(); int col = 0;
prop.put("type_results_" + c + "_url", ie.url().toString()); for (col = 0; col < columns; col++) {
c++; 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("cat", "image");
prop.put("type", 1); // set type of result: image list prop.put("type", 1); // set type of result: image list

@ -64,7 +64,7 @@ public final class plasmaSearchImages {
plasmaParserDocument document = sc.parseDocument(url, res); plasmaParserDocument document = sc.parseDocument(url, res);
// add the image links // 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 > 0 // add also links from pages one step deeper, if depth > 0
if (depth > 0) { if (depth > 0) {

Loading…
Cancel
Save