help with a basic install?
hello.
i am trying to figure out how do do a basic install. like the basic page player. but using the movie star version so i can play aac files.
how would i install so sm2 sees subfolders (there will be a lot) and the player automatically
sees the aac/mp3 files within?
this is so i can add a bunch of aac/mp3 files every week of our band rehersals and not have
to type the relative url for every song.
just a drag and drop method to server and refresh sm2 page?
i am not so adept at using code/scripting language. but i can put files on my server and create
basic html pages.
thanks for any replies!
i am trying to figure out how do do a basic install. like the basic page player. but using the movie star version so i can play aac files.
how would i install so sm2 sees subfolders (there will be a lot) and the player automatically
sees the aac/mp3 files within?
this is so i can add a bunch of aac/mp3 files every week of our band rehersals and not have
to type the relative url for every song.
just a drag and drop method to server and refresh sm2 page?
i am not so adept at using code/scripting language. but i can put files on my server and create
basic html pages.
thanks for any replies!
1
person has this question
I have this question, too!
Tell me when someone answers.
The more people who ask this question, the more it gets noticed.
The more people who ask this question, the more it gets noticed.
The company marked this question as answered.
The best answers from the company
-
Ah yes, you're on the right path. Next steps would be to change the references to the JS and CSS files to load from an "absolute" path eg., <link rel="stylesheet" href="/path/to/page-player.css" /> and so on. Same for the JS, and then within the JS and CSS, change paths to point to /path/to/images/pause.gif or whatever as needed if you see missing images.
For the PHP, I would use an include with an absolute path so you don't have to copy the actual directory code to every new directory you have MP3s in.
eg. index.php in each directory is just: <? php include('/path/to/library.php'); ?> (this may not be the exact syntax, but I think it's along those lines.)
.. And then library.php (or whatever you want to name it) is your original file from earlier in this discussion which has the HTML + CSS references + PHP that scans the current directory, etc.
The company says
this answers the question
-
You will need PHP or something similar on your server to be able to have it read directories, find MP3 files and spit out a list. There are lots of examples of that out there - I use a bit of PHP like this, which I made for the inline and Muxtape-style demos:
<?php
// print out MP3s in a given directory
// format:
// <li><a href="/my/music/20060411 - Code 3825.mp3">Code 3825</a></li>
function listMP3s($path) {
$dir = $_SERVER['DOCUMENT_ROOT'].$path;
$dirlength = strlen($dir);
$dh = opendir($dir);
while (false !== ($filename = readdir($dh))) {
// print "filename: $filename<br />";
if (stristr($filename,'.mp3')) $files[] = $path."/".basename($filename);
if ($filename != "." && $filename != ".." && is_dir($dir."/".$filename)) listMP3s($path."/".$filename); // recurse through subdirectories
// print ("is dir: ".(($filename != "." && $filename != ".." && is_dir($dir."/".$filename))?"Yes":"No")."<br />");
}
rsort($files);
for ($i=0; $i<sizeof($files); $i++) {
print " <li><a href=\"".dirname($files[$i])."/".rawurlencode(basename($files[$i]))."\">".basename($files[$i])."</a></li>\n";
}
}
listMP3s('/my/music');
?>
Disclaimer: This may not be perfect/secure, use at your own risk etc.
The company says
this answers the question
Create a customer community for your own organization
Plans starting at $19/month
-
Inappropriate?You will need PHP or something similar on your server to be able to have it read directories, find MP3 files and spit out a list. There are lots of examples of that out there - I use a bit of PHP like this, which I made for the inline and Muxtape-style demos:
<?php
// print out MP3s in a given directory
// format:
// <li><a href="/my/music/20060411 - Code 3825.mp3">Code 3825</a></li>
function listMP3s($path) {
$dir = $_SERVER['DOCUMENT_ROOT'].$path;
$dirlength = strlen($dir);
$dh = opendir($dir);
while (false !== ($filename = readdir($dh))) {
// print "filename: $filename<br />";
if (stristr($filename,'.mp3')) $files[] = $path."/".basename($filename);
if ($filename != "." && $filename != ".." && is_dir($dir."/".$filename)) listMP3s($path."/".$filename); // recurse through subdirectories
// print ("is dir: ".(($filename != "." && $filename != ".." && is_dir($dir."/".$filename))?"Yes":"No")."<br />");
}
rsort($files);
for ($i=0; $i<sizeof($files); $i++) {
print " <li><a href=\"".dirname($files[$i])."/".rawurlencode(basename($files[$i]))."\">".basename($files[$i])."</a></li>\n";
}
}
listMP3s('/my/music');
?>
Disclaimer: This may not be perfect/secure, use at your own risk etc.
The company says
this answers the question
-
hello. thanks for the reply.
i have successfully managed to get the page-player working on my site.
i copied and modifed the code from your orig, html.
regarding the above script:
where do i put this script? i assume i would modify the href="/my/music/20060411 to my actual path. are there any other places in this script that need modification.
finally... would i always use the _mp3 directory? or could i create my own directories? how would the page html update this change?
confused but closer to my goal... thanks -
That code would be something like index.php, and then you would have it look for MP3s in the path under /my/music or wherever your files are. However, you will need to have PHP installed and working on your web host for this to work, which is something I cannot help with. -
Inappropriate?hello again. and thanks for your help! i have got your script to work in a test directory. php is working fine. although it just shows the list of files:
•music1.mp3
•music2.mp3, etc.
there is no reference to the page player style. i assume i would have to include the js and swf in this directory and also have a .html page for every directory because the player references the css based onthe page player style?
if this is the case, i guess i am out of luck because to include all these files in every directory every time i add directories/files would be cumbersome.
the basic concept would be a page of directories (30+) that have aac/mp3 files inside. on click, they would show files in the page player style. the goal would be to have the main page auto-update as i add new directories. etc..
thanks again for you time in this matter. if anyone else has suggestions, they'd be appreciated.
I’m perplexed
-
Inappropriate?You will need to use the page player demo (index.html, the relevant JS/CSS etc.) as a base, and then add in the PHP bit which writes out the links to the MP3 files.
Instead of index.html it becomes index.php (so the server will run the <?php ... ?> bits..), and you can then replace the demo link section with the PHP bits from above - just make sure you follow the same pattern of UL and LI elements, etc.
The server will then run that bit of PHP each time the page loads and you'll get the HTML to the MP3s based on what's on the filesystem.
You could use absolute paths for the JS and CSS files, but even then you will need some sort of index.php file which "includes" your PHP file that goes through the current directory, etc.
You're on the right path, just need some more time/tinkering to get where you want.
-
Inappropriate?hey scott... thanks for your reply again!
i got it working!! sort of...
i copied over the relevant js/css and made a index.php based on the demo html. i even changed your php to recognize m4a as well!
the page loads fine if i change the path to the css to the actual directory it is in, but if i want it to load from the root css folder, the page does not display correctly. it just looks like standard html? but sm2 still works correct.
i am close. if i could just standardize the index.php some way, then i could just copy this into each new directory and i'd be set.
it's not that big of deal to change the location each time, but would be great to not have to.
how would i change the code to recognize absolute paths?
i am a total noob btw - and am loving learning and getting this all to work!
I’m coming down the stretch!
-
Inappropriate?Ah yes, you're on the right path. Next steps would be to change the references to the JS and CSS files to load from an "absolute" path eg., <link rel="stylesheet" href="/path/to/page-player.css" /> and so on. Same for the JS, and then within the JS and CSS, change paths to point to /path/to/images/pause.gif or whatever as needed if you see missing images.
For the PHP, I would use an include with an absolute path so you don't have to copy the actual directory code to every new directory you have MP3s in.
eg. index.php in each directory is just: <? php include('/path/to/library.php'); ?> (this may not be the exact syntax, but I think it's along those lines.)
.. And then library.php (or whatever you want to name it) is your original file from earlier in this discussion which has the HTML + CSS references + PHP that scans the current directory, etc.
The company says
this answers the question
Loading Profile...



EMPLOYEE