[themes] tpl.php file question

barb barb at karasssuite.net
Wed Apr 8 18:56:10 UTC 2009


hello!
maybe someone can help me with a tpl.php file bringing out converted
audios. i am no php or programmer or anything, but know a few things -
so much to find myself round at least.

so i am running this script to convert audios (mp3 to ogg, wav to mp3
etc..) and want to print them out through node-audio.tpl.php.
i can see the frame and where the files should be shown, but everything
is there, except the files. you can see it here:

http://okno.be/vodnik-frog

i am using drupal6 with mysql and the audio module. this is my code in
node-audio.tpl.php:

   $convertpath =
'/var/www/okno.be/public/sites/default/files/audio_converted/';
   $file = $node->audio;
   $filepath = $file->filepath;
   $type = explode(".", basename($filepath));
   if (file_exists($filepath)) {
   $output .= l($type['1'], $filepath) . ' : ';
        }
   $type = 'mp3';
   $filepath = $convertpath . $file->filename . '.' . $type;
   $downloadpath = 'sites/default/files/audio_converted/' .
$file->filename . '.' . $type;
   if (file_exists($filepath)) {
   $output .= l($type, $downloadpath) . ' : ';
                        }
   $type = 'ogg';
   $filepath = $convertpath . $file->filename . '.' . $type;
   $downloadpath = 'sites/default/files/audio_converted/' .
$file->filename . '.'. $type;
   if (file_exists($filepath)) {
   $output .= l($type, $downloadpath);
   }
   $output = theme('fieldset', array('#title' => 'Download:',
'#children' => $output));
   print $output;


i would appreciate any hint or help!
b#


More information about the themes mailing list