db_query

Custom Image Link in a Drupal View

The following code can be used in a views_customfield php field to create a custom image link. This example also shows how to use the db_query() function with a proper %-modifier.

Custom views image link

Custom File Link in a Drupal View using FID

The following code can be used in a views_customfield php field to create a custom file download link. This example shows how to use the db_query() function with a proper %-modifier. If I recall correctly, at the time I wrote this snippet I was unable to get exactly what I needed using the built-in Views2 fields/settings. This snippet is the result.

Field setup in Views2