(i1.content_type <> 'content_extlink' or
i1.content_type is null)
(i2.content_type <> 'content_extlink' or
i2.content_type is null)
update cr_items
set tree_sortkey = :next_sortkey
where item_id = :item_id
select extlink_id
from cr_extlinks e, cr_items i, cr_folders f
where i.item_id = e.extlink_id
and i.parent_id = f.folder_id
and f.package_id = :parent_package_id
and e.label = 'current'
update cr_extlinks
set url = :log_url
where extlink_id = :extlink_id
update cr_revisions
set description = :log_description, content = :irc_html_log, mime_type = 'text/html'
where revision_id = :log_live_revision_id