The path is the following:
/admin/reports/modr8
I need to create a new column specifying the node content type.
I know that I need to add some code lines in this function below.
But the thing is that I'm taking too much time trying to figure out how to print the node content type on the column that I created, which means that I also have to save it in the 'modr8_log' table .
function modr8_log_overview($nid = 0) {
$header = array(
array('data' => t('Status'), ),
array('data' => t('User'), 'field' => 'u.name'),
array('data' => t('Date'), 'field' => 'ml.modid', 'sort' => 'desc'),
array('data' => t('Title (view event)')),
array('data' => t('Tipo de Conteúdo'),), // <<<< this creates the new column, as showed in the image
);
$tablesort = tablesort_sql($header);
$count_sql = "SELECT COUNT(*) FROM {modr8_log} ml";
$pager_sql = "SELECT ml.modid, ml.action, ml.title, ml.timestamp, ml.tipo, u.name, u.uid FROM {modr8_log} ml LEFT JOIN {users} u ON u.uid = ml.uid";
if ($nid) {
$count_sql .= " WHERE ml.nid = %d";
$pager_sql .= " WHERE ml.nid = %d";
}
$count_sql = db_rewrite_sql($count_sql, 'ml');
$pager_sql = db_rewrite_sql($pager_sql, 'ml');
$result = pager_query($pager_sql . $tablesort, 20, 0, $count_sql, $nid);
$rows = array();
while ($event = db_fetch_object($result) ) {
$rows[] = array(t($event->action), theme('username', $event), format_date($event->timestamp, 'small'), l(truncate_utf8($event->title, 50, TRUE, TRUE), 'admin/reports/modr8/event/'. $event->modid, array(), NULL, NULL, FALSE, TRUE), theme(node_get_types("name", $node)) );
}
if (!$rows) {
$rows[] = array(array('data' => t('No log messages available.'), 'colspan' => 5));
}
$output = '';
$output .= theme('table', $header, $rows);
$output .= theme('pager', NULL, 50, 0);
return $output;
}
| Comment | File | Size | Author |
|---|---|---|---|
| printscreen.gif | 270.62 KB | alinemartini |
Comments
Comment #1
Stevel commentedThis looks more like a support request for modr8 instead of a critical drupal task. Could also be thought of as a feature request.