Index: openacs-4/packages/acs-subsite/tcl/relation-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/tcl/relation-procs.tcl,v diff -u -r1.11 -r1.12 --- openacs-4/packages/acs-subsite/tcl/relation-procs.tcl 2 Mar 2004 16:58:31 -0000 1.11 +++ openacs-4/packages/acs-subsite/tcl/relation-procs.tcl 4 Mar 2005 21:22:05 -0000 1.12 @@ -318,3 +318,21 @@ } { return [db_string select_rel_id {} -default {}] } + +ad_proc -public relation::get_object_one { + {-object_id_two:required} + {-rel_type "membership_rel"} +} { + Return the object_id of object one if a relation of rel_type exists between the supplied object_id_two and it. +} { + return [db_string select_object_one {} -default {}] +} + +ad_proc -public relation::get_object_two { + {-object_id_one:required} + {-rel_type "membership_rel"} +} { + Return the object_id of object two if a relation of rel_type exists between the supplied object_id_one and it. +} { + return [db_string select_object_two {} -default {}] +} Index: openacs-4/packages/acs-subsite/tcl/relation-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/tcl/relation-procs.xql,v diff -u -r1.4 -r1.5 --- openacs-4/packages/acs-subsite/tcl/relation-procs.xql 21 Sep 2003 19:31:18 -0000 1.4 +++ openacs-4/packages/acs-subsite/tcl/relation-procs.xql 4 Mar 2005 21:22:05 -0000 1.5 @@ -65,4 +65,26 @@ + + + + select object_id_one + from acs_rels + where rel_type = :rel_type + and object_id_two = :object_id_two + + + + + + + + select object_id_two + from acs_rels + where rel_type = :rel_type + and object_id_one = :object_id_one + + + +