postgresql7.1
select news__archive(
:id, -- item_id
:when -- archive_date
);
select news__make_permanent(:id);
select news__delete(:id);
select site_node__url(node_id) as url_stub
from site_nodes
where object_id=:package_id
limit 1
select cn.*,
ci.item_id,
cr.content,
cr.title,
cr.mime_type,
cr.description,
to_char(o.last_modified, 'YYYY-MM-DD HH24:MI:SS') as last_modified
from cr_news cn,
cr_revisions cr,
cr_items ci,
acs_objects o
where cn.package_id=:summary_context_id
and cr.revision_id=cn.news_id
and cn.news_id=o.object_id
and cr.item_id=ci.item_id
and cr.revision_id=ci.live_revision
order by o.last_modified desc
limit $limit
select acs_rel__new(null, 'relationship', :revision_id, :image_id, null, :creation_user, :peeraddr)