Skip to content

Instantly share code, notes, and snippets.

@gavinblair
Created June 25, 2010 21:52
Show Gist options
  • Save gavinblair/453506 to your computer and use it in GitHub Desktop.
Save gavinblair/453506 to your computer and use it in GitHub Desktop.
<?php
/**
* Themed attachments
*/
echo "<ul class='attachments'>";
foreach ($files as $file) {
if ($file->list) {
$type = explode('.', $file->filename);
$type = $type[count($type)-1];
$href = check_url(($file->fid ? file_create_url($file->filepath) : url(file_create_filename($file->filename, file_create_path()))));
$text = check_plain($file->description ? $file->description : $file->filename);
echo "<li class='$type'><a target='_blank' href='$href'>$text</a></li>";
}
}
echo "</ul>";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment