Index: openacs-4/packages/views/tcl/views-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/views/tcl/views-procs.tcl,v diff -u -r1.5 -r1.6 --- openacs-4/packages/views/tcl/views-procs.tcl 23 Jul 2007 05:25:10 -0000 1.5 +++ openacs-4/packages/views/tcl/views-procs.tcl 2 Aug 2007 08:33:39 -0000 1.6 @@ -1,4 +1,4 @@ -# /packages/cop-base/tcl/ratings-procs.tcl +# /packages/views/tcl/views-procs.tcl ad_library { TCL library for recoding views @@ -26,15 +26,17 @@ @creation-date 2004-01-30 } { if { $type ne "" } { - if { [lsearch [list views unique_views last_viewed] $type] >= 0 } { + if { [lsearch [list views_count unique_views last_viewed] $type] >= 0 } { # if the type is on of the list it will conflict on the views::get procedure - error "views::record_view type cannot be views, unique_views or last_viewed" + error "views::record_view type cannot be views_count, unique_views or last_viewed" } - set views_by_type [db_string record_view_by_type "select views_by_type__record_view(:object_id, :viewer_id, :type)" -default 1] + #TYPE is PL/SQL reserver word in ORACLE + #set view_type $type + set views_by_type [db_exec_plsql record_view_by_type {}] } - if {[catch {db_string record_view "select views__record_view(:object_id, :viewer_id)" -default 1} views]} { - set views 0 + if {[catch {set views [db_exec_plsql record_view {}]} views]} { + set views 0 } return $views } @@ -45,28 +47,20 @@ Return an array (which you have to set with "array set your_array [views::get -object_id $object_id]") with the elements: