A stream of consciousness from the brain of B.K. DeLong

 

« Homestar & TMBG | Main | Update: (In)Security at the DNCC, part deux »

July 15, 2004

My own FOAFing in WordPress

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.


posted by B.K. DeLong at 07/15/04, 02:15 PM -05:00 GMT | TrackBack (2) - (Top of the page)

Comments