<?php
$output = '';
$docnum = $modx->documentIdentifier;
$val= $modx->db->getValue('SELECT `createdby` FROM `modx_site_content` WHERE `id` = '.$docnum.'');
if ($val >= 0){
$rs= $modx->db->getValue('SELECT `name` FROM `modx_user_roles` WHERE `id` = '.$val.'');
}
else {
$val = abs($val);
$rs= $modx->db->getValue('SELECT `fullname` FROM `modx_web_user_attributes` WHERE `internalKey` = '.$val.'');
}
$output .= ''.$rs.'';
return $output;
?>