Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
#1 2006-03-01 04:40:38
- soulbloom
- New Member
- Registered: 2006-01-30
- Posts: 6
<txp:php> help
I was wandering if anybody could tak a look at this code and tell me what’s wrong with it:
< // txp:php>
// setting the directory to search for mp3 files
$dir = “http://www.musicsprings.org/orchestra/mp3/”;
// reading the directory and inserting the mp3 files in the playlist array
$n = 0;
$playlist = array();
$fdir = opendir($dir);
while($i = readdir($fdir)) {
// if a .mp3 string is found, add the file to the array
if (strpos(strtolower($i),”.mp3”) !== false) {
$playlist[$n] = $i;
$n++;
}
}
// close the directory and sort the array
closedir($fdir);
array_multisort($playlist);
< // /txp:php>
with the ‘//’ missing from the txp tags
I keep getting
tag_error <txp:php> -> Warning: opendir(http://www.musicsprings.org/orchestra/mp3/): failed to open dir: not implemented
on the page.
The purpose of this code is for a linked list of files from a specific directory to be displayed on the page.
I am pretty much clueless with PHP, so any help would be awesome.
Blessings,
jeremy
Last edited by soulbloom (2006-03-01 04:43:17)
Offline
#2 2006-03-01 05:22:00
- soulbloom
- New Member
- Registered: 2006-01-30
- Posts: 6
Re: <txp:php> help
never mind… i figured it out. sorry
Offline
Pages: 1