Index: openacs-4/packages/ratings/tcl/rating-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ratings/tcl/rating-procs.tcl,v diff -u -r1.4.2.2 -r1.4.2.3 --- openacs-4/packages/ratings/tcl/rating-procs.tcl 29 Jul 2005 23:08:24 -0000 1.4.2.2 +++ openacs-4/packages/ratings/tcl/rating-procs.tcl 1 Aug 2005 06:13:09 -0000 1.4.2.3 @@ -344,6 +344,7 @@ append output "    " incr count } + append output "" return $output } @@ -371,7 +372,7 @@ } ad_proc -public ratings::get_average { - -context_object_id:required + {-context_object_id ""} -object_id:required {-dimension_key ""} } { @@ -388,7 +389,11 @@ } { set extra_query "" if { ![empty_string_p $dimension_key] } { - set extra_query "and dimension_id = ( select dimension_id from rating_dimensions where dimension_key = '$dimension_key' )" + append extra_query "and dimension_id = ( select dimension_id from rating_dimensions where dimension_key = '$dimension_key' )" } + if { ![empty_string_p $context_object_id] } { + append extra_query "and context_object_id = :context_object_id" + } + return [db_string get_average_rating " "] }