By feuman on
Hi,
Is there a RPC for the drupal forum?
I would like to create some kind of Link inside the news aggregator, where a user can click on it to start a forum thread.
If someone has already startet a thread from this News-item, there should be the amount of replies.
Inside the forum, there should be the link to the referenced news-item.
If that does not exist, where should i start reading about enhancing the aggregator/forum module?
Sorry for my poor english, hope you know what i mean...
regards sandro
Comments
it's already available in the blog module
if you install blog and aggreator modules(both), you see you a 'blog it' link near every news item. now you can create another link to add forum topic(in aggregator-item.tpl.php or aggregator.module). for example: http://banglaworld.org/node/add/forum?iid=18934. then you need to add following code in the forum.module (method name function forum_form(&$node, $form_state) ).
$iid = isset($_GET['iid']) ? (int)$_GET['iid'] : 0;
$type = node_get_types('type', $node);
if (empty($node->body)) {
// If the user clicked a "blog it" link, we load the data from the
// database and quote it in the blog.
if ($nid && $blog = node_load($nid)) {
$node->body = ''. $blog->body .' ['. l($blog->name, "node/$nid") .']';
}
if ($iid && $item = db_fetch_object(db_query('SELECT i.*, f.title as ftitle, f.link as flink FROM {aggregator_item} i, {aggregator_feed} f WHERE i.iid = %d AND i.fid = f.fid', $iid))) {
$node->title = $item->title;
// Note: $item->description has been validated on aggregation.
$node->body = 'link) .'">'. check_plain($item->title) .' - '. $item->description .' [flink) .'">'. check_plain($item->ftitle) ."]\n";
}
}