[wp-hackers] topic exchange integration
Luca Lizzeri
luca.lizzeri at gmail.com
Thu Jul 15 16:52:23 UTC 2004
> has anybody picked this up to do something with it? It would be nice if
> it also grabbed any topicexchange channels trackbacked through the
> "category trackback" functionality.
This is a proof of concept plugin that might work (untested, anyone
wants to help ?) that should do the first part of what your are
requesting (tra ckback) using a meta field named ite_topic.
I don't understand how you want to display the trackbacked channels.
<?
function ite_trackback($post_ID) {
$data = get_postdata($post_ID);
// Get the keys and values of the custom fields:
$ite_topics = $post_meta_cache[$post_ID]['ite_topic'];
// Generate the tags
if (count($ite_topics)) {
foreach ($ite_topics as $ite_topic)
$ite_tb_urls[] = "http://topicexchange.com/t/". $ite_topic ;
// Subtract ITE urls already pinged
$pinged = explode("\n", $data['pinged']);
$ite_tb_urls = arraydiff($ite_tb_urls, $pinged);
foreach ($ite_tb_urls as $ite_tb_url)
trackback($ite_tb_url, stripslashes($data['Title']),
$data['Excerpt'], $post_ID);
}
return $post_ID;
}
// Hook into the Plugin API
add_action('publish_post', 'ite_trackback');
?>
--
Luca Lizzeri
http://wikilab.net
More information about the hackers
mailing list