[+Author+] le [+Date+]" */ // #### Parameters // format for the Date if(!isset($dateFormat)) { $dateFormat="%Y/%m/%d %H:%M"; } // Date field to use (ex: createon, editeon, pub_date, etc...) if(!isset($usedDate)) { $usedDate='editedon'; } // Template for the output. Use [+Date+] and [+Author+] in the parameter string if(!isset($tpl)){ $tpl = "編集者 [+Author+] [+Date+]"; } // ### Code $Author = ""; $docInfo = $modx->getDocument($modx->documentIdentifier); // *** AUTHOR,Time*** $authorid = $docInfo['editedby']; // Ensure proper charset is used if ($modx->config['etomite_charset']=='UTF-8') { $editedon = utf8_encode(strftime($dateFormat, $docInfo[$usedDate])); } else { $editedon = strftime($dateFormat, $docInfo[$usedDate]); } $tbl = $modx->getFullTableName('user_attributes'); $query = "SELECT fullname FROM $tbl WHERE $tbl.id = $authorid"; $rs = $modx->dbQuery($query); $limit = $modx->recordCount($rs); if($limit==1) { $resourceauthor = $etomite->fetchRow($rs); $authorname = $resourceauthor['fullname']; } if (!$authorname == ""){ $output = str_replace("[+Author+]",$authorname,$tpl); $output = str_replace("[+Date+]",$editedon,$output); } // *** RETURN RESULTS *** return $output; ?>