@ -24,6 +24,7 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
import java.io.IOException ;
import java.net.MalformedURLException ;
import java.util.Collection ;
import java.util.Iterator ;
@ -133,12 +134,22 @@ public class yacysearchitem {
prop . put ( "content" , 1 ) ; // switch on specific content
prop . put ( "content_authorized" , authenticated ? "1" : "0" ) ;
final String urlhash = ASCII . String ( result . hash ( ) ) ;
prop . put ( "content_authorized_bookmark" , sb . tables . bookmarks . hasBookmark ( "admin" , urlhash ) ? "0" : "1" ) ;
prop . putHTML ( "content_authorized_bookmark_bookmarklink" , "yacysearch.html?query=" + origQ . replace ( ' ' , '+' ) + "&Enter=Search&count=" + theSearch . query . itemsPerPage ( ) + "&offset=" + ( theSearch . query . neededResults ( ) - theSearch . query . itemsPerPage ( ) ) + "&order=" + crypt . simpleEncode ( theSearch . query . ranking . toExternalString ( ) ) + "&resource=" + resource + "&time=3&bookmarkref=" + urlhash + "&urlmaskfilter=.*" ) ;
prop . put ( "content_authorized_recommend" , ( sb . peers . newsPool . getSpecific ( NewsPool . OUTGOING_DB , NewsPool . CATEGORY_SURFTIPP_ADD , "url" , resultUrlstring ) = = null ) ? "1" : "0" ) ;
prop . putHTML ( "content_authorized_recommend_deletelink" , "yacysearch.html?query=" + origQ . replace ( ' ' , '+' ) + "&Enter=Search&count=" + theSearch . query . itemsPerPage ( ) + "&offset=" + ( theSearch . query . neededResults ( ) - theSearch . query . itemsPerPage ( ) ) + "&order=" + crypt . simpleEncode ( theSearch . query . ranking . toExternalString ( ) ) + "&resource=" + resource + "&time=3&deleteref=" + urlhash + "&urlmaskfilter=.*" ) ;
prop . putHTML ( "content_authorized_recommend_recommendlink" , "yacysearch.html?query=" + origQ . replace ( ' ' , '+' ) + "&Enter=Search&count=" + theSearch . query . itemsPerPage ( ) + "&offset=" + ( theSearch . query . neededResults ( ) - theSearch . query . itemsPerPage ( ) ) + "&order=" + crypt . simpleEncode ( theSearch . query . ranking . toExternalString ( ) ) + "&resource=" + resource + "&time=3&recommendref=" + urlhash + "&urlmaskfilter=.*" ) ;
prop . put ( "content_authorized_urlhash" , urlhash ) ;
if ( authenticated ) { // only needed if authorized
boolean bookmarkexists ;
try { // check url exists in bookkmarks
bookmarkexists = sb . bookmarksDB . getBookmark ( urlhash ) ! = null ;
} catch ( IOException ex ) {
bookmarkexists = false ;
}
prop . put ( "content_authorized_bookmark" , ! bookmarkexists ) ;
// bookmark icon check for YMarks
//prop.put("content_authorized_bookmark", sb.tables.bookmarks.hasBookmark("admin", urlhash) ? "0" : "1");
prop . putHTML ( "content_authorized_bookmark_bookmarklink" , "yacysearch.html?query=" + origQ . replace ( ' ' , '+' ) + "&Enter=Search&count=" + theSearch . query . itemsPerPage ( ) + "&offset=" + ( theSearch . query . neededResults ( ) - theSearch . query . itemsPerPage ( ) ) + "&order=" + crypt . simpleEncode ( theSearch . query . ranking . toExternalString ( ) ) + "&resource=" + resource + "&time=3&bookmarkref=" + urlhash + "&urlmaskfilter=.*" ) ;
prop . put ( "content_authorized_recommend" , ( sb . peers . newsPool . getSpecific ( NewsPool . OUTGOING_DB , NewsPool . CATEGORY_SURFTIPP_ADD , "url" , resultUrlstring ) = = null ) ? "1" : "0" ) ;
prop . putHTML ( "content_authorized_recommend_deletelink" , "yacysearch.html?query=" + origQ . replace ( ' ' , '+' ) + "&Enter=Search&count=" + theSearch . query . itemsPerPage ( ) + "&offset=" + ( theSearch . query . neededResults ( ) - theSearch . query . itemsPerPage ( ) ) + "&order=" + crypt . simpleEncode ( theSearch . query . ranking . toExternalString ( ) ) + "&resource=" + resource + "&time=3&deleteref=" + urlhash + "&urlmaskfilter=.*" ) ;
prop . putHTML ( "content_authorized_recommend_recommendlink" , "yacysearch.html?query=" + origQ . replace ( ' ' , '+' ) + "&Enter=Search&count=" + theSearch . query . itemsPerPage ( ) + "&offset=" + ( theSearch . query . neededResults ( ) - theSearch . query . itemsPerPage ( ) ) + "&order=" + crypt . simpleEncode ( theSearch . query . ranking . toExternalString ( ) ) + "&resource=" + resource + "&time=3&recommendref=" + urlhash + "&urlmaskfilter=.*" ) ;
prop . put ( "content_authorized_urlhash" , urlhash ) ;
}
prop . putHTML ( "content_title" , result . title ( ) ) ;
prop . putXML ( "content_title-xml" , result . title ( ) ) ;
prop . putJSON ( "content_title-json" , result . title ( ) ) ;