From b873ad51aba49efb5eff8ade221fa4278e40f21a Mon Sep 17 00:00:00 2001 From: karlchenofhell Date: Fri, 12 Jan 2007 00:52:38 +0000 Subject: [PATCH] - fix for http://www.yacy-forum.de/viewtopic.php?t=3369 - merged netBude's alternative for tables in yacysearch.html & search results valid - added statistic info to index.html as proposed here: http://www.yacy-forum.de/viewtopic.php?p=29762#29762 - fixed error-log in httpTemplate git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@3189 6c8d7289-2bf4-0310-a012-ef5d649a1542 --- htroot/Network.xml | 10 ++-- htroot/PerformanceQueues_p.html | 2 +- htroot/Surftips.java | 1 + htroot/env/base.css | 13 +++++ htroot/index.html | 13 ++--- htroot/index.java | 15 +++++- htroot/js/yacysearch.js | 4 +- htroot/yacysearch.html | 49 ++++++++----------- source/de/anomic/http/httpTemplate.java | 4 +- .../de/anomic/plasma/plasmaSwitchboard.java | 5 +- 10 files changed, 69 insertions(+), 47 deletions(-) diff --git a/htroot/Network.xml b/htroot/Network.xml index 1a466c6be..45efbe193 100644 --- a/htroot/Network.xml +++ b/htroot/Network.xml @@ -18,9 +18,9 @@ #[rU]# #(type)#junior::senior::principal#(/type)# #(type_direct)#direct::passive#(/type_direct)# - #(acceptcrawl)#0::1#(/acceptcrawl)# - #(dhtreceive)#0::1#(/dhtreceive)# - #(rankingreceive)#0::1#(/rankingreceive)# + #[acceptcrawl]# + #[dhtreceive]# + #[rankingreceive]# #[location]# #(complete)# :: @@ -62,8 +62,8 @@ #[my-uptime]# #[my-links]# #[my-words]# - #(my-acceptcrawl)#0::1#(/my-acceptcrawl)# - #(my-dhtreceive)#0::1#(/my-dhtreceive)# + #[my-acceptcrawl]# + #[my-dhtreceive]# #[my-sI]# #[my-sU]# #[my-rI]# diff --git a/htroot/PerformanceQueues_p.html b/htroot/PerformanceQueues_p.html index 48b44a907..0648fe691 100644 --- a/htroot/PerformanceQueues_p.html +++ b/htroot/PerformanceQueues_p.html @@ -51,7 +51,7 @@ #[memusepercycle]# milliseconds milliseconds - kbytes + kbytes #[longdescr]# #{/table}# diff --git a/htroot/Surftips.java b/htroot/Surftips.java index 0951c0e09..065e39ca1 100644 --- a/htroot/Surftips.java +++ b/htroot/Surftips.java @@ -141,6 +141,7 @@ public class Surftips { 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 + "_authorized_urlhash", urlhash); 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/env/base.css b/htroot/env/base.css index 10b857d90..e37b47b23 100644 --- a/htroot/env/base.css +++ b/htroot/env/base.css @@ -164,6 +164,19 @@ form.search table { text-align:left; } +fieldset.yacysearch { + text-align:left; + padding-top:10px; + display:block; +} + +div.yacysearch { + margin-top: .8em; + display:block; + position:relative; + /*left:-60px;*/ +} + h2.yacy { /* The heading in index.html */ margin:10px auto; text-align:center; diff --git a/htroot/index.html b/htroot/index.html index c1a66dbf6..0fd745a05 100644 --- a/htroot/index.html +++ b/htroot/index.html @@ -22,11 +22,11 @@
- Text   - Images   - Audio   - Video   - Applications       +    +    +    +    +        #(searchoptions)# @@ -101,11 +101,12 @@ Constraints: - only index pages + #(/searchoptions)# +

This peer holds #[links]# URLs of #[total-links]# in the known network.

#(display)# diff --git a/htroot/index.java b/htroot/index.java index 774620fe7..58ea9d415 100644 --- a/htroot/index.java +++ b/htroot/index.java @@ -40,6 +40,8 @@ import de.anomic.server.serverCore; import de.anomic.server.serverDate; import de.anomic.server.serverObjects; import de.anomic.server.serverSwitch; +import de.anomic.yacy.yacyCore; +import de.anomic.yacy.yacySeed; public class index { @@ -91,6 +93,11 @@ public class index { if (cds.equals("image")) contentdom = plasmaSearchQuery.CONTENTDOM_IMAGE; if (cds.equals("app")) contentdom = plasmaSearchQuery.CONTENTDOM_APP; + try { + prop.put("links", groupDigits(Long.parseLong(yacyCore.seedDB.mySeed.get(yacySeed.LCOUNT, "0")))); + } catch (NumberFormatException e) { prop.put("links", "0"); } + prop.put("total-links", groupDigits(yacyCore.seedDB.countActiveURL())); + // we create empty entries for template strings String promoteSearchPageGreeting = env.getConfig("promoteSearchPageGreeting", ""); if (promoteSearchPageGreeting.length() == 0) promoteSearchPageGreeting = "P2P WEB SEARCH"; @@ -133,5 +140,11 @@ public class index { return prop; } - + + private static String groupDigits(long Number) { + final String s = Long.toString(Number); + String t = ""; + for (int i = 0; i < s.length(); i++) t = s.charAt(s.length() - i - 1) + (((i % 3) == 0) ? "." : "") + t; + return t.substring(0, t.length() - 1); + } } diff --git a/htroot/js/yacysearch.js b/htroot/js/yacysearch.js index 48d05c736..ef5487a5f 100644 --- a/htroot/js/yacysearch.js +++ b/htroot/js/yacysearch.js @@ -4,7 +4,7 @@ function AllTextSnippets() { var span = document.getElementsByTagName("span"); for(var x=0;x

#[promoteSearchPageGreeting]#

-
- - - - - - - - -
+
+
- -
+   more options -
+
   @@ -44,9 +37,7 @@    -
+ @@ -60,6 +51,7 @@
+ -

#(resultbottomline)# :: - The global search resulted in #[globalresults]# link contributions from other YaCy peers. +

The global search resulted in #[globalresults]# link contributions from other YaCy peers.

:: - You can enrich the search results by using the 'global' option: This will search also other YaCy peers +

You can enrich the search results by using the 'global' option: This will search also other YaCy peers

:: - You cannot get global search results because you are not connected to another YaCy peer. - To connect you must first use the proxy. - See here for an installation guide. - Alternatively, you can run the proxy in permanent online mode, which also grants global search. - To do this, press this button:

+

+ You cannot get global search results because you are not connected to another YaCy peer. + To connect you must first use the proxy. + See here for an installation guide. + Alternatively, you can run the proxy in permanent online mode, which also grants global search. + To do this, press this button: +

- +
-

:: - You can enrich the search results by using the 'global' option; you must also switch to online mode - (by using the proxy) to contribute to the global index. - #(/resultbottomline)# +

+ You can enrich the search results by using the 'global' option; you must also switch to online mode + (by using the proxy) to contribute to the global index.

+ #(/resultbottomline)# :: #{results}# diff --git a/source/de/anomic/http/httpTemplate.java b/source/de/anomic/http/httpTemplate.java index 702ff0374..566a8cfaf 100644 --- a/source/de/anomic/http/httpTemplate.java +++ b/source/de/anomic/http/httpTemplate.java @@ -466,9 +466,9 @@ public final class httpTemplate { } }catch(IOException e){ //file not found? - serverLog.logSevere("FILEHANDLER","Include Error with file: "+filename); + serverLog.logSevere("FILEHANDLER","Include Error with file: " + new String(filename, "UTF-8")); } finally { - if (br!=null) try{br.close(); br=null;}catch(Exception e){} + if (br != null) try { br.close(); br=null; } catch (Exception e) {} } PushbackInputStream pis2 = new PushbackInputStream(new ByteArrayInputStream(include.getBytes())); structure.append("\n".getBytes("UTF-8")); diff --git a/source/de/anomic/plasma/plasmaSwitchboard.java b/source/de/anomic/plasma/plasmaSwitchboard.java index 6df1f852b..7c4f26b1c 100644 --- a/source/de/anomic/plasma/plasmaSwitchboard.java +++ b/source/de/anomic/plasma/plasmaSwitchboard.java @@ -2179,8 +2179,9 @@ public final class plasmaSwitchboard extends serverAbstractSwitch implements ser // suppress line: there is no match in that resource } else {*/ prop.put("type_results_" + i + "_authorized_recommend", (yacyCore.newsPool.getSpecific(yacyNewsPool.OUTGOING_DB, "stippadd", "url", urlstring) == null) ? 1 : 0); - prop.put("type_results_" + i + "_authorized_recommend_deletelink", "/yacysearch.html?search=" + formerSearch + "&Enter=Search&count=" + query.wantedResults + "&order=" + crypt.simpleEncode(ranking.toExternalString()) + "&resource=local&time=3&deleteref=" + urlhash + "&urlmaskfilter=.*"); - prop.put("type_results_" + i + "_authorized_recommend_recommendlink", "/yacysearch.html?search=" + formerSearch + "&Enter=Search&count=" + query.wantedResults + "&order=" + crypt.simpleEncode(ranking.toExternalString()) + "&resource=local&time=3&recommendref=" + urlhash + "&urlmaskfilter=.*"); + prop.put("type_results_" + i + "_authorized_recommend_deletelink", "/yacysearch.html?search=" + formerSearch + "&Enter=Search&count=" + query.wantedResults + "&order=" + crypt.simpleEncode(ranking.toExternalString()) + "&resource=local&time=3&deleteref=" + urlhash + "&urlmaskfilter=.*"); + prop.put("type_results_" + i + "_authorized_recommend_recommendlink", "/yacysearch.html?search=" + formerSearch + "&Enter=Search&count=" + query.wantedResults + "&order=" + crypt.simpleEncode(ranking.toExternalString()) + "&resource=local&time=3&recommendref=" + urlhash + "&urlmaskfilter=.*"); + prop.put("type_results_" + i + "_authorized_urlhash", urlhash); prop.put("type_results_" + i + "_description", comp.descr()); prop.put("type_results_" + i + "_url", urlstring); prop.put("type_results_" + i + "_urlhash", urlhash);