Jump to content

dkhillman

New Members
  • Posts

    4
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

dkhillman's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Ok, got it working except for one bug. It matches all files correctly, but shows a: <a class='myPlayer' href='audio/_hcc_thumbs' style='background-image:url(images/_hcc_thumbs)'> Not seeing that in my directory so not sure how to get rid of it. Also is there a way I can reverse the sort? Thanks so much
  2. I tried your code and it does not print anything in the index.php. Not sure what is going on. I will try and troubleshoot it tomorrow
  3. Guess I am not sure what goes where. The script I currently have was an example I found and modified it to my needs. Guess what confuses me is the array_push for both files. Also was trying to avoid changing the code every time a file is updates which I am assuming I would have to add the audio name and the image name in the array code each time. Right now here is what the script generates: <a class='myPlayer' href='Audio/DannyDuvall032512.mp3' style='background-image:url(images/logo.jpg)'> <img src = '../images/play_small.png' /> </a> <a class='myPlayer' href='Audio/DannyDuvall040112.mp3' style='background-image:url(images/logo.jpg)'> <img src = '../images/play_small.png' /> </a> There are probably 30 audio files with 3-4 new ones every week. Just want to match the Audio/DannyDuvall040112.mp3 with the url(images/DannyDuvall040112.jpg)
  4. I have a media page that I want to automatically update with the audio and corresponding picture. The audio file will be in folder "audio" named "song1.mp3". The picture will be in folder "images" named "song1.jpg". I have figured out the code to automatically update the audio files with a default image, but I want to add the image to the corresponding audio file. Here is my current code: <?php $dir=opendir("Audio"); $files=array(); while (($file=readdir($dir)) !== false) { if ($file != "." and $file != ".." and $file != "test.php") { array_push($files, $file); } } closedir($dir); sort($files); foreach ($files as $file) print "<a class='myPlayer' href='Audio/$file' style='background-image:url(images/logo.jpg)'> </a> "; ?> So I would want my 'Audio/$file' = to my 'Images/$file' with the same name. Any help would be appreciated. Thanks,
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.