Thursday, February 10, 2011

Drupal 6 Theme table creation with Pagination & Sorting

<?php

  $result = pager_query("SELECT module, delta, theme FROM {blocks}",5);

$header = array(array('data'=>t('Module'),'field'=>'module','sort'=>asc), t('Delta'), t('Theme'));

while ($res = db_fetch_object($result)) {
$rows[] = array($res->module,$res->delta,$res->theme);
}

$output .= theme('table', $header, $rows);
$output .= theme('pager',5,NULL);

print $output;

?>

1 comment: