[development] Modify Views CSV Export

Marolijo - Pol maresma marolijo at yahoo.es
Thu Mar 13 09:03:23 UTC 2008


I found how to modify tha theming of the field, but can't return the info
needed. I wanna return the Filepath of the imagefield, any idea?
This solution I found doesn't return anything....

function
phptemplate_views_handle_field_exportcsv_node_data_field_foto1_field_foto1_f
id($fields, $field, $data){
  $q = db_query('SELECT filepath FROM {files} WHERE fid =
%d',$data->$field['queryname']);
  return db_result($q);  
}

Thank's!!!


________________________________

	De: development-bounces at drupal.org
[mailto:development-bounces at drupal.org] En nombre de Marolijo - Pol maresma
	Enviado el: dimecres, 12 / març / 2008 15:19
	Para: development at drupal.org
	Asunto: [development] Modify Views CSV Export
	
	

	Hello, I need to modify this function to allow it to export
imagefield as a full path, not full <img src=
> tag. 
	How can I filter the imagefield fields to do something like 
	If (fieldtype=imagefield){ 
	        $value = $field ['filepath'] 
	}else{ 
	        ... 
	} 

	Thank's!!! 

	//////////////////////////////////// 

	  foreach ($nodes as $node) { 
	    $values = array(); 
	    foreach ($view->field as $field) { 
	        if ($fields[$field['id']]['visible'] !== false) { 
	        $value = views_theme_field('views_handle_field',
$field['queryname'], $fields, $field, $node, $view);        
	            $value = preg_replace('/<\/?(a|span|li|ul|div) ?.*?>/',
'', $value); // strip 'a' and 'span' tags                           

	        $value = str_replace(array("\r", "\n", ','), ' ', $value);
// strip line breaks and commas 
	        $value = str_replace('"', '""', $value); // escape "
characters 
	        $value = decode_entities($value); 
	        $values[] = '"' . $value . '"'; 

	      }      
	    } 
	    $output .= implode(',', $values) . "\r\n"; 
	  } 


	Pol Maresma / pol at polnetwork.com <mailto:pol at polnetwork.com>   
	PolNetwork.com / Serveis d'Internet 
	msn: marolijo 



	__________ Información de NOD32, revisión 2940 (20080312) __________
	
	Este mensaje ha sido analizado con NOD32 antivirus system
	http://www.nod32.com
	





More information about the development mailing list