poll_user_contributions db user_id purposeWhat it does:
Returns list items, one for each answer; returns empty list for non-site-admin.Defined in: /web/philip/tcl/poll-defs.tcl
Source code:
if { $purpose != "site_admin" } { return [list] } set selection [ns_db select $db "select polls.poll_id, polls.name as poll_name, pc.label as choice_name, puc.choice_date from polls, poll_choices pc, poll_user_choices puc where puc.user_id = $user_id and puc.choice_id = pc.choice_id and puc.poll_id = polls.poll_id order by choice_date asc"] set items "" while { [ns_db getrow $db $selection] } { set_variables_after_query append items "<li>[util_AnsiDatetoPrettyDate $choice_date]: <a href=\"/admin/poll/one-poll?[export_url_vars poll_id]\">$poll_name</a>; $choice_name\n" } if [empty_string_p $items] { return [list] } else { return [list 0 "Poll Choices" "<ul>\n\n$items\n\n</ul>"] }