Results 1 to 7 of 7

Thread: Updating links

  1. #1
    Join Date
    Aug 2010
    Posts
    8
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Default Updating links

    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.

    I am new to this and have no clue where to start, but am keen to learn!!

    Please Help!!!

    ThankYou!!

  2. #2
    Join Date
    Jul 2008
    Location
    Derbyshire, UK
    Posts
    3,030
    Thanks
    25
    Thanked 599 Times in 575 Posts
    Blog Entries
    40

    Default

    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)
    Focus on Function Web Design
    Fast Edit (A flat file, PHP web page editor & CMS. Small, FREE, no database!) | Fast Edit BE (Snippet Manager) (Web content editor for multiple editable regions!) | Fast Apps

  3. #3
    Join Date
    Aug 2010
    Posts
    8
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Default Updating Links

    Yes this is what i am after!

    how would i implement this? i'm quite new to this! lol

    Thanks!

  4. #4
    Join Date
    Aug 2010
    Posts
    8
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Default

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

  5. #5
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,156
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    Echo it as a link, including the filepath to where the file exists:
    echo '<a href="path/to/file/'.$f.'">'.$f.'</a>';
    Daniel - Freelance Web Design | <?php?> | <html>| espa˝ol | Deutsch | italiano | portuguŕs | catalÓ | un peu de franšais | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  6. The Following User Says Thank You to djr33 For This Useful Post:

    jcord04 (12-01-2010)

  7. #6
    Join Date
    Jul 2008
    Location
    Derbyshire, UK
    Posts
    3,030
    Thanks
    25
    Thanked 599 Times in 575 Posts
    Blog Entries
    40

    Default

    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
    Focus on Function Web Design
    Fast Edit (A flat file, PHP web page editor & CMS. Small, FREE, no database!) | Fast Edit BE (Snippet Manager) (Web content editor for multiple editable regions!) | Fast Apps

  8. The Following User Says Thank You to Beverleyh For This Useful Post:

    jcord04 (12-01-2010)

  9. #7
    Join Date
    Aug 2010
    Posts
    8
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Default

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

    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!! 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;
    ?>

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •