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”.
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(##); ?>
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'); ?>
If you need to retitle a field in another table, use the same name that the plugin gives that field. This will usually be some variation of "table fieldname".
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).
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).
Return To Referer
Sometimes you have several pages all going to a central focus page, and you want the return to list link to go back to the page that referred them there, not to a central focus page.
<? $db->returnToReferer(); ?>
The plugin will grab the HTTP_REFERER and use that as the “return to” link.