- 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
pull/1/head
karlchenofhell 18 years ago
parent b5dddde08b
commit b873ad51ab

@ -18,9 +18,9 @@
<receivedURLs>#[rU]#</receivedURLs> <receivedURLs>#[rU]#</receivedURLs>
<type>#(type)#junior::senior::principal#(/type)#</type> <type>#(type)#junior::senior::principal#(/type)#</type>
<direct>#(type_direct)#direct::passive#(/type_direct)#</direct> <direct>#(type_direct)#direct::passive#(/type_direct)#</direct>
<acceptcrawl>#(acceptcrawl)#0::1#(/acceptcrawl)#</acceptcrawl> <acceptcrawl>#[acceptcrawl]#</acceptcrawl>
<dhtreceive>#(dhtreceive)#0::1#(/dhtreceive)#</dhtreceive> <dhtreceive>#[dhtreceive]#</dhtreceive>
<rankingreceive>#(rankingreceive)#0::1#(/rankingreceive)#</rankingreceive> <rankingreceive>#[rankingreceive]#</rankingreceive>
<location>#[location]#</location> <location>#[location]#</location>
#(complete)# #(complete)#
:: ::
@ -62,8 +62,8 @@
<uptime>#[my-uptime]#</uptime> <uptime>#[my-uptime]#</uptime>
<links>#[my-links]#</links> <links>#[my-links]#</links>
<words>#[my-words]#</words> <words>#[my-words]#</words>
<acceptcrawl>#(my-acceptcrawl)#0::1#(/my-acceptcrawl)#</acceptcrawl> <acceptcrawl>#[my-acceptcrawl]#</acceptcrawl>
<acceptindex>#(my-dhtreceive)#0::1#(/my-dhtreceive)#</acceptindex> <acceptindex>#[my-dhtreceive]#</acceptindex>
<sentwords>#[my-sI]#</sentwords> <sentwords>#[my-sI]#</sentwords>
<senturls>#[my-sU]#</senturls> <senturls>#[my-sU]#</senturls>
<receivedwords>#[my-rI]#</receivedwords> <receivedwords>#[my-rI]#</receivedwords>

@ -51,7 +51,7 @@
<td align="right">#[memusepercycle]#</td> <td align="right">#[memusepercycle]#</td>
<td align="right"><input name="#[threadname]#_idlesleep" size="7" maxlength="7" value="#[idlesleep]#" /> milliseconds</td> <td align="right"><input name="#[threadname]#_idlesleep" size="7" maxlength="7" value="#[idlesleep]#" /> milliseconds</td>
<td align="right"><input name="#[threadname]#_busysleep" size="7" maxlength="7" value="#[busysleep]#" /> milliseconds</td> <td align="right"><input name="#[threadname]#_busysleep" size="7" maxlength="7" value="#[busysleep]#" /> milliseconds</td>
<td align="right"><input name="#[threadname]#_memprereq" size="5" maxlength="5" value="#[memprereq]#"#(disabled)#:: disabled="disabled"#(/disabled)# /> kbytes</td> <td align="right"><input name="#[threadname]#_memprereq" size="7" maxlength="10" value="#[memprereq]#"#(disabled)#:: disabled="disabled"#(/disabled)# /> kbytes</td>
<td align="left">#[longdescr]#</td> <td align="left">#[longdescr]#</td>
</tr> </tr>
#{/table}# #{/table}#

@ -141,6 +141,7 @@ public class Surftips {
prop.put("surftips_results_" + i + "_authorized_recommend", (voted) ? 0 : 1); prop.put("surftips_results_" + i + "_authorized_recommend", (voted) ? 0 : 1);
prop.put("surftips_results_" + i + "_authorized_recommend_negativeVoteLink", "/Surftips.html?voteNegative=" + urlhash + "&amp;refid=" + refid + "&amp,display=" + display + ((showScore) ? "&amp;score=" : "")); // for negaive votes, we don't send around the bad url again, the hash is enough prop.put("surftips_results_" + i + "_authorized_recommend_negativeVoteLink", "/Surftips.html?voteNegative=" + urlhash + "&amp;refid=" + refid + "&amp,display=" + display + ((showScore) ? "&amp;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 + "&amp;refid=" + refid + "&amp;url=" + crypt.simpleEncode(url,null,'b') + "&amp;title=" + crypt.simpleEncode(title,null,'b') + "&amp;description=" + crypt.simpleEncode(description,null,'b') + "&amp;display=" + display + ((showScore) ? "&amp;score=" : "")); prop.put("surftips_results_" + i + "_authorized_recommend_positiveVoteLink", "/Surftips.html?votePositive=" + urlhash + "&amp;refid=" + refid + "&amp;url=" + crypt.simpleEncode(url,null,'b') + "&amp;title=" + crypt.simpleEncode(title,null,'b') + "&amp;description=" + crypt.simpleEncode(description,null,'b') + "&amp;display=" + display + ((showScore) ? "&amp;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 + "_url", de.anomic.data.wikiCode.replaceHTMLonly(url));
prop.put("surftips_results_" + i + "_urlname", nxTools.shortenURLString(url, 60)); prop.put("surftips_results_" + i + "_urlname", nxTools.shortenURLString(url, 60));
prop.put("surftips_results_" + i + "_urlhash", urlhash); prop.put("surftips_results_" + i + "_urlhash", urlhash);

@ -164,6 +164,19 @@ form.search table {
text-align:left; 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 */ h2.yacy { /* The heading in index.html */
margin:10px auto; margin:10px auto;
text-align:center; text-align:center;

@ -22,11 +22,11 @@
<input name="search" id="search" type="text" size="52" maxlength="80" value="#[former]#" /> <input name="search" id="search" type="text" size="52" maxlength="80" value="#[former]#" />
<input type="submit" name="Enter" value="Search" /> <input type="submit" name="Enter" value="Search" />
<input type="hidden" name="former" value="#[former]#" /><br /> <input type="hidden" name="former" value="#[former]#" /><br />
<input type="radio" name="contentdom" value="text" #(contentdomCheckText)#::checked="checked"#(/contentdomCheckText)# />Text&nbsp;&nbsp; <input type="radio" id="text" name="contentdom" value="text" #(contentdomCheckText)#::checked="checked"#(/contentdomCheckText)# /><label for="text">Text</label>&nbsp;&nbsp;
<input type="radio" name="contentdom" value="image" #(contentdomCheckImage)#::checked="checked"#(/contentdomCheckImage)# />Images&nbsp;&nbsp; <input type="radio" id="image" name="contentdom" value="image" #(contentdomCheckImage)#::checked="checked"#(/contentdomCheckImage)# /><label for="image">Images</label>&nbsp;&nbsp;
<input type="radio" name="contentdom" value="audio" #(contentdomCheckAudio)#::checked="checked"#(/contentdomCheckAudio)# />Audio&nbsp;&nbsp; <input type="radio" id="audio" name="contentdom" value="audio" #(contentdomCheckAudio)#::checked="checked"#(/contentdomCheckAudio)# /><label for="audio">Audio</label>&nbsp;&nbsp;
<input type="radio" name="contentdom" value="video" #(contentdomCheckVideo)#::checked="checked"#(/contentdomCheckVideo)# />Video&nbsp;&nbsp; <input type="radio" id="video" name="contentdom" value="video" #(contentdomCheckVideo)#::checked="checked"#(/contentdomCheckVideo)# /><label for="video">Video</label>&nbsp;&nbsp;
<input type="radio" name="contentdom" value="app" #(contentdomCheckApp)#::checked="checked"#(/contentdomCheckApp)# />Applications&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <input type="radio" id="app" name="contentdom" value="app" #(contentdomCheckApp)#::checked="checked"#(/contentdomCheckApp)# /><label for="app">Applications</label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
#(searchoptions)# #(searchoptions)#
<input type="hidden" name="count" value="10" /> <input type="hidden" name="count" value="10" />
<input type="hidden" name="resource" value="global" /> <input type="hidden" name="resource" value="global" />
@ -101,11 +101,12 @@
Constraints: Constraints:
</td> </td>
<td> <td>
<input type="checkbox" name="indexof" #[indexofChecked]# /> only index pages <input type="checkbox" id="indexof" name="indexof" #[indexofChecked]# /> <label for="indexof">only index pages</label>
</td> </td>
</tr> </tr>
</table> </table>
#(/searchoptions)# #(/searchoptions)#
<p>This peer holds #[links]# URLs of #[total-links]# in the known network.</p>
</form> </form>
#(display)# #(display)#

@ -40,6 +40,8 @@ import de.anomic.server.serverCore;
import de.anomic.server.serverDate; import de.anomic.server.serverDate;
import de.anomic.server.serverObjects; import de.anomic.server.serverObjects;
import de.anomic.server.serverSwitch; import de.anomic.server.serverSwitch;
import de.anomic.yacy.yacyCore;
import de.anomic.yacy.yacySeed;
public class index { public class index {
@ -91,6 +93,11 @@ public class index {
if (cds.equals("image")) contentdom = plasmaSearchQuery.CONTENTDOM_IMAGE; if (cds.equals("image")) contentdom = plasmaSearchQuery.CONTENTDOM_IMAGE;
if (cds.equals("app")) contentdom = plasmaSearchQuery.CONTENTDOM_APP; 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 // we create empty entries for template strings
String promoteSearchPageGreeting = env.getConfig("promoteSearchPageGreeting", ""); String promoteSearchPageGreeting = env.getConfig("promoteSearchPageGreeting", "");
if (promoteSearchPageGreeting.length() == 0) promoteSearchPageGreeting = "P2P WEB SEARCH"; if (promoteSearchPageGreeting.length() == 0) promoteSearchPageGreeting = "P2P WEB SEARCH";
@ -133,5 +140,11 @@ public class index {
return prop; 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);
}
} }

@ -4,7 +4,7 @@ function AllTextSnippets() {
var span = document.getElementsByTagName("span"); var span = document.getElementsByTagName("span");
for(var x=0;x<span.length;x++) { for(var x=0;x<span.length;x++) {
if (span[x].className == 'snippetLoading') { if (span[x].className == 'snippetLoading') {
var url = document.getElementById("url" + span[x].id); var url = document.getElementById("url" + span[x].id.substring(1));
requestTextSnippet(url,query); requestTextSnippet(url,query);
} }
} }
@ -66,7 +66,7 @@ function handleTextState(req) {
var urlHash = response.getElementsByTagName("urlHash")[0].firstChild.data; var urlHash = response.getElementsByTagName("urlHash")[0].firstChild.data;
var status = response.getElementsByTagName("status")[0].firstChild.data; var status = response.getElementsByTagName("status")[0].firstChild.data;
var span = document.getElementById(urlHash) var span = document.getElementById("h" + urlHash)
removeAllChildren(span); removeAllChildren(span);
//span.removeChild(span.firstChild); //span.removeChild(span.firstChild);

@ -21,19 +21,12 @@
<form class="search small" action="yacysearch.html" method="get"> <form class="search small" action="yacysearch.html" method="get">
<p class="yacylogo"><a href="http://yacy.net/yacy/" class="yacylogo"><img src="/env/grafics/yacy.png" alt="yacy" /></a></p> <p class="yacylogo"><a href="http://yacy.net/yacy/" class="yacylogo"><img src="/env/grafics/yacy.png" alt="yacy" /></a></p>
<h2>#[promoteSearchPageGreeting]#</h2> <h2>#[promoteSearchPageGreeting]#</h2>
<fieldset class="maininput"> <div>
<table width="100%" border="0" cellspacing="0" cellpadding="0"> <fieldset class="yacys">
<tr>
<td>
<input id="search" name="search" type="text" size="50" maxlength="80" value="#[former]#" onclick="document.getElementById('Enter').value = 'Search'" /> <input id="search" name="search" type="text" size="50" maxlength="80" value="#[former]#" onclick="document.getElementById('Enter').value = 'Search'" />
<input id="Enter" type="submit" name="Enter" value="Search" /> <input id="Enter" type="submit" name="Enter" value="Search" /> &nbsp;
</td>
<td>
<a href="index.html?display=#[display]#&amp;searchoptions=1&amp;count=#[count]#&amp;order=#[order]#&amp;resource=#[resource]#&amp;time=#[time]#&amp;urlmaskfilter=#[urlmaskfilter]#&amp;prefermaskfilter=#[prefermaskfilter]#&amp;cat=#[cat]#&amp;type=#[type]#&amp;constraint=#[constraint]#&amp;contentdom=#[contentdom]#&amp;former=#[former]#">more options</a> <a href="index.html?display=#[display]#&amp;searchoptions=1&amp;count=#[count]#&amp;order=#[order]#&amp;resource=#[resource]#&amp;time=#[time]#&amp;urlmaskfilter=#[urlmaskfilter]#&amp;prefermaskfilter=#[prefermaskfilter]#&amp;cat=#[cat]#&amp;type=#[type]#&amp;constraint=#[constraint]#&amp;contentdom=#[contentdom]#&amp;former=#[former]#">more options</a>
</td> <div class="yacysearch">
</tr>
<tr>
<td colspan="2">
<input type="radio" id="text" name="contentdom" value="text"#(contentdomCheckText)#:: checked="checked"#(/contentdomCheckText)# /> <input type="radio" id="text" name="contentdom" value="text"#(contentdomCheckText)#:: checked="checked"#(/contentdomCheckText)# />
<label for="text">Text</label>&nbsp;&nbsp; <label for="text">Text</label>&nbsp;&nbsp;
<input type="radio" id="images" name="contentdom" value="image"#(contentdomCheckImage)#:: checked="checked"#(/contentdomCheckImage)# /> <input type="radio" id="images" name="contentdom" value="image"#(contentdomCheckImage)#:: checked="checked"#(/contentdomCheckImage)# />
@ -44,9 +37,7 @@
<label for="video">Video</label>&nbsp;&nbsp; <label for="video">Video</label>&nbsp;&nbsp;
<input type="radio" id="appl" name="contentdom" value="app"#(contentdomCheckApp)#:: checked="checked"#(/contentdomCheckApp)# /> <input type="radio" id="appl" name="contentdom" value="app"#(contentdomCheckApp)#:: checked="checked"#(/contentdomCheckApp)# />
<label for="appl">Applications</label> <label for="appl">Applications</label>
</td> </div>
</tr>
</table>
<input type="hidden" name="former" value="#[former]#" /> <input type="hidden" name="former" value="#[former]#" />
<input type="hidden" name="count" value="#[count]#" /> <input type="hidden" name="count" value="#[count]#" />
<input type="hidden" name="order" value="#[order]#" /> <input type="hidden" name="order" value="#[order]#" />
@ -60,6 +51,7 @@
<input type="hidden" name="display" value="#[display]#" /> <input type="hidden" name="display" value="#[display]#" />
<input type="hidden" name="constraint" value="#[constraint]#" /> <input type="hidden" name="constraint" value="#[constraint]#" />
</fieldset> </fieldset>
</div>
</form> </form>
<script type="text/javascript"> <script type="text/javascript">
@ -129,7 +121,7 @@ document.getElementById("Enter").value = "search again - catch up more links";
</div> </div>
#(/authorized)# #(/authorized)#
<h4 class="linktitle"><a href="#[url]#">#[description]#</a></h4> <h4 class="linktitle"><a href="#[url]#">#[description]#</a></h4>
<p class="snippet"><span class="#(snippet)#snippetLoading::snippetLoaded#(/snippet)#" id="#[urlhash]#">#(snippet)#loading snippet ...::#[text]##(/snippet)#</span></p> <p class="snippet"><span class="#(snippet)#snippetLoading::snippetLoaded#(/snippet)#" id="h#[urlhash]#">#(snippet)#loading snippet ...::#[text]##(/snippet)#</span></p>
<p class="url"><a href="#[url]#" id="url#[urlhash]#">#[urlname]#</a></p> <p class="url"><a href="#[url]#" id="url#[urlhash]#">#[urlname]#</a></p>
<p class="urlinfo">#[date]# | YBR-#[ybr]# | <a href="ViewFile.html?urlHash=#[urlhash]#&amp;words=#[words]#">Info</a> | <a href="yacysearch.html?cat=image&amp;url=#[url]#&amp;search=#[former]#">Pictures</a></p> <p class="urlinfo">#[date]# | YBR-#[ybr]# | <a href="ViewFile.html?urlHash=#[urlhash]#&amp;words=#[words]#">Info</a> | <a href="yacysearch.html?cat=image&amp;url=#[url]#&amp;search=#[former]#">Pictures</a></p>
</div> </div>
@ -142,27 +134,28 @@ document.getElementById("Enter").value = "search again - catch up more links";
</script> </script>
<!-- linklist end --> <!-- linklist end -->
<p>
#(resultbottomline)# #(resultbottomline)#
:: ::
The global search resulted in #[globalresults]# link contributions from other YaCy peers. <p>The global search resulted in #[globalresults]# link contributions from other YaCy peers.</p>
:: ::
You can enrich the search results by using the 'global' option: This will search also other YaCy peers <p>You can enrich the search results by using the 'global' option: This will search also other YaCy peers</p>
:: ::
You cannot get global search results because you are not connected to another YaCy peer. <p>
To connect you must first use the proxy. You cannot get global search results because you are not connected to another YaCy peer.
See here for an <a href="http://www.anomic.de/AnomicHTTPProxy/Installation.html#wininst">installation guide</a>. To connect you must first use the proxy.
Alternatively, you can run the proxy in permanent online mode, which also grants global search. See here for an <a href="http://www.anomic.de/AnomicHTTPProxy/Installation.html#wininst">installation guide</a>.
To do this, press this button:</p> Alternatively, you can run the proxy in permanent online mode, which also grants global search.
To do this, press this button:
</p>
<form action="SettingsAck_p.html" method="get"> <form action="SettingsAck_p.html" method="get">
<input type="submit" name="pmode" value="go online"> <input type="submit" name="pmode" value="go online">
</form> </form>
<p>
:: ::
You can enrich the search results by using the 'global' option; you must also switch to online mode <p>
(by using the proxy) to contribute to the global index. You can enrich the search results by using the 'global' option; you must also switch to online mode
#(/resultbottomline)# (by using the proxy) to contribute to the global index.
</p> </p>
#(/resultbottomline)#
::<!-- type 1: media search --> ::<!-- type 1: media search -->
<!-- linklist begin --> <!-- linklist begin -->
#{results}# #{results}#

@ -466,9 +466,9 @@ public final class httpTemplate {
} }
}catch(IOException e){ }catch(IOException e){
//file not found? //file not found?
serverLog.logSevere("FILEHANDLER","Include Error with file: "+filename); serverLog.logSevere("FILEHANDLER","Include Error with file: " + new String(filename, "UTF-8"));
} finally { } 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())); PushbackInputStream pis2 = new PushbackInputStream(new ByteArrayInputStream(include.getBytes()));
structure.append("<fileinclude file=\"".getBytes("UTF-8")).append(filename).append(">\n".getBytes("UTF-8")); structure.append("<fileinclude file=\"".getBytes("UTF-8")).append(filename).append(">\n".getBytes("UTF-8"));

@ -2179,8 +2179,9 @@ public final class plasmaSwitchboard extends serverAbstractSwitch implements ser
// suppress line: there is no match in that resource // suppress line: there is no match in that resource
} else {*/ } 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", (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_deletelink", "/yacysearch.html?search=" + formerSearch + "&amp;Enter=Search&amp;count=" + query.wantedResults + "&amp;order=" + crypt.simpleEncode(ranking.toExternalString()) + "&amp;resource=local&amp;time=3&amp;deleteref=" + urlhash + "&amp;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_recommendlink", "/yacysearch.html?search=" + formerSearch + "&amp;Enter=Search&amp;count=" + query.wantedResults + "&amp;order=" + crypt.simpleEncode(ranking.toExternalString()) + "&amp;resource=local&amp;time=3&amp;recommendref=" + urlhash + "&amp;urlmaskfilter=.*");
prop.put("type_results_" + i + "_authorized_urlhash", urlhash);
prop.put("type_results_" + i + "_description", comp.descr()); prop.put("type_results_" + i + "_description", comp.descr());
prop.put("type_results_" + i + "_url", urlstring); prop.put("type_results_" + i + "_url", urlstring);
prop.put("type_results_" + i + "_urlhash", urlhash); prop.put("type_results_" + i + "_urlhash", urlhash);

Loading…
Cancel
Save