'.t('Are you sure?').'';
$block['content'] .= adminblock_multiple_delete_confirm();
}
else
$block['content'] = adminblock_view();
return $block;
}
}
function adminblock_view()
{
$nlimit = 10;
if (user_access('administer comments')) {
$result = db_query_range('SELECT c.timestamp, c.subject, c.comment, c.cid, c.nid, c.uid, c.name, n.title
FROM {comments} c
INNER JOIN {node} n ON c.nid = n.nid
WHERE c.status = 1
ORDER BY c.timestamp DESC ', 0, $nlimit);
$comment_count = db_num_rows($result);
$comment_count_display = $comment_count > $nlimit ? ' ('. $comment_count .')' : '';
$comments = array();
while ($comment = db_fetch_object($result)) {
$comments[$comment->cid] = l(truncate_utf8(check_plain($comment->comment),256), 'node/'. $comment->nid, array('title' => $comment->title), NULL, 'comment-'. $comment->cid) .'
['.($comment->uid!=0?l(t('By %user', array('%user' => $comment->name)), 'user/'. $comment->uid):t('By %user', array('%user' => $comment->name))) .']|['. l(t('edit'), 'comment/edit/'. $comment->cid) .']';
}
if($comments)
$form['comments'] = array(
'#type' => 'checkboxes',
'#title' => l(t('Comments queue'),'admin/comment/list/approval'),
'#options' => $comments,
);
}
if (user_access('administer nodes')) {
$result2 = db_query_range('SELECT n.nid, n.title, n.changed, u.name, u.uid
FROM {node} n
INNER JOIN {users} u ON n.uid = u.uid
WHERE n.status = 0 AND n.moderate = 1
ORDER BY n.changed DESC', 0, $nlimit);
$node_count = db_num_rows($result2);
$node_count_display = $node_count > $nlimit ? ' ('. $node_count .')' : '';
$nodes = array();
while ($node = db_fetch_object($result2)) {
$nodes[$node->nid] = l(check_plain($node->title),'node/'.$node->nid) .'
['. l(t('By %user', array('%user' => $node->name)), 'user/'. $node->uid) .']|['. l(t('edit'), 'node/'. $node->nid .'/edit') .']';
}
if($nodes)
$form['nodes'] = array(
'#type' => 'checkboxes',
'#title' => l(t('Content queue'),'admin/node'),
'#options' => $nodes,
);
}
if (module_exist('trackback') && user_access('administer trackbacks')) {
$result3 = db_query_range('SELECT t.created, t.subject, t.nid, t.trid, t.excerpt
FROM {trackback_received} t
INNER JOIN {node} n ON t.nid = n.nid
WHERE t.status = 0
ORDER BY t.created DESC ', 0, $nlimit);
$trackback_count = db_num_rows($result3);
$trackback_count_display = $trackback_count > $nlimit ? ' ('. $trackback_count .')' : '';
$trackbacks = array();
while ($trackback = db_fetch_object($result3)) {
$trackbacks[$trackback->trid] = check_plain($trackback->subject) .' - '. format_date($trackback->created, 'medium') .'
['. l(t('edit'), 'admin/trackback/edit/'. $trackback->trid) .']';
}
if($trackbacks)
$form['trackbacks'] = array(
'#type' => 'checkboxes',
'#title' => t('Trackback queue'),
'#options' => $trackbacks,
);
}
if($comments || $nodes || $trackbacks) {
// build an 'Update options' form
$options = array();
$options['publish'] = t('publish');
$options['delete'] = t('delete');
$form['operation'] = array('#type' => 'select', '#options' => $options, '#default_value' => 'publish', '#prefix' => '