From 00aa9472d6b032772bcdfedd576ece2fa6f7e1ef Mon Sep 17 00:00:00 2001 From: karlchenofhell Date: Sat, 6 Jan 2007 11:05:50 +0000 Subject: [PATCH] - added decode of HTML-entities in request lines - removed Bookmark symbol on search pages and surftips if not authenticated git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@3172 6c8d7289-2bf4-0310-a012-ef5d649a1542 --- htroot/PerformanceQueues_p.html | 3 --- htroot/Surftips.html | 2 ++ htroot/Surftips.java | 7 +++--- htroot/yacysearch.html | 12 +++++----- htroot/yacysearch.java | 14 ++++++------ source/de/anomic/http/httpd.java | 38 +++++++++++++++++++++++++++++--- 6 files changed, 55 insertions(+), 21 deletions(-) diff --git a/htroot/PerformanceQueues_p.html b/htroot/PerformanceQueues_p.html index fa14fd9e6..48b44a907 100644 --- a/htroot/PerformanceQueues_p.html +++ b/htroot/PerformanceQueues_p.html @@ -220,9 +220,6 @@ -

- -

Proxy Performance Settings

diff --git a/htroot/Surftips.html b/htroot/Surftips.html index 2b87d251f..674bbff59 100644 --- a/htroot/Surftips.html +++ b/htroot/Surftips.html @@ -31,6 +31,7 @@ #{results}#

+ #(authorized)#::
Add to bookmarks #(recommend)# @@ -41,6 +42,7 @@ Give negative vote #(/recommend)#
+ #(/authorized)#

#[title]#

#[description]#

diff --git a/htroot/Surftips.java b/htroot/Surftips.java index 352ede1ba..0951c0e09 100644 --- a/htroot/Surftips.java +++ b/htroot/Surftips.java @@ -137,9 +137,10 @@ public class Surftips { } catch (IOException e) { e.printStackTrace(); } - prop.put("surftips_results_" + i + "_recommend", (voted || !authenticated) ? 0 : 1); - prop.put("surftips_results_" + i + "_recommend_negativeVoteLink", "/Surftips.html?voteNegative=" + urlhash + "&refid=" + refid + "&,display=" + display + ((showScore) ? "&score=" : "")); // for negaive votes, we don't send around the bad url again, the hash is enough - prop.put("surftips_results_" + i + "_recommend_positiveVoteLink", "/Surftips.html?votePositive=" + urlhash + "&refid=" + refid + "&url=" + crypt.simpleEncode(url,null,'b') + "&title=" + crypt.simpleEncode(title,null,'b') + "&description=" + crypt.simpleEncode(description,null,'b') + "&display=" + display + ((showScore) ? "&score=" : "")); + prop.put("surftips_results_" + i + "_authorized", (authenticated) ? 1 : 0); + prop.put("surftips_results_" + i + "_authorized_recommend", (voted) ? 0 : 1); + prop.put("surftips_results_" + i + "_authorized_recommend_negativeVoteLink", "/Surftips.html?voteNegative=" + urlhash + "&refid=" + refid + "&,display=" + display + ((showScore) ? "&score=" : "")); // for negaive votes, we don't send around the bad url again, the hash is enough + prop.put("surftips_results_" + i + "_authorized_recommend_positiveVoteLink", "/Surftips.html?votePositive=" + urlhash + "&refid=" + refid + "&url=" + crypt.simpleEncode(url,null,'b') + "&title=" + crypt.simpleEncode(title,null,'b') + "&description=" + crypt.simpleEncode(description,null,'b') + "&display=" + display + ((showScore) ? "&score=" : "")); prop.put("surftips_results_" + i + "_url", de.anomic.data.wikiCode.replaceHTMLonly(url)); prop.put("surftips_results_" + i + "_urlname", nxTools.shortenURLString(url, 60)); prop.put("surftips_results_" + i + "_urlhash", urlhash); diff --git a/htroot/yacysearch.html b/htroot/yacysearch.html index a00470162..6cf96ec17 100644 --- a/htroot/yacysearch.html +++ b/htroot/yacysearch.html @@ -10,7 +10,7 @@ - + #(display)# #%env/templates/simpleheader.template%# @@ -18,15 +18,15 @@ #%env/templates/header.template%# #(/display)# - +

#[promoteSearchPageGreeting]#

- - + + more options @@ -63,7 +63,7 @@ @@ -116,6 +116,7 @@ document.getElementById("Search").value = "search again - catch up more links"; #{results}#
+ #(authorized)#::
bookmark #(recommend)# @@ -126,6 +127,7 @@ document.getElementById("Search").value = "search again - catch up more links"; delete #(/recommend)#
+ #(/authorized)#

#[description]#

#(snippet)#loading snippet ...::#[text]##(/snippet)#

#[urlname]#

diff --git a/htroot/yacysearch.java b/htroot/yacysearch.java index c09b60731..d5de80ee6 100644 --- a/htroot/yacysearch.java +++ b/htroot/yacysearch.java @@ -52,8 +52,10 @@ import java.util.HashMap; import java.util.Iterator; import java.util.TreeSet; +import de.anomic.data.wikiCode; import de.anomic.htmlFilter.htmlFilterImageEntry; import de.anomic.http.httpHeader; +import de.anomic.http.httpd; import de.anomic.index.indexURLEntry; import de.anomic.kelondro.kelondroBitfield; import de.anomic.kelondro.kelondroMSetTools; @@ -390,16 +392,14 @@ public class yacysearch { prop.put("cat", "href"); prop.put("depth", depth); } - + // if user is not authenticated, he may not vote for URLs - if (!authenticated) { - int linkcount = Integer.parseInt(prop.get("num-results_linkcount", "0")); - for (int i=0; i i) { + if (s.charAt(i + 1) == '#') { // Ӓ symbols + b.write(Integer.parseInt(s.substring(i + 2, end))); + i += end - i; + } else { // 'named' smybols + serverLog.logFine("HTTPD", "discovered yet unimplemented HTML entity '" + s.substring(i, end + 1) + "'"); + b.write(s.charAt(i)); + } + } else { + b.write(s.charAt(i)); + } + } + return b.toString(); + } public static HashMap parseMultipart(httpHeader header, serverObjects args, InputStream in, int length) throws IOException { // this is a quick hack using a previously coded parseMultipart based on a buffer @@ -1103,10 +1135,10 @@ public final class httpd implements serverHandler { tp.put("requestURL", urlString); switch (errorcase) { - case 4: + case ERRORCASE_MESSAGE: tp.put("errorMessageType_detailedErrorMsg",(detailedErrorMsgText==null)?"":detailedErrorMsgText.replaceAll("\n","
")); break; - case 5: + case ERRORCASE_FILE: tp.put("errorMessageType_file",(detailedErrorMsgFile==null)?"":detailedErrorMsgFile); if ((detailedErrorMsgValues != null)&&(detailedErrorMsgValues.size()>0)) { // rewriting the value-names and add the proper name prefix: