Index: openacs-4/packages/news/tcl/news-procs-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/news/tcl/news-procs-oracle.xql,v diff -u -r1.5 -r1.6 --- openacs-4/packages/news/tcl/news-procs-oracle.xql 24 Feb 2005 13:33:23 -0000 1.5 +++ openacs-4/packages/news/tcl/news-procs-oracle.xql 5 Apr 2005 15:21:25 -0000 1.6 @@ -74,4 +74,15 @@ - + + + begin + :1 := acs_rel.new(rel_type => 'relationship', + object_id_one => :revision_id, + object_id_two => :image_id, + creation_user => :creation_user, + creation_ip => :peeraddr); + end; + + + \ No newline at end of file Index: openacs-4/packages/news/tcl/news-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/news/tcl/news-procs-postgresql.xql,v diff -u -r1.4 -r1.5 --- openacs-4/packages/news/tcl/news-procs-postgresql.xql 24 Feb 2005 13:33:23 -0000 1.4 +++ openacs-4/packages/news/tcl/news-procs-postgresql.xql 5 Apr 2005 15:21:25 -0000 1.5 @@ -67,4 +67,9 @@ + + +select acs_rel__new(null, 'relationship', :revision_id, :image_id, null, :creation_user, :peeraddr) + + Index: openacs-4/packages/news/tcl/news-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/news/tcl/news-procs.tcl,v diff -u -r1.19 -r1.20 --- openacs-4/packages/news/tcl/news-procs.tcl 26 Mar 2005 20:54:27 -0000 1.19 +++ openacs-4/packages/news/tcl/news-procs.tcl 5 Apr 2005 15:21:25 -0000 1.20 @@ -106,7 +106,30 @@ return 1 } +ad_proc news_revision_set_image_id { + revision_id + image_id +} { + Associates an image with a revision of a news item. + + @author simon@simonbuckle.com +} { + set creation_user [ad_conn user_id] + set peeraddr [ad_conn peeraddr] + db_exec_plsql set_image_rel {} +} + +ad_proc news_revision_get_image_id { + revision_id +} { + Returns the image id if there is one associated with this image, empty string otherwise + + @author simon@simonbuckle.com +} { + return [relation::get_object_two -object_id_one $revision_id -rel_type "relationship"] +} + ad_proc news_get_image_id { item_id } {