Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
get the filename/link/description from a given file ID (in php)
i’m building some sort of flashvideoplayer that can handle multiple file IDs. these are stored comma separated in a custom_field entitled ‘video’. in the article form i’m now doing
<txp:php> $video_ids = split(',',$thisarticle[video]); foreach ($video_ids as $video){ ... } </txp:php>
that works but i don’t understand how i can get the name/description/link of the file by its ID. i tried to call file_download_name($video)
but that doesn’t work as it can only be used in file context. could someone point me in the right direction?
ps: i’m aware of the different plugins but i prefer to do this ‘manually’ in this case.
pps: i’m a php n00b :)
Offline
Re: get the filename/link/description from a given file ID (in php)
<txp:php>
foreach (split(',',$thisarticle['video']) as $video)
{
echo file_download(array('id' => $video, 'form' => 'video_form'));
}
</txp:php>
You can then use all the normal file tags inside a form called ‘video_form’ to output name, description, whatever.
Offline
Re: get the filename/link/description from a given file ID (in php)
perfect! thank you!
Offline