Author: orbiter
Date: 2008-02-25 19:19:22 +0100 (Mon, 25 Feb 2008)
New Revision: 4508

Modified:
   trunk/htroot/yacy/user/ysearch.html
   trunk/htroot/yacy/user/ysearch.java
   trunk/htroot/yacy/user/ysearchitem.html
   trunk/htroot/yacy/user/ysearchitem.java
Log:
introduced search navigation column on new search page

An alle JavaScript-Profis: die Anwahl einer neuen Suchseite ?\195?\188ber die 
Selectbox (hinter Category)
funktioniert bei mir nur mit Firefox, nicht aber mit Safari oder Camino. Kann 
da mal jemand
gucken woran das liegt?

Modified: trunk/htroot/yacy/user/ysearch.html
===================================================================
--- trunk/htroot/yacy/user/ysearch.html 2008-02-25 14:08:15 UTC (rev 4507)
+++ trunk/htroot/yacy/user/ysearch.html 2008-02-25 18:19:22 UTC (rev 4508)
@@ -43,13 +43,12 @@
 <div id="content">
   <div id="main">
     <div id="welcome">
-      <h2>Welcome to YaCy P2P Web Search!</h2>
 
       #(input)#
                ::
            <form class="search small" action="ysearch.html" method="get" 
accept-charset="UTF-8">
              <fieldset class="yacys">
-               <input id="searchtext" name="search" type="text" size="50" 
maxlength="80" value="#[former]#" 
onclick="document.getElementById('Enter').value = 'Search'" />
+               Search: <input id="searchtext" name="search" type="text" 
size="50" maxlength="80" value="#[former]#" 
onclick="document.getElementById('Enter').value = 'Search'" />
                <input id="searchbutton" id="Enter" type="submit" name="Enter" 
value="Search" />
                <input type="hidden" name="contentdom" value="#[contentdom]#" />
                <input type="hidden" name="former" value="#[former]#" />
@@ -69,9 +68,8 @@
            ::
            <form class="search small" action="ysearch.html" method="get" 
accept-charset="UTF-8">
              <fieldset class="yacys">
-                     <input id="searchtext" name="search" type="text" 
size="50" maxlength="80" value="#[former]#" 
onclick="document.getElementById('Enter').value = 'Search'" />
-                     <input  id="searchbutton" type="submit" name="Enter" 
value="Search" /> &nbsp;
-                     <a 
href="index.html?display=#[display]#&amp;input=#[input]#&amp;searchoptions=1&amp;count=#[count]#&amp;resource=#[resource]#&amp;time=#[time]#&amp;urlmaskfilter=#[urlmaskfilter]#&amp;prefermaskfilter=#[prefermaskfilter]#&amp;cat=#[cat]#&amp;constraint=#[constraint]#&amp;contentdom=#[contentdom]#&amp;former=#[former]#">more
 options</a>
+                     Search: <input id="searchtext" name="search" type="text" 
size="50" maxlength="80" value="#[former]#" 
onclick="document.getElementById('Enter').value = 'Search'" />
+                     <input  id="searchbutton" type="submit" name="Enter" 
value="Search" />
                  <div class="ysearch">
                      <input type="radio" id="text" name="contentdom" 
value="text"#(contentdomCheckText)#:: checked="checked"#(/contentdomCheckText)# 
/>
                      <label for="text">Text</label>&nbsp;&nbsp;
@@ -88,7 +86,6 @@
                <input type="hidden" name="count" value="#[count]#" />
                <input type="hidden" name="offset" value="#[offset]#" />
                <input type="hidden" name="resource" value="#[resource]#" />
-               <input type="hidden" name="time" value="#[time]#" />
                <input type="hidden" name="urlmaskfilter" 
value="#[urlmaskfilter]#" />
                <input type="hidden" name="prefermaskfilter" 
value="#[prefermaskfilter]#" />
                <input type="hidden" name="depth" value="#[depth]#" />
@@ -123,7 +120,7 @@
        ::
        <div id="results"></div>
        <span id="resCounter" style="display: inline;">Results <strong 
id="resultsOffset">#[offset]#</strong>-<strong 
id="itemscount">#[itemscount]#</strong> from <strong 
id="totalcount">#[totalcount]#</strong> total#(globalresults)#.:: (<strong 
id="localResourceSize">#[localResourceSize]#</strong> local, <strong 
id="remoteResourceSize">#[remoteResourceSize]#</strong> remote), <strong 
id="remoteIndexCount">#[remoteIndexCount]#</strong> links from <strong 
id="remotePeerCount">#[remotePeerCount]#</strong> other YaCy 
peers.#(/globalresults)#</span>
-       <span id="resNav" style="display: inline;">#[resnav]#</span>
+       <span id="resNav" style="display: inline;"></span>
        ::
        <p>Searching the web with this peer is disabled for unauthorized users. 
Please <a href="Status.html?login=">log in</a> as administrator to use the 
search function</p>
 #(/num-results)#
@@ -143,16 +140,9 @@
   </div>
   
   <div id="sidebar">
-    <div id="navigate" class="boxed">
-      <h2 class="title">Navigate</h2>
-      <div class="content">
-        <form id="form1" method="post" action="#">
-          <fieldset>
-          <input id="inputsubmit1" type="submit" name="inputsubmit1" 
value="Sign In" />
-          </fieldset>
-        </form>
-      </div>
-    </div>
+<!-- attach the bottomline -->
+<!--#include 
virtual="/yacy/user/ysearchitem.html?bottomline=true&eventID=#[eventID]#" -->
+    
     <!--
     <div id="updates" class="boxed">
       <h2 class="title">News</h2>

Modified: trunk/htroot/yacy/user/ysearch.java
===================================================================
--- trunk/htroot/yacy/user/ysearch.java 2008-02-25 14:08:15 UTC (rev 4507)
+++ trunk/htroot/yacy/user/ysearch.java 2008-02-25 18:19:22 UTC (rev 4508)
@@ -1,14 +1,15 @@
-// ysearch.java
-// -----------------------
-// part of the AnomicHTTPD caching proxy
-// (C) by Michael Peter Christen; [EMAIL PROTECTED]
-// first published on http://www.anomic.de
-// Frankfurt, Germany, 2004
+// ysearchitem.java
+// (C) 2004-2008 by Michael Peter Christen; [EMAIL PROTECTED], Frankfurt a. 
M., Germany
+// first published 2004 on http://yacy.net
 //
-// $LastChangedDate: 2008-02-07 22:16:36 +0000 (Do, 07 Feb 2008) $
-// $LastChangedRevision: 4459 $
+// This is a part of YaCy, a peer-to-peer based web search engine
+//
+// $LastChangedDate: 2006-04-02 22:40:07 +0200 (So, 02 Apr 2006) $
+// $LastChangedRevision: 1986 $
 // $LastChangedBy: orbiter $
 //
+// LICENSE
+// 
 // This program is free software; you can redistribute it and/or modify
 // it under the terms of the GNU General Public License as published by
 // the Free Software Foundation; either version 2 of the License, or
@@ -22,43 +23,16 @@
 // You should have received a copy of the GNU General Public License
 // along with this program; if not, write to the Free Software
 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-//
-// Using this software in any meaning (reading, learning, copying, compiling,
-// running) means that you agree that the Author(s) is (are) not responsible
-// for cost, loss of data or any harm that may be caused directly or indirectly
-// by usage of this softare or this documentation. The usage of this software
-// is on your own risk. The installation and usage (starting/running) of this
-// software may allow other people or application to access your computer and
-// any attached devices and is highly dependent on the configuration of the
-// software which must be done by the user of the software; the author(s) is
-// (are) also not responsible for proper configuration and usage of the
-// software, even if provoked by documentation provided together with
-// the software.
-//
-// Any changes to this file according to the GPL as documented in the file
-// gpl.txt aside this file in the shipment you received can be done to the
-// lines that follows this copyright notice here, but changes must not be
-// done inside the copyright notive above. A re-distribution must contain
-// the intact and unchanged copyright notice.
-// Contributions and changes to the program code must be marked as such.
-//
-// You must compile this file with
-// javac -classpath .:../classes yacysearch.java
-// if the shell's current path is HTROOT
 
-import java.util.HashMap;
 import java.util.TreeSet;
 
 import de.anomic.http.httpHeader;
-import de.anomic.index.indexURLEntry;
 import de.anomic.kelondro.kelondroBitfield;
 import de.anomic.kelondro.kelondroMSetTools;
 import de.anomic.plasma.plasmaCondenser;
-import de.anomic.plasma.plasmaParserDocument;
 import de.anomic.plasma.plasmaSearchEvent;
 import de.anomic.plasma.plasmaSearchQuery;
 import de.anomic.plasma.plasmaSearchRankingProfile;
-import de.anomic.plasma.plasmaSnippetCache;
 import de.anomic.plasma.plasmaSwitchboard;
 import de.anomic.server.serverCore;
 import de.anomic.server.serverObjects;
@@ -66,8 +40,6 @@
 import de.anomic.server.logging.serverLog;
 import de.anomic.tools.yFormatter;
 import de.anomic.yacy.yacyCore;
-import de.anomic.yacy.yacyNewsPool;
-import de.anomic.yacy.yacyNewsRecord;
 import de.anomic.yacy.yacyURL;
 
 public class ysearch {
@@ -77,7 +49,6 @@
         sb.localSearchLastAccess = System.currentTimeMillis();
         
         boolean searchAllowed = sb.getConfigBool("publicSearchpage", true) || 
sb.verifyAuthentication(header, false);
-        
         boolean authenticated = sb.adminAuthenticated(header) >= 2;
         int display = (post == null) ? 0 : post.getInt("display", 0);
         if ((display == 1) && (!authenticated)) display = 0;
@@ -88,11 +59,11 @@
 
         // get query
         String querystring = (post == null) ? "" : post.get("search", 
"").trim();
+        final serverObjects prop = new serverObjects();
         
         boolean rss = (post == null) ? false : post.get("rss", 
"false").equals("true");
         if ((post == null) || (env == null) || (querystring.length() == 0) || 
(!searchAllowed)) {
             // we create empty entries for template strings
-            final serverObjects prop = new serverObjects();
             prop.put("searchagain", "0");
             prop.put("input", input);
             prop.put("display", display);
@@ -168,7 +139,6 @@
         // patch until better search profiles are available
         if ((contentdomCode != plasmaSearchQuery.CONTENTDOM_TEXT) && 
(itemsPerPage <= 32)) itemsPerPage = 32;
         
-        serverObjects prop = new serverObjects();
         if (post.get("cat", "href").equals("href")) {
 
             final TreeSet<String>[] query = 
plasmaSearchQuery.cleanQuery(querystring); // converts also umlaute
@@ -187,51 +157,6 @@
                 kelondroMSetTools.excludeDestructive(query[0], 
plasmaSwitchboard.stopwords);
             }
 
-            // if a minus-button was hit, remove a special reference first
-            if (post.containsKey("deleteref")) {
-                if (!sb.verifyAuthentication(header, true)) {
-                    prop.put("AUTHENTICATE", "admin log-in"); // force log-in
-                    return prop;
-                }
-                
-                // delete the index entry locally
-                final String delHash = post.get("deleteref", ""); // urlhash
-                sb.wordIndex.removeWordReferences(query[0], delHash);
-
-                // make new news message with negative voting
-                HashMap<String, String> map = new HashMap<String, String>();
-                map.put("urlhash", delHash);
-                map.put("vote", "negative");
-                map.put("refid", "");
-                
yacyCore.newsPool.publishMyNews(yacyNewsRecord.newRecord(yacyNewsPool.CATEGORY_SURFTIPP_VOTE_ADD,
 map));
-            }
-
-            // if a plus-button was hit, create new voting message
-            if (post.containsKey("recommendref")) {
-                if (!sb.verifyAuthentication(header, true)) {
-                    prop.put("AUTHENTICATE", "admin log-in"); // force log-in
-                    return prop;
-                }
-                final String recommendHash = post.get("recommendref", ""); // 
urlhash
-                indexURLEntry urlentry = 
sb.wordIndex.loadedURL.load(recommendHash, null, 0);
-                if (urlentry != null) {
-                    indexURLEntry.Components comp = urlentry.comp();
-                    plasmaParserDocument document;
-                    document = plasmaSnippetCache.retrieveDocument(comp.url(), 
true, 5000, true);
-                    if (document != null) {
-                        // create a news message
-                        HashMap<String, String> map = new HashMap<String, 
String>();
-                        map.put("url", comp.url().toNormalform(false, 
true).replace(',', '|'));
-                        map.put("title", comp.dc_title().replace(',', ' '));
-                        map.put("description", ((document == null) ? 
comp.dc_title() : document.dc_title()).replace(',', ' '));
-                        map.put("author", ((document == null) ? "" : 
document.dc_creator()));
-                        map.put("tags", ((document == null) ? "" : 
document.dc_subject(' ')));
-                        
yacyCore.newsPool.publishMyNews(yacyNewsRecord.newRecord(yacyNewsPool.CATEGORY_SURFTIPP_ADD,
 map));
-                        document.close();
-                    }
-                }
-            }
-
             // prepare search properties
             final boolean yacyonline = ((yacyCore.seedDB != null) && 
(yacyCore.seedDB.mySeed() != null) && 
(yacyCore.seedDB.mySeed().getPublicAddress() != null));
             final boolean globalsearch = (global) && (yacyonline) && 
(sb.getConfigBool(plasmaSwitchboard.INDEX_RECEIVE_ALLOW, false));
@@ -261,7 +186,7 @@
 
             
             // tell all threads to do nothing for a specific time
-            sb.intermissionAllThreads(10000);
+            sb.intermissionAllThreads(3000);
         
             // filter out words that appear in bluelist
             theQuery.filterOut(plasmaSwitchboard.blueList);
@@ -300,7 +225,6 @@
             handles.add(theQuery.handle);
             sb.localSearchTracker.put(client, handles);
             
-            prop = new serverObjects();
             int totalcount = 
theSearch.getRankingResult().getLocalResourceSize() + 
theSearch.getRankingResult().getRemoteResourceSize();
             prop.put("num-results_offset", offset);
             prop.put("num-results_itemscount", "0");
@@ -311,31 +235,6 @@
             prop.put("num-results_globalresults_remoteResourceSize", 
yFormatter.number(theSearch.getRankingResult().getRemoteResourceSize(), !rss));
             prop.put("num-results_globalresults_remoteIndexCount", 
yFormatter.number(theSearch.getRankingResult().getRemoteIndexCount(), !rss));
             prop.put("num-results_globalresults_remotePeerCount", 
yFormatter.number(theSearch.getRankingResult().getRemotePeerCount(), !rss));
-            
-            // compose page navigation
-            StringBuffer resnav = new StringBuffer();
-            int thispage = offset / theQuery.displayResults();
-            if (thispage == 0) resnav.append("&lt;&nbsp;"); else {
-                resnav.append(navurla(thispage - 1, display, theQuery));
-                resnav.append("<strong>&lt;</strong></a>&nbsp;");
-            }
-            int numberofpages = Math.min(10, Math.max(thispage + 2, totalcount 
/ theQuery.displayResults()));
-            for (int i = 0; i < numberofpages; i++) {
-                if (i == thispage) {
-                    resnav.append("<strong>");
-                    resnav.append(i + 1);
-                    resnav.append("</strong>&nbsp;");
-                } else {
-                    resnav.append(navurla(i, display, theQuery));
-                    resnav.append(i + 1);
-                    resnav.append("</a>&nbsp;");
-                }
-            }
-            if (thispage >= numberofpages) resnav.append("&gt;"); else {
-                resnav.append(navurla(thispage + 1, display, theQuery));
-                resnav.append("<strong>&gt;</strong></a>");
-            }
-            prop.put("num-results_resnav", resnav.toString());
         
             // generate the search result lines; they will be produced by 
another servlet
             for (int i = 0; i < theQuery.displayResults(); i++) {
@@ -405,18 +304,20 @@
         // return rewrite properties
         return prop;
     }
-
-    private static String navurla(int page, int display, plasmaSearchQuery 
theQuery) {
+/*
+    private static String navhidden(int page, int display, plasmaSearchQuery 
theQuery) {
         return
-        "<a href=\"ysearch.html?display=" + display +
-        "&amp;search=" + theQuery.queryString() +
-        "&amp;count="+ theQuery.displayResults() +
-        "&amp;offset=" + (page * theQuery.displayResults()) +
-        "&amp;resource=" + theQuery.searchdom() +
-        "&amp;urlmaskfilter=" + theQuery.urlMask +
-        "&amp;prefermaskfilter=" + theQuery.prefer +
-        "&amp;cat=href&amp;constraint=" + ((theQuery.constraint == null) ? "" 
: theQuery.constraint.exportB64()) +
-        "&amp;contentdom=" + theQuery.contentdom() +
-        "&amp;former=" + theQuery.queryString() + "\">";
+        "<input type=\"hidden\" name=\"display\" value=\"" + display + "\" />" 
+
+        "<input type=\"hidden\" name=\"search\" value=\"" + 
theQuery.queryString() + "\" />" +
+        "<input type=\"hidden\" name=\"count\" value=\"" + 
theQuery.displayResults() + "\" />" +
+        "<input type=\"hidden\" name=\"offset\" value=\"" + (page * 
theQuery.displayResults()) + "\" />" +
+        "<input type=\"hidden\" name=\"resource\" value=\"" + 
theQuery.searchdom() + "\" />" +
+        "<input type=\"hidden\" name=\"urlmaskfilter\" value=\"" + 
theQuery.urlMask + "\" />" +
+        "<input type=\"hidden\" name=\"prefermaskfilter\" value=\"" + 
theQuery.prefer + "\" />" +
+        "<input type=\"hidden\" name=\"cat\" value=\"href\" />" +
+        "<input type=\"hidden\" name=\"constraint\" value=\"" + 
((theQuery.constraint == null) ? "" : theQuery.constraint.exportB64()) + "\" 
/>" +
+        "<input type=\"hidden\" name=\"contentdom\" value=\"" + 
theQuery.contentdom() + "\" />" +
+        "<input type=\"hidden\" name=\"former\" value=\"" + 
theQuery.queryString() + "\" />";
     }
+    */
 }

Modified: trunk/htroot/yacy/user/ysearchitem.html
===================================================================
--- trunk/htroot/yacy/user/ysearchitem.html     2008-02-25 14:08:15 UTC (rev 
4507)
+++ trunk/htroot/yacy/user/ysearchitem.html     2008-02-25 18:19:22 UTC (rev 
4508)
@@ -38,11 +38,6 @@
 <guid isPermaLink="false">#[urlhash]#</guid>
 </item>
 #(/rss)#
-#(references)#::
-<p><strong>Topwords</strong>:
-#{words}#&nbsp;<a 
href="ysearch.html?search=#[newsearch]#&amp;Enter=Search&amp;count=#[count]#&amp;offset=#[offset]#&amp;resource=#[resource]#&amp;contentdom=#[contentdom]#&amp;time=#[time]#">#[word]#</a>&nbsp;|#{/words}#
-</p>
-#(/references)#
 #(rssreferences)#::
 <yacyTopwords:topwords>
 #{words}#
@@ -56,4 +51,25 @@
 progressbar.step(1);
 </script>
 #(/dynamic)#
+#(navigation)#::
+    <div id="navigate" class="boxed">
+      <h2 class="title">Navigate</h2>
+      <div class="content">
+        <p><Strong>Page</strong>:
+        #[resnav]#
+        </p>
+        #(topwords)#::
+        <p><strong>Category</strong>:
+        <select id="count" name="count">
+          <option selected="selected">-select-</option>
+        #{words}#
+          <option 
onclick="window.location.href='/yacy/user/ysearch.html?search=#[newsearch]#&amp;Enter=Search&amp;count=#[count]#&amp;offset=#[offset]#&amp;resource=#[resource]#&amp;contentdom=#[contentdom]#'">#[word]#</option>
+        #{/words}#
+        </select>
+        </p>
+        #(/topwords)#
+      </div>
+    </div>
+    
+#(/navigation)#
 

Modified: trunk/htroot/yacy/user/ysearchitem.java
===================================================================
--- trunk/htroot/yacy/user/ysearchitem.java     2008-02-25 14:08:15 UTC (rev 
4507)
+++ trunk/htroot/yacy/user/ysearchitem.java     2008-02-25 18:19:22 UTC (rev 
4508)
@@ -42,11 +42,8 @@
 import de.anomic.plasma.plasmaSwitchboard;
 import de.anomic.server.serverObjects;
 import de.anomic.server.serverSwitch;
-import de.anomic.tools.crypt;
 import de.anomic.tools.nxTools;
 import de.anomic.tools.yFormatter;
-import de.anomic.yacy.yacyCore;
-import de.anomic.yacy.yacyNewsPool;
 import de.anomic.yacy.yacySeed;
 import de.anomic.yacy.yacyURL;
 
@@ -64,14 +61,15 @@
         String eventID = post.get("eventID", "");
         boolean bottomline = post.get("bottomline", "false").equals("true");
         boolean rss = post.get("rss", "false").equals("true");
-        boolean authenticated = sb.adminAuthenticated(header) >= 2;
         int item = post.getInt("item", -1);
+        boolean auth = ((String) 
header.get(httpHeader.CONNECTION_PROP_CLIENTIP, "")).equals("localhost") || 
sb.verifyAuthentication(header, true);
         
         // default settings for blank item
         prop.put("content", "0");
         prop.put("rss", "0");
         prop.put("references", "0");
         prop.put("rssreferences", "0");
+        prop.put("navigation", "0");
         prop.put("dynamic", "0");
         
         // find search event
@@ -81,17 +79,19 @@
             return prop;
         }
         plasmaSearchQuery theQuery = theSearch.getQuery();
-
+        int offset = theQuery.neededResults() - theQuery.displayResults();
+        int totalcount = theSearch.getRankingResult().getLocalResourceSize() + 
theSearch.getRankingResult().getRemoteResourceSize();
+        
         // dynamically update count values
         if (!rss) {
-            int offset = theQuery.neededResults() - theQuery.displayResults() 
+ 1;
-            prop.put("dynamic_offset", offset);
+            prop.put("dynamic_offset", offset + 1);
             prop.put("dynamic_itemscount", (item < 0) ? 
theQuery.neededResults() : item + 1);
             prop.put("dynamic_totalcount", 
yFormatter.number(theSearch.getRankingResult().getLocalResourceSize() + 
theSearch.getRankingResult().getRemoteResourceSize(), !rss));
             prop.put("dynamic_localResourceSize", 
yFormatter.number(theSearch.getRankingResult().getLocalResourceSize(), !rss));
             prop.put("dynamic_remoteResourceSize", 
yFormatter.number(theSearch.getRankingResult().getRemoteResourceSize(), !rss));
             prop.put("dynamic_remoteIndexCount", 
yFormatter.number(theSearch.getRankingResult().getRemoteIndexCount(), !rss));
             prop.put("dynamic_remotePeerCount", 
yFormatter.number(theSearch.getRankingResult().getRemotePeerCount(), !rss));
+            prop.put("dynamic_resnav", "");
             prop.put("dynamic", "1");
         }
         
@@ -146,22 +146,49 @@
                         word = (String) iter.next();
                         if ((theQuery == null) || (theQuery.queryString == 
null)) break;
                         if (word != null) {
-                            prop.putHTML("references_words_" + hintcount + 
"_word", word);
-                            prop.putHTML("references_words_" + hintcount + 
"_newsearch", theQuery.queryString.replace(' ', '+') + "+" + word);
-                            prop.put("references_words_" + hintcount + 
"_count", theQuery.displayResults());
-                            prop.put("references_words_" + hintcount + 
"_offset", "0");
-                            prop.put("references_words_" + hintcount + 
"_contentdom", theQuery.contentdom());
-                            prop.put("references_words_" + hintcount + 
"_resource", theQuery.searchdom());
+                            prop.putHTML("navigation_topwords_words_" + 
hintcount + "_word", word);
+                            prop.putHTML("navigation_topwords_words_" + 
hintcount + "_newsearch", theQuery.queryString.replace(' ', '+') + "+" + word);
+                            prop.put("navigation_topwords_words_" + hintcount 
+ "_count", theQuery.displayResults());
+                            prop.put("navigation_topwords_words_" + hintcount 
+ "_offset", "0");
+                            prop.put("navigation_topwords_words_" + hintcount 
+ "_contentdom", theQuery.contentdom());
+                            prop.put("navigation_topwords_words_" + hintcount 
+ "_resource", theQuery.searchdom());
                         }
-                        prop.put("references_words", hintcount);
+                        prop.put("navigation_topwords_words", hintcount);
                         if (hintcount++ > MAX_TOPWORDS) {
                             break;
                         }
                     }
-                    prop.put("references", "1");
+                    prop.put("navigation_topwords", "1");
                 }
+                
             }
             
+            // compose page navigation
+            StringBuffer resnav = new StringBuffer();
+            int thispage = offset / theQuery.displayResults();
+            if (thispage == 0) resnav.append("&lt;&nbsp;"); else {
+                resnav.append(navurla(thispage - 1, theQuery));
+                resnav.append("<strong>&lt;</strong></a>&nbsp;");
+            }
+            int numberofpages = Math.min(10, Math.max(thispage + 2, totalcount 
/ theQuery.displayResults()));
+            for (int j = 0; j < numberofpages; j++) {
+                if (j == thispage) {
+                    resnav.append("<strong>");
+                    resnav.append(j + 1);
+                    resnav.append("</strong>&nbsp;");
+                } else {
+                    resnav.append(navurla(j, theQuery));
+                    resnav.append(j + 1);
+                    resnav.append("</a>&nbsp;");
+                }
+            }
+            if (thispage >= numberofpages) resnav.append("&gt;"); else {
+                resnav.append(navurla(thispage + 1, theQuery));
+                resnav.append("<strong>&gt;</strong></a>");
+            }
+            prop.put("navigation_resnav", resnav.toString());
+            prop.put("navigation", "1");
+            
             return prop;
         }
 
@@ -186,11 +213,6 @@
             }
             
             prop.put("content", theQuery.contentdom + 1); // switch on 
specific content
-            prop.put("content_authorized", authenticated ? "1" : "0");
-            prop.put("content_authorized_recommend", 
(yacyCore.newsPool.getSpecific(yacyNewsPool.OUTGOING_DB, 
yacyNewsPool.CATEGORY_SURFTIPP_ADD, "url", result.urlstring()) == null) ? "1" : 
"0");
-            prop.put("content_authorized_recommend_deletelink", 
"/yacysearch.html?search=" + theQuery.queryString + "&Enter=Search&count=" + 
theQuery.displayResults() + "&offset=" + (theQuery.neededResults() - 
theQuery.displayResults()) + "&order=" + 
crypt.simpleEncode(theQuery.ranking.toExternalString()) + 
"&resource=local&time=3&deleteref=" + result.hash() + "&urlmaskfilter=.*");
-            prop.put("content_authorized_recommend_recommendlink", 
"/yacysearch.html?search=" + theQuery.queryString + "&Enter=Search&count=" + 
theQuery.displayResults() + "&offset=" + (theQuery.neededResults() - 
theQuery.displayResults()) + "&order=" + 
crypt.simpleEncode(theQuery.ranking.toExternalString()) + 
"&resource=local&time=3&recommendref=" + result.hash() + "&urlmaskfilter=.*");
-            prop.put("content_authorized_urlhash", result.hash());
             prop.putHTML("content_description", result.title());
             prop.put("content_url", result.urlstring());
         
@@ -232,6 +254,7 @@
             if (ms == null) {
                 prop.put("content_items", "0");
             } else {
+                prop.putHTML("content_items_0_hrefCache", (auth) ? 
"/ViewImage.png?url=" + ms.href.toNormalform(true, false) : 
ms.href.toNormalform(true, false));
                 prop.putHTML("content_items_0_href", 
ms.href.toNormalform(true, false));
                 prop.put("content_items_0_code", 
sb.licensedURLs.aquireLicense(ms.href));
                 prop.putHTML("content_items_0_name", shorten(ms.name, 
namelength));
@@ -273,7 +296,7 @@
             }
             return prop;
         }
-        
+
         return prop;
     }
     
@@ -284,4 +307,18 @@
         return s.substring(0, length - (s.length() - p) - 3) + "..." + 
s.substring(p);
     }
 
+
+    private static String navurla(int page, plasmaSearchQuery theQuery) {
+        return
+        "<a href=\"ysearch.html?search=" + theQuery.queryString() +
+        "&amp;count="+ theQuery.displayResults() +
+        "&amp;offset=" + (page * theQuery.displayResults()) +
+        "&amp;resource=" + theQuery.searchdom() +
+        "&amp;urlmaskfilter=" + theQuery.urlMask +
+        "&amp;prefermaskfilter=" + theQuery.prefer +
+        "&amp;cat=href&amp;constraint=" + ((theQuery.constraint == null) ? "" 
: theQuery.constraint.exportB64()) +
+        "&amp;contentdom=" + theQuery.contentdom() +
+        "&amp;former=" + theQuery.queryString() + "\">";
+    }
+    
 }

_______________________________________________
YaCy-svn mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/yacy-svn

Antwort per Email an