/[drupal]/contributions/sandbox/developmentseed/views_rss_extra_maker/views_rss_extra_maker.module
ViewVC logotype

Contents of /contributions/sandbox/developmentseed/views_rss_extra_maker/views_rss_extra_maker.module

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.1 - (show annotations) (download) (as text)
Wed Feb 20 13:32:46 2008 UTC (21 months ago) by developmentseed
Branch: MAIN
CVS Tags: HEAD
File MIME type: text/x-php
added views rss extra maker rough implementation to the repos
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 }

  ViewVC Help
Powered by ViewVC 1.1.2