View Full Version : Updating links
jcord04
11-30-2010, 01:04 AM
I wondering if anybody can help me please.?
I am putting together a simple page that plays radio shows....
but i would like to be able to upload mp3 files (radio shows) to a certain folder, which would then be scaned by the actual page. The page would then only show the 5 newest shows. :confused:
I am new to this and have no clue where to start, but am keen to learn!!
Please Help!!!
ThankYou!! :) :) :rolleyes:
Beverleyh
11-30-2010, 04:55 AM
Do you mean that you want a media player with auto-populating playlist based on mp3 upload to a certain folder?
Like this? http://www.jemcon.org/upload_gallery.php or http://demo.jemcon.org/videos.php
It shows newest uploads at the top of the list and could be doctored to only 5 items. (whether it plays videos or just music without a 'screen' is totally configurable)
jcord04
11-30-2010, 12:19 PM
Yes this is what i am after! :)
how would i implement this? i'm quite new to this! lol :confused:
Thanks! :)
jcord04
11-30-2010, 01:25 PM
Ok so i've got this so far and it works excatly how i need it;
$n = file_list(getcwd(),".jpg");
if($n) foreach($n as $f) echo "$f<br>";
im now stuck,,, how would i make the results linakable
e.g. the result is;
Hello.jpg <- how can i make this result link to the actual file?
Please Please Please help
Thankyou!!
djr33
11-30-2010, 02:28 PM
Echo it as a link, including the filepath to where the file exists:
echo '<a href="path/to/file/'.$f.'">'.$f.'</a>';
Beverleyh
11-30-2010, 03:03 PM
How come we've gone from mp3s to jpgs?
I was trying to sort you a clean version of the media player with auto-populating playlist but is that even needed anymore?
Either way, my hands are tied at the moment as the snow here is getting quite bad and I've literally just lost the internet - I'm stuck on my BlackBerry for now :(
jcord04
12-01-2010, 09:09 PM
Thanks Djr33 for your reply, it sorted it out!! :)
and sorry Beverleyh, it is still for mp3s and appreciate that you put time into sorting me out the player, i was just trying to make it easier for myself... :o :)
im using this below to scan the folder for txt files which has the tracklistings in. The name of the file is echoed onto the page where it can be clicked to view.. the problem i am having now is that it displays the file extension (.txt) on the page.. and that i cant have gaps in the filename otherwise the GET dosent register the whole name..... Please help!! :):confused: Thanks
<?php
function file_list($d,$x){
foreach(array_reverse(scandir($d),array('.')) as $f)if(is_file($d.'/'.$f)&&(($x)?ereg($x.'$',$f):1))$l[]=$f;
return $l;
$file_list = array_reverse($file_list, true); }
$n = file_list(getcwd(),".txt");
if($n) foreach($n as $f) echo
"<a href=?id=$f class='styleradiolist'>TerminalOne - Episode $f</a><br>";
?>
<?php
$myFile=$_GET['id'];
$fh = fopen($myFile, 'r');
$theData = fread($fh, filesize($myFile));
fclose($fh);
echo $theData;
?>
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.