All pastes #331411 Raw Edit

Untitled

public text v1 · immutable
#331411 ·published 2007-01-28 21:31 UTC
rendered paste body
function agenda_nodeapi(&$node, $op) {
   switch ($op) {
      case 'update index':
         if ($node->type == 'agenda') {
            $text = ''; 
            $q = db_query('SELECT a.title, a.datevenement, a.lieu FROM node n LEFT JOIN agenda a ' .
                          'ON n.nid = a.nid WHERE n.nid = %d', $node->nid);
		if ($r = db_fetch_object($q)) {
		   $text = $r->title . ', ';
		   $text = $r->datevenement . ', ';
		   $text = $r->lieu . ',';
		   $text = $r->body;		   
		}
		return $text;
		}
	}
}

function agenda_node_info() {
 return array('agenda' => array('name' => 'agenda', 
                                      'base' => 'agenda'));
}