| 1 |
<?php
|
| 2 |
/**
|
| 3 |
* Implementation of hook_nodeapi
|
| 4 |
*
|
| 5 |
* @abstract Find the fields on the node and put then on the node as extra elements.
|
| 6 |
*
|
| 7 |
* @todo Restrict to certain field-types
|
| 8 |
* Attribute handling
|
| 9 |
* Abstract to arbitrary XML maker based on views field labels and values.
|
| 10 |
*
|
| 11 |
*/
|
| 12 |
|
| 13 |
function views_rss_extra_maker_nodeapi(&$node, $op) {
|
| 14 |
switch ($op) {
|
| 15 |
case 'rss item':
|
| 16 |
$fields = array();
|
| 17 |
$query = db_query("SELECT field_name, label FROM {node_field_instance} WHERE type_name = '%s'", $node->type);
|
| 18 |
while ($result = db_fetch_object($query)) {
|
| 19 |
$field = $result->field_name;
|
| 20 |
$fieldarray = $node->$field;
|
| 21 |
|
| 22 |
$output[] = array(
|
| 23 |
'key' => $result->label,
|
| 24 |
'value' => $fieldarray[0]['value'],
|
| 25 |
);
|
| 26 |
}
|
| 27 |
return $output;
|
| 28 |
break;
|
| 29 |
}
|
| 30 |
}
|