BrainStream: My own FOAFing in WordPress
Jul. 15th, 2004 03:15 pm![[personal profile]](https://www.dreamwidth.org/img/silk/identity/user.png)
Being extremely jealous of the other guys hacking apart WordPress to make it FOAF-y, I've actually done my own PHP hack. This one required nothing more than making sure the "Profile" field under the WordPress User Profile contained a one-line bio. Or...thereabouts. Then I added the "olb" property from the Bio Vocabulary.
Then I made an edit to Christoph Görn's hack of Morten Frederiksen's foaf-output plugin 1.9, (found in wp-content/plugins when installed) and added the following lines:
After the line
xmlns:dc="http://purl.org/dc/elements/1.1/"
I added:
xmlns:bio="http://purl.org/vocab/bio/0.1/"
and after the line
$rdf .= "\n\t" . '<homepage rdf:resource="' . htmlspecialchars($authordata->user_url) . '"/>';, I added:
if($authordata->user_description)
$rdf .= "\n\n\t" . '<'bio:olb>' . htmlspecialchars($authordata->user_description) . '</bio:olb>' . "\n";
Finally, something I can hack myself. Next step is to try and add a birthdate. Not nearly as easy.
[BrainStream]
(Permanent link to this entry)