I'm trying to set up a flash player to use with news items that have audio file enclosures on them. Up until this point, it has been working fine, but something must have changed with the most recent update of TYPOlight.
Here's the code I'm using in the template to output my player:
Code:
<?php if ($this->enclosure): ?>
<div class="enclosure">
<?php foreach ($this->enclosure as $enclosure): ?>
<div>
<span id="audioplayer_1">You must have flash installed to play audio files within your browser.</span>
<script type="text/javascript">
AudioPlayer.embed("audioplayer_1", {soundFile: "<?php echo $enclosure['href']; ?>"});
</script>
</div>
<?php endforeach; ?>
</div>
<?php endif; ?>
This should work, but I think the problem is the output of this line:
Code:
<?php echo $enclosure['href']; ?>
Because it outputs this text:
posts/items/postTitle.html?file=tl_files/audiofiles/2010/song.mp3
Basically, I only want what comes after "posts/items/postTitle.html?file=" but I can't get it to output that.
I've tried this line:
Code:
<?php echo $enclosure['link']; ?>
But it outputs the file name itself ("song.mp3"). And since we are uploading the audio files into yearly folders, I can't just manually type in the folder path.
Is there another tag I could use that would output the file's actual location on the server? Like this: "tl_files/audiofiles/2010/song.mp3"
Please help! Until I get this figured out, my client's blog is really messed up!
Bookmarks