ad_summarize_user_contributions

one of the documented procedures in this installation of the ACS
Usage:
ad_summarize_user_contributions   db   user_id   { purpose "web_display" }
What it does:
Returns a string of a user's contributed stuff on the site. The PURPOSE argument can be "web_display" (intended for an ordinary user) or "site_admin" (to help the owner of a site nuke stuff). These arguments are passed down to the procedures on the ns_share'd ad_user_contributions_summary_proc_list.
Defined in: /web/philip/tcl/ad-user-contributions-summary.tcl

Source code:


    ns_share ad_user_contributions_summary_proc_list
    set result_list [list]
    foreach sublist $ad_user_contributions_summary_proc_list {
	set module_name [lindex $sublist 0]
	set module_proc [lindex $sublist 1]
	# affects how we display the stuff
	set priority [lindex $sublist 2]

        # Put here so I get a traceback when subquery not released JCD
        #ns_log Notice "contibutions for $module_name via $module_proc"
        #set dbx [ns_db gethandle subquery] 
        #ns_db releasehandle $dbx

	if [catch { set one_module_result [eval [list $module_proc $db $user_id $purpose]] } errmsg] {
	    ns_log Notice "ad_summarize_user_contributions got an error calling $module_proc:  $errmsg"
	    # got an error, let's continue to the next iteration
	    continue
	}
	if { [llength $one_module_result] != 0 && ![empty_string_p [lindex $one_module_result 2]] } {
	    # we got back a triplet AND there was some actual content
	    lappend result_list $one_module_result
	}
    }
    # we've got all the results, let's sort by priority and then size
    set sorted_list [lsort -command ad_user_contributions_summary_sort $result_list]
    set html_fragment ""
    foreach result_elt $sorted_list {
	set subsection_title [lindex $result_elt 1]
	set subsection_contents [lindex $result_elt 2]
	append html_fragment "<h3>$subsection_title</h3>\n\n$subsection_contents\n\n"
    }
    return $html_fragment


philg@mit.edu