Index: openacs-4/packages/search/search.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/search/search.info,v diff -u -r1.29 -r1.30 --- openacs-4/packages/search/search.info 27 Nov 2007 22:27:59 -0000 1.29 +++ openacs-4/packages/search/search.info 5 Jan 2008 17:44:10 -0000 1.30 @@ -7,7 +7,7 @@ t t - + OpenACS 2007-07-18 3 @@ -17,13 +17,14 @@ GPL version 2 Site wide search implemented with service contracts, currently supports postgres via the tsearch2 driver (OpenFTS still support but deprecated). - + + Index: openacs-4/packages/search/lib/navbar.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/search/lib/navbar.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/search/lib/navbar.adp 5 Jan 2008 17:44:10 -0000 1.1 @@ -0,0 +1,38 @@ + +
+ +
+
Index: openacs-4/packages/search/lib/navbar.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/search/lib/navbar.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/search/lib/navbar.tcl 5 Jan 2008 17:44:10 -0000 1.1 @@ -0,0 +1,50 @@ +set package_id [ad_conn package_id] + +set limit [ad_parameter -package_id $package_id LimitDefault] +set pages_per_group [ad_parameter -package_id $package_id PagesPerGroup] + +set current_result_page [expr {$low / $limit}] +set from_result_page [expr {($current_result_page / $pages_per_group) * $pages_per_group}] +set last_result_page [expr {($count + $limit - 1)/ $limit - 1}] +set to_result_page [expr {($last_result_page < $pages_per_group + $from_result_page - 1 ? $last_result_page : $pages_per_group + $from_result_page - 1)} ] +set current_page_group [expr { int($current_result_page / $pages_per_group) }] +set last_page_group [expr { int($last_result_page / $pages_per_group) }] +set first_page_in_group [expr { $current_page_group * $pages_per_group }] +set last_page_in_group [expr { ($current_page_group + 1) * $pages_per_group - 1 }] + +if { $current_page_group >= 1 } { + set offset [expr {($current_page_group - 1) * $pages_per_group * $limit}] + set url_previous_group [export_vars -base search {{q $urlencoded_query} search_package_id offset num}] +} else { + set url_previous_group "" +} + +if { $current_page_group < $last_page_group } { + set offset [expr {($current_page_group + 1) * $pages_per_group * $limit}] + set url_next_group [export_vars -base search {{q $urlencoded_query} search_package_id offset num}] +} else { + set url_next_group "" +} + +if { $current_result_page > 1 } { + set offset [expr ($current_result_page - 1) * $limit] + set url_previous [export_vars -base search {{q $urlencoded_query} search_package_id offset num}] +} else { + set url_previous "" +} + +if { $current_result_page < $last_result_page } { + set offset [expr {$current_result_page * $limit + $limit}] + set url_next [export_vars -base search {{q $urlencoded_query} search_package_id offset num}] +} else { + set url_next "" +} + +template::multirow create results_paginator item link current_p +for { set __i $from_result_page } { $__i <= $to_result_page} { incr __i } { + set link "search?q=${urlencoded_query}&search_package_id=$search_package_id" + if { $__i > 1 } { append link "&offset=[expr {$__i * $limit}]" } + if { $num > 0 } { append link "&num=$num" } + + template::multirow append results_paginator [expr {$__i + 1}] $link [expr {$__i == $current_result_page}] +} Index: openacs-4/packages/search/www/search.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/search/www/search.adp,v diff -u -r1.13 -r1.14 --- openacs-4/packages/search/www/search.adp 27 Nov 2007 22:16:26 -0000 1.13 +++ openacs-4/packages/search/www/search.adp 5 Jan 2008 17:44:10 -0000 1.14 @@ -62,62 +62,41 @@ + - -
- - -
-
- -
-
-
- - -
-
- - #search.lt_Tip_In_most_browsers_# - -
+
+
+
+ + +
+
+ +#search.lt_Tip_In_most_browsers_# + +
- -

#search.lt_Try_your_query_on_stw#

-
+ +

#search.lt_Try_your_query_on_stw#

+
- -

#search.and_not_needed# [#search.details#]

-
- -

#search.lt_bstopwordsb_is_a_very# [#search.details#]

-
- -

#search.lt_The_following_words_a# [#search.details#]

-
- - -

#search.Searched_for_query#

-

#search.Results_count#

-
+ +

#search.and_not_needed# [#search.details#]

+
+ +

#search.lt_bstopwordsb_is_a_very# [#search.details#]

+
+ +

#search.lt_The_following_words_a# [#search.details#]

+
+ +

#search.Searched_for_query#

+

#search.Results_count#

+
+ Index: openacs-4/packages/search/www/search.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/search/www/search.tcl,v diff -u -r1.30 -r1.31 --- openacs-4/packages/search/www/search.tcl 27 Nov 2007 22:16:26 -0000 1.30 +++ openacs-4/packages/search/www/search.tcl 5 Jan 2008 17:44:10 -0000 1.31 @@ -182,35 +182,6 @@ template::multirow append searchresult $title_summary $txt_summary $url_one } - -set from_result_page 1 -set current_result_page [expr ($low / $limit) + 1] -set to_result_page [expr {ceil(double($result(count)) / double($limit))}] - -set url_previous "" -set url_next "" -append url_previous "search?q=${urlencoded_query}&search_package_id=$search_package_id" -append url_next "search?q=${urlencoded_query}&search_package_id=$search_package_id" -if { [expr {$current_result_page - 1}] > $from_result_page } { - append url_previous "&offset=[expr ($current_result_page - 2) * $limit]" -} -if { $current_result_page < $to_result_page } { - append url_next "&offset=[expr {$current_result_page * $limit}]" -} -if { $num > 0 } { - append url_previous "&num=$num" - append url_next "&num=$num" -} - -template::multirow create results_paginator item link -for { set __i $from_result_page } { $__i <= $to_result_page} { incr __i } { - set link "search?q=${urlencoded_query}&search_package_id=$search_package_id" - if { $__i > 1 } { append link "&offset=[expr ($__i - 1) * $limit]" } - if { $num > 0 } { append link "&num=$num" } - - template::multirow append results_paginator $__i $link -} - set search_the_web [ad_parameter -package_id $package_id SearchTheWeb] if {[llength $search_the_web]} { set stw ""