neighbor_user_contributions

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

Source code:


    if { $purpose == "site_admin" } {
	set target_url "/admin/neighbor/view-one.tcl"
	set restriction_clause ""
    } else {
	set target_url "/neighbor/view-one.tcl"
	set restriction_clause "\nand neighbor_to_neighbor.approved_p = 't'"
    }
    set selection [ns_db select $db "select neighbor_to_neighbor_id, about, title, approved_p, to_char(posted,'Month dd, yyyy') as posted
from neighbor_to_neighbor
where poster_user_id = $user_id $restriction_clause
order by neighbor_to_neighbor_id"]

    set neighbor_items ""
    while {[ns_db getrow $db $selection]} {
	set_variables_after_query
	append neighbor_items "<li>$posted: <A HREF=\"$target_url?[export_url_vars neighbor_to_neighbor_id]\">$about : $title</a>\n"
	if { $approved_p == "f" } {
	    append neighbor_items "<font color=red>unapproved</font>\n"
	}
    }
    if [empty_string_p $neighbor_items] {
	return [list]
    } else {
	return [list 1 "Neighbor to Neighbor" "<ul>\n\n$neighbor_items\n\n</ul>"]
    }


philg@mit.edu