function _systeminfo_admin_drupal_content in System Information 6.3
Same name and namespace in other branches
- 7.3 systeminfo.admin.drupal.inc \_systeminfo_admin_drupal_content()
1 call to _systeminfo_admin_drupal_content()
- systeminfo_admin_drupal in ./
systeminfo.admin.drupal.inc - Menu callback; displays the Drupal page.
File
- ./
systeminfo.admin.drupal.inc, line 40 - Admin Drupal page callbacks for the systeminfo module.
Code
function _systeminfo_admin_drupal_content() {
$header = array();
$header[] = t('Group');
$header[] = t('Nodes');
$node_types_active = array();
$node_types_deleted = array();
$result = db_query('SELECT n.type, nt.name, COUNT(n.nid) AS count FROM {node} n LEFT JOIN {node_type} nt ON n.type = nt.type GROUP BY n.type');
while ($record = db_fetch_object($result)) {
if ($record->name) {
$node_types_active[$record->name] = $record;
}
else {
$node_types_deleted[$record->type] = $record;
}
}
ksort($node_types_active);
ksort($node_types_deleted);
$rows = array();
$rows[] = array(
t('Total'),
db_result(db_query('SELECT COUNT(nid) FROM {node}')),
);
if ($node_types_active) {
$rows[] = array(
array(
'data' => t('Active content types'),
'class' => 'title1',
'colspan' => '2',
),
);
foreach ($node_types_active as $node_type) {
$rows[] = array(
array(
'data' => check_plain($node_type->name),
'class' => 'text1',
),
$node_type->count,
);
$rows[] = array(
array(
'data' => t('Published'),
'class' => 'text2',
),
db_result(db_query('SELECT COUNT(nid) FROM {node} WHERE type = "%s" AND status = 1', $node_type->type)),
);
$rows[] = array(
array(
'data' => t('Promoted to front page'),
'class' => 'text2',
),
db_result(db_query('SELECT COUNT(nid) FROM {node} WHERE type = "%s" AND promote = 1', $node_type->type)),
);
$rows[] = array(
array(
'data' => t('Sticky at top of lists'),
'class' => 'text2',
),
db_result(db_query('SELECT COUNT(nid) FROM {node} WHERE type = "%s" AND sticky = 1', $node_type->type)),
);
}
}
if ($node_types_deleted) {
$rows[] = array(
array(
'data' => t('Deleted content types'),
'class' => 'title1',
'colspan' => '2',
),
);
foreach ($node_types_deleted as $node_type) {
$rows[] = array(
array(
'data' => check_plain($node_type->type),
'class' => 'text1',
),
$node_type->count,
);
$rows[] = array(
array(
'data' => t('Published'),
'class' => 'text2',
),
db_result(db_query('SELECT COUNT(nid) FROM {node} WHERE type = "%s" AND status = 1', $node_type->type)),
);
$rows[] = array(
array(
'data' => t('Promoted to front page'),
'class' => 'text2',
),
db_result(db_query('SELECT COUNT(nid) FROM {node} WHERE type = "%s" AND promote = 1', $node_type->type)),
);
$rows[] = array(
array(
'data' => t('Sticky at top of lists'),
'class' => 'text2',
),
db_result(db_query('SELECT COUNT(nid) FROM {node} WHERE type = "%s" AND sticky = 1', $node_type->type)),
);
}
}
return theme('table', $header, $rows, array(
'class' => 'systeminfo systeminfo-width50',
));
}