I'm trying to get a table output using the theme_table functions. My node types are defined as CCK types.
This is what I have currently:
<?php
//Set up the table Headings
$header = array(
array('data' => t('ID'), 'field' => 'nid'),
array('data' => t('title'), 'field' => 'title'),
array('data' => t('author'), 'field' => 'field_author[0][\'view\']'));
$node_type = "content-publication";
$list_no = 5;
$sql = "SELECT * FROM node WHERE node.type = '$node_type'";
$sql .= tablesort_sql($header);
$result = pager_query($sql, $list_no);
// Loop through all the records
while ( $records = db_fetch_object($result) ) {
// Build a row for the table from the data
$rows[] = array($records->nid, $records->title, $records->author);
}
$pager = theme('pager', NULL, 50, 0);
// Add the pager to the table if needed
if ( count($rows) && !empty($pager)) {
$rows[] = array(array('data' => $pager, 'colspan' => '3'));
}
// If we have rows for a table, theme the table
// otherwise set output to a message
if ( count($rows) ) {
$output = theme('table', $header, $rows);
}
else {
$output = "There are currently no clients";
}
// And finally, produce the page
print theme('page', $output);
?>
My problems are the lines: