Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

  1. Index
  2. » Archives
  3. » <txp:php> help

#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);

echo “ <a href=\”$dir$playlist[$i]\” /> “.str_replace(“.mp3”,”“,$playlist[$i]).” <a />\n”;

< // /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

  1. Index
  2. » Archives
  3. » <txp:php> help

Board footer

Powered by FluxBB