Skip to content

Commit

Permalink
fixed picture tag and presentation
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@2014 6c8d7289-2bf4-0310-a012-ef5d649a1542
  • Loading branch information
orbiter committed Apr 7, 2006
1 parent 5199957 commit d0dd8b1
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 12 deletions.
14 changes: 10 additions & 4 deletions htroot/yacysearch.html
Expand Up @@ -119,7 +119,7 @@
<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"><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>
</p>
<!-- link end -->
Expand Down Expand Up @@ -147,11 +147,17 @@
#(/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>
Expand Down
25 changes: 18 additions & 7 deletions htroot/yacysearch.java
Expand Up @@ -314,21 +314,32 @@ public static serverObjects respond(httpHeader header, serverObjects post, serve

}

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 list
Expand Down
2 changes: 1 addition & 1 deletion source/de/anomic/plasma/plasmaSearchImages.java
Expand Up @@ -64,7 +64,7 @@ public plasmaSearchImages(plasmaSnippetCache sc, long maxTime, URL url, int dept
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 > 0
if (depth > 0) {
Expand Down

0 comments on commit d0dd8b1

Please sign in to comment.