--- modules/linodef_taglists/includes/taglist.load.inc	Wed Feb  3 15:54:41 2010
+++ modules/linodef_taglists/includes/taglist.load.inc	Thu Feb 11 16:27:29 2010
@@ -161,6 +161,49 @@ function _linodef_taglists_getfieldsbyfi
 		}
 		return $output;
 	}
+	// Filefield
+	elseif ($fieldvalues['columns']['fid']) {
+  	$i = 0;
+		$result = db_query('SELECT n.%s as value, n.* FROM {%s} n order by n.%s %s', $fieldvalues['columns']['data']['column'], $fieldvalues['table'], $tl_properties['sort_method'], $tl_properties['sort_sequence']);
+		while ($ergebnis = db_fetch_object($result)) {
+			// Check if field has a value. If not, it doesn't appear.
+			if ($ergebnis->nid && $node = node_load($ergebnis->nid)) {
+				if (node_access('view', $node)) {
+  				// Get some info about the file.
+  				$fidcolumn = $fieldname . '_fid';
+  				$filedata = unserialize($ergebnis->value);
+  	      $filelabel = check_plain($filedata['description']);  	      
+  	      // If no description use filename
+  	      if (!$filedata['description']) {
+    	      $fileresult = db_query('SELECT filename FROM {files} WHERE fid=%d',$ergebnis->$fidcolumn);
+  	        $fileobject = db_fetch_object($fileresult);
+  	        $filelabel = $fileobject->filename;
+	        }
+				  // Set default comment. Use node titles since field content could contain new lines.
+					$comment = _linodef_taglists_setdefaultcomment($tl_properties['comment'], $node->title);
+					// Make compatible with editor's Javascripts (remove newline). If not done with drupal_to_js() in editorbuttons submodules.
+					$ergebnis->value = str_replace(array("\r\n", "\n", "\r"), ' ', $ergebnis->value);
+					// Multiple values: only insert valuenumber if fieldvalue is not first value.
+					if ($ergebnis->delta && $ergebnis->delta > 0) {
+						$output[$i] = array('tag' => '[#' . $ergebnis->nid . ':' . $fieldname . ':' . $ergebnis->delta . $option_string . $comment . ']', 'desc' => $filelabel . ' (' . $node->type. ')');
+					}
+					else {
+						$output[$i] = array('tag' => '[#' . $ergebnis->nid . ':' . $fieldname . $option_string . $comment . ']', 'desc' => $filelabel . ' (' . $node->type . ')');
+					}
+				}
+				else {
+					if (variable_get('linodef_message_level', 'all') != 'critical') {
+						$output[$i] = array('tag' => '', 'desc' => linodef_message(array('error' => array('node' => $ergebnis->nid, 'type' => 'access denied')), NULL, FALSE));
+					}
+				}
+				$i++;
+			}
+		}
+		if (!is_array($output)) {
+			return linodef_message(array('error' => array('field' => $fieldname, 'type' => 'no content')), 'error');
+		}
+		return $output;
+	}
 	elseif ($fieldvalues['columns']['nid']) {
 		return linodef_message(
 			array(
