%[if edit]%Track Title%[endif]%
%[if edit]%Album Title%[endif]%
%[if edit]%Album Artist%[endif]%
%[if %("%id=filtering%" == "true")% ]%
%[endif]%
%[if %("%id=setup_mode%" == "stacks")% ]%
%slice -addTypes="com.stacks4stacks.stacks.playlistertrack"%
%[endif]%
%[if %("%id=setup_mode%" == "podcast")% ]%
%%[[if !edit]]%%
preserveWhiteSpace = false;
$xml = file_get_contents('%id=podcast_link -href%');
$doc->loadXML($xml);
// Initialize XPath
$xpath = new DOMXpath( $doc);
// Register the itunes namespace
$xpath->registerNamespace( 'itunes', 'https://www.itunes.com/dtds/podcast-1.0.dtd');
$items = $doc->getElementsByTagName('item');
foreach( $items as $item) {
$title = $xpath->query( 'title', $item)->item(0)->nodeValue;
$author = $xpath->query( 'itunes:author', $item)->item(0)->nodeValue;
$enclosure = $xpath->query( 'enclosure', $item)->item(0);
$url = $enclosure->attributes->getNamedItem('url')->value;
$summary = $xpath->query( 'itunes:summary', $item)->item(0)->nodeValue;
$keywords = $xpath->query( 'itunes:keywords', $item)->item(0)->nodeValue;
$date = $xpath->query( 'pubDate', $item)->item(0)->nodeValue;
echo '- %[if %("%id=podcast_title_date%" == "true")% ]%'. $date .' - %[endif]%'. $title. ''. $date .', '. $keywords .'
';
}
?>
%%[[endif]]%%
%[endif]%
%[if %("%id=setup_mode%" == "simplewarehouse")% ]%
%%[[if !edit]]%%
'. $trackcleaned . '%id=additional_info%';
}
}
}
?>
%%[[endif]]%%
%[endif]%
%[if %("%id=setup_mode%" == "totalcms")% ]%
%%[[if !edit]]%%
get_depot('%id=totalcms_depot%');
}
$artwork = "%baseURL%cms-data/image/%id=totalcms_image%.jpg";
%%[[endif]]%%
foreach ($dir_contents as $file) {
$file_type = strtolower(end(explode('.', $file)));
$info = explode('.', $file);
strtolower(end($info));
// Generate 'cleaned' audio track titles
$filenameremovehyphens = str_replace("-", " ", $file); // Remove hyphens
$filenameremoveunderscores = str_replace("_", " ", $filenameremovehyphens); // Remove underscores
$filetitle = preg_replace('/\\.[^.\\s]{3,4}$/', '', $filenameremoveunderscores); // Remove file extensions
$trackcleaned = preg_replace('#^\d+#', '', $filetitle); // Remove numbers from the start of a track
if ($file !== '.' && $file !== '..' && in_array($file_type, $file_display) == true) {
echo '-
'. $trackcleaned . '%id=additional_info%
';
}
}
?>
%%[[endif]]%%
%[endif]%
%[if %("%id=setup_mode%" == "advancedwarehouse")% ]%
%%[[if !edit]]%%
The CSV file "' . $handle . '" could not be found. The CSV file might be missing or its path is incorrectly set.';
}
else {
foreach ($csvFile as $line) {
if ($x <= $row_counter && $row_counter <= $y) {
$data = str_getcsv($line, $delimiter);
$tracktitle = $data[0];
$album = $data[1];
$artist = $data[2];
$audiohref = $data[3];
$artwork = $data[4];
$additionalinfo = $data[5];
echo('- ' . $tracktitle . '' . $additionalinfo . '
');
}
$row_counter++;
}
}
?>
%%[[endif]]%%
%[endif]%
%[if %("%id=setup_mode%" == "podcast")% ]%
%%[[if edit]]%%
Podcast Configuration
PlayLister is capable of sourcing audio content from an iTunes Podcast (also sometimes referred to as a netcast) and embedding all the available tracks in your webpage. A user to your website can listen to each episode in their normal web browser or download episodes for listening offline. When new episodes are added to the podcast, these are automatically included in PlayLister, at the top of the playlist. There is no requirement to republish the webpage each time a new podcast episode is broadcasted. Podcasting also ties-in nicely with our basic filtering functionality, so a user can search for a particular episode based on its title, description, date or keywords.
Podcast configuration in PlayLister takes three important parameters; the podcast link (URL of the podcast XML file), a link to the podcast image and the name of the podcast. All three are entered in the stack settings. PlayLister will follow the podcast link to access the necessary podcast data. From here, it will parse the XML and pull-in the relevant data to construct the player interface. PlayLister will typically access the MP3 link, title, author, summary and keywords for each podcast episode.
The extension of this webpage requires changing to .php
in the RapidWeaver Page Inspector. Please login to your web server via FTP to manually delete any older pages at the same location, that may have been published with other extensions.
%%[[endif]]%%
%[endif]%
%[if %("%id=setup_mode%" == "totalcms")% ]%
%%[[if edit]]%%
Total CMS Configuration
In the stack settings, enter the ID for the
Depot CMS and
Image CMS. The Depot CMS is where you store your MP3 files and the Image CMS is where you store the artwork (applied to all tracks). The
Album Title,
Artist Name and
Additional Info will also get shown against all items. Total CMS is developed and supported by Joe Workman, and you can obtain more information about its setup on the website:
cms.joeworkman.net
%%[[endif]]%%
%[endif]%
%[if %("%id=setup_mode%" == "simplewarehouse")% ]%
%%[[if edit]]%%
Simple Warehouse Configuration
In the stack settings, set the path to the MP3 directory on your web server. For security reasons, the MP3 directory
must be on the same web server and domain (e.g. example.com) where you're publishing this page to. Ensure that this webpage has had its file extension changed to .php in the RapidWeaver Page Inspector and that you're publishing to a web server that is running a standard installation of PHP 7.1 or greater. When this page is live, PlayLister will construct a playlist of MP3 files from all those listed in your MP3 directory. Track titles are generated from the MP3 file names (we automatically 'prettify' file names by stripping hyphens, underscores and extensions). Tracks will be displayed in alphabetical or numerical order. All tracks share the same cover artwork, album and artist data, which can be configured in the stack settings.
- On the assumption you wanted to build a playlist from MP3 files stored in a folder named audio (located in the same directory where this page is published) you would need to enter
audio/
for the MP3 directory path.
- On the assumption you wanted to build a playlist from MP3 files stored in a folder named audio (located one level up where this page is published) you would need to enter
../audio/
for the MP3 directory path.
- On the assumption you wanted to build a playlist from MP3 files stored in a folder named audio (located two levels up where this page is published) you would need to enter
../../audio/
for the MP3 directory path.
Directory paths are always relative. This means they do not begin with 'http://' or 'https://'. In other words, we construct the link backwards, using this page as the starting point. Your enter a
../
each time you need to navigate up a level. For ease of setup, greater security and improved performance, the folder containing your MP3 files should be located close-by to where this page is being published.
%%[[endif]]%%
%[endif]%
%[if %("%id=setup_mode%" == "advancedwarehouse")% ]%
%%[[if edit]]%%
Advanced Warehouse Configuration
Create a new spreadsheet in CSV format and upload it to your web server. Each row of the spreadsheet file comprises of information for each track listing, like its name, MP3 link, album, artist and cover artwork. This data needs to be presented in a specific order, as per the sample CSV file shown on the Stacks4Stacks website. Ensure that this webpage has had its file extension changed to .php in the RapidWeaver Page Inspector and that you're publishing to a web server that is running a standard installation of PHP 7.1 or greater. Once this page is live, the playlist will be constructed from CSV data and can be updated remotely at any time.
%%[[endif]]%%
%[endif]%
%id=error_label%
%%[[if !edit]]%%