searches_user_contributions

one of the documented procedures in this installation of the ACS
Usage:
searches_user_contributions   db   user_id   purpose
What it does:
Returns empty list if purpose is not "site_admin". Otherwise a triplet including all the searches typed on this site while this user was logged in or was referred in.
Defined in: /web/philip/tcl/ad-referer.tcl

Source code:


    if { $purpose != "site_admin" } {
	return [list]
    }
    set selection [ns_db select $db "select query_date, 
decode(subsection, null, search_engine_name, subsection) location, 
decode(n_results, null, '', ' - ' || n_results || ' result(s)') n_results_string, query_string
from query_strings
where user_id = $user_id
order by query_date asc
"]

    set items ""
    while {[ns_db getrow $db $selection]} {
	set_variables_after_query
	append items "<li>$query_date:</a>
<a href=\"/admin/searches/by-word?query_string=[ns_urlencode $query_string]\"><b>$query_string</b></a>
<a href=\"/admin/searches/by-location?location=[ns_urlencode $location]\">($location)</a>
$n_results_string
"
    }
    if [empty_string_p $items] {
	return [list]
    } else {
	return [list 0 "Searches" "<ul>\n\n$items\n\n</ul>"]
    }


philg@mit.edu