Database list display cleanup

Rather than laboriously jumping in and out of PHP mode using <?php .. ?>
markers all over the place, concatenate text to a variable and print it
in one shot at the end. This enables us to avoid printing a node
entirely if it has no actual content, after expired / unpublished /
other conditions prevent databases from being added to the list.

This also makes it easier to read what the heck we're doing to generate
list item entries.

Also, add a closing UL tag to match the opening UL tag.

Signed-off-by: Dan Scott <dscott@laurentian.ca>