Display Options
Date formats
By default, the system has a built-in format for unixtime types, and simply displays exactly what the database returns for built-in date and time types. If you want to specify a format, however, you can. The format must be specified PHP style. For example:
<? $db->setFieldFormat('fieldname', 'l, F jS, Y'); ?>
This will specify a format of “Weekday, Month day, Year”, as in “Monday, February 26th, 2007”.
Headlines
Sometimes you’ll want your lists broken up into sections based on one of the columns you’ve selected.
<? $db->headline('fieldname'); ?>
This will automatically add a headline whenever that field changes, if the primary sort is by that field. It is up to you to sort in a manner that makes the headlines matter, as well as to ensure that the columns are selected.
It will be a level two headline.
Rows per page
By default, the plug-in will only show 50 rows at a time. You can change this with:
<? $db->limit(##); ?>
Column titles
The easiest way to get a good title from your field names is to give your fields good names. The plug-in will automatically convert underscores to spaces; it will also automatically capitalize the first letter in each word of your field name. If you need to specify a completely different title for a field, however, you can use:
<? $db->setFieldTitle(fieldname, 'New Title'); ?>
Hiding search boxes
If you don’t want search boxes at the top of each set of rows, turn them off with “noSearch”:
<? $db->noSearch(); ?>
If you need to turn searches back on, use noSearch(false).
Hiding headers
If you don’t want a header row at the top of each set of rows, turn them off with “noHeaders”:
<? $db->noHeaders(); ?>
If you need to turn headers back on, use noHeaders(false).
