news_newsgroup_id_list

one of the documented procedures in this installation of the ACS
Usage:
news_newsgroup_id_list   db   user_id   group_id
What it does:
Returns the list of newsgroup_ids for the appropriate news items for this user and group. If the user_id exists (i.e. non zero) then the list includes the registered_users. If group_id is set, then the newsgroup for the group is added (if it exists).
Defined in: /web/philip/tcl/news-defs.tcl

Source code:



    # Build the newsgroup clause
    set scope_clause_list [list "scope = 'all_users'"]

    if { $user_id != 0 } {
	lappend scope_clause_list "scope = 'registered_users'"
    }

    if { $group_id > 0 } {
	lappend scope_clause_list "(scope = 'group' and group_id = $group_id)"
    } else {
	lappend scope_clause_list "scope = 'public'"
    }

    return [database_to_tcl_list $db "select newsgroup_id from newsgroups where [join $scope_clause_list " or "]"]


philg@mit.edu