bboard_user_contributions

one of the documented procedures in this installation of the ACS
Usage:
bboard_user_contributions   db   user_id   purpose
What it does:
Returns list items, one for each bboard posting
Defined in: /web/philip/tcl/bboard-defs.tcl

Source code:


    if { $purpose == "site_admin" } {
	set restriction_clause ""
    } else {
	set restriction_clause "\nand (bboard_topics.read_access in ('any', 'public'))\n"
    }
    set selection [ns_db select $db "select one_line, msg_id,  posting_time, sort_key, bboard_topics.topic, presentation_type 
from bboard, bboard_topics 
where bboard.user_id = $user_id
and bboard.topic_id = bboard_topics.topic_id $restriction_clause
order by posting_time asc"]

    set bboard_items ""
    while { [ns_db getrow $db $selection] } {
	set_variables_after_query
	if { [string first "." $sort_key] == -1 } {
	    # there is no period in the sort key so this is the start of a thread
	    set thread_start_msg_id $sort_key
	} else {
	    # strip off the stuff before the period
	    regexp {(.*)\..*} $sort_key match thread_start_msg_id
	}
	append bboard_items "<li>[util_AnsiDatetoPrettyDate $posting_time]: <a href=\"/bboard/[bboard_msg_url $presentation_type $thread_start_msg_id $topic]\">$one_line</a>\n"
    }
    if [empty_string_p $bboard_items] {
	return [list]
    } else {
	return [list 0 "/bboard postings" "<ul>\n\n$bboard_items\n\n</ul>"]
    }


philg@mit.edu