ad_related_links_new_stuff

one of the documented procedures in this installation of the ACS
Usage:
ad_related_links_new_stuff   db   since_when   only_from_new_users_p   purpose
What it does:
Only produces a report for the site administrator; the assumption is that random users won't want to see out-of-context links
Defined in: /web/philip/tcl/ad-new-stuff.tcl

Source code:


    if { $purpose != "site_admin" } {
	return ""
    }
    if { $only_from_new_users_p == "t" } {
	set users_table "users_new"
    } else {
	set users_table "users"
    }
    set query "select links.link_title, links.link_description, links.url, links.status,  posting_time,
ut.user_id, first_names || ' ' || last_name as name, links.url, sp.page_id, sp.page_title, sp.url_stub
from static_pages sp, links, $users_table ut
where sp.page_id (+) = links.page_id
and ut.user_id = links.user_id
and posting_time > '$since_when'
order by posting_time desc"
    set result_items ""
    set selection [ns_db select $db $query]
    while { [ns_db getrow $db $selection] } {
	set_variables_after_query
	append result_items "<li>[util_AnsiDatetoPrettyDate $posting_time]: 
<a href=\"$url\">$link_title</a> "
        if { $status != "live" } {
	    append result_items "(<font color=red>$status</font>)"
	}
	append result_items "- $link_description 
<br>
--
posted by <a href=\"/admin/users/one?user_id=$user_id\">$name</a> 
on  <a href=\"/admin/static/page-summary?page_id=$page_id\">$url_stub</a>   
&nbsp; 
\[
<a target=working href=\"/admin/links/edit?[export_url_vars url page_id]\">edit</a> |
<a target=working href=\"/admin/links/delete?[export_url_vars url page_id]\">delete</a> |
<a target=working href=\"/admin/links/blacklist?[export_url_vars url page_id]\">blacklist</a>
\]
<p>
"
    }
    if { ![empty_string_p $result_items] } {
	return "<ul>\n\n$result_items\n</ul>\n"
    } else {
	return ""
    }


philg@mit.edu