take a look into the droplets and use echo (for a output) instead of return
for example this droplet for the last modified date from this page
global $database, $wb;
$retVal = ' ';
if (PAGE_ID > 0) {
$query = $database->query("SELECT max(modified_when) FROM ".TABLE_PREFIX."pages");
$mod_details = $query->fetchRow();
$retVal = "This site was last modified on ".date("d/m/Y", $mod_details[0])." at ".date("H:i", $mod_details[0]).".";
}
echo $retVal;