Page 3 of 6 FirstFirst 123456 LastLast
Results 21 to 30 of 53
  1. #21
    Join Date
    Dec 2004
    Location
    Essex, UK
    Posts
    3,285
    Tokens
    0

    Latest Awards:

    Default

    Quote Originally Posted by Th0m4s View Post
    Then you could echo is out using

    PHP Code:
    echo $song_data_exploded[0]; 
    I would have said it, but I would have thought he could have worked it out



    i used to be NintendoNews. visit my blog or add me on twitter.
    need help with vista? i am a microsoft certified technology specialist in configuring windows vista and connected home integrator.. pm me for help!


    "I am the way, the truth, and the life. No one comes to the Father except through me"
    John 14:6 (NIV)


  2. #22
    Join Date
    Jan 2007
    Location
    West Yorkshire
    Posts
    384
    Tokens
    0

    Default

    Yeah i just said it for no reason...

    Or maybe to help other people who want to do this? Maybe

    “two players, two sides.
    one is light, one is dark.”
    - John Locke

  3. #23
    Join Date
    Apr 2005
    Location
    North Carolina, USA
    Posts
    4,535
    Tokens
    0

    Latest Awards:

    Default

    Thanks you two +REP

    Im leaning alot more about exploding things this way and more ways I can use it in my programs.

    Kevin

  4. #24
    Join Date
    Jan 2007
    Location
    West Yorkshire
    Posts
    384
    Tokens
    0

    Default

    Yeah I only learnt about properly using explode when coding habbo imager stuff. I understand it alot now.

    “two players, two sides.
    one is light, one is dark.”
    - John Locke

  5. #25
    Join Date
    Apr 2005
    Location
    North Carolina, USA
    Posts
    4,535
    Tokens
    0

    Latest Awards:

    Default

    Im starting to learn how to search through divs etc thanks to you thomas

    I learned GD through the imager things too.. and now im pretty dang good at it

  6. #26
    Join Date
    Dec 2004
    Location
    Essex, UK
    Posts
    3,285
    Tokens
    0

    Latest Awards:

    Default

    I've made it easier now, this function is for anyone who needs it. To use it just save it as albumart.php and then put the following into your page:

    PHP Code:
    <?php
    include("albumart.php");
    getAlbumArt($current_playing_song);
    ?>
    By the way, it explodes it for you, so just put it directly from your shoutcast stats script. Here is albumart.php:

    PHP Code:
    <?php
    function getAlbumArt($now_playing) {
        
    $artist_name explode(" - "$now_playing);
        
    $artist_name str_replace(" ""+"$artist_name);

        
    $url_to_query "http://www.last.fm/music/" $artist_name "/";
        
    $query file_get_contents($url_to_query);

        
    $album_art_start explode('<div class="imgHolder">'$query);
        
    $album_art_end explode('</div>'$album_art_start[1]);
        
    $album_art_html trim($album_art_end[0]);

        
    $image_url_start explode('<img src="'$album_art_html);
        
    $image_url_end explode('" alt'$image_url_start[1]);
        
    $image_url trim($image_url_end[0]);

        echo 
    '<img src="' $image_url '" alt="' $artist_name '">';
        
    }
    ?>
    Last edited by timROGERS; 16-02-2007 at 05:25 PM.



    i used to be NintendoNews. visit my blog or add me on twitter.
    need help with vista? i am a microsoft certified technology specialist in configuring windows vista and connected home integrator.. pm me for help!


    "I am the way, the truth, and the life. No one comes to the Father except through me"
    John 14:6 (NIV)


  7. #27
    Join Date
    Jan 2007
    Location
    West Yorkshire
    Posts
    384
    Tokens
    0

    Default

    Nice little script +rep (dunno if my power will affect it)

    “two players, two sides.
    one is light, one is dark.”
    - John Locke

  8. #28
    Join Date
    Apr 2005
    Location
    North Carolina, USA
    Posts
    4,535
    Tokens
    0

    Latest Awards:

    Default

    Nice script. I cant +rep again but I will soon

    Your better at functions and classes then I am

  9. #29
    Join Date
    Jan 2007
    Location
    West Yorkshire
    Posts
    384
    Tokens
    0

    Default

    But if they dont want it to echo it out you could edit it to:

    PHP Code:
    <?php
    function getAlbumArt($now_playing) {
        
    $artist_name explode(" - "$now_playing);
        
    $artist_name str_replace(" ""+"$artist_name);

        
    $url_to_query "http://www.last.fm/music/" $artist_name "/";
        
    $query file_get_contents($url_to_query);

        
    $album_art_start explode('<div class="imgHolder">'$query);
        
    $album_art_end explode('</div>'$album_art_start[1]);
        
    $album_art_html trim($album_art_end[0]);

        
    $image_url_start explode('<img src="'$album_art_html);
        
    $image_url_end explode('" alt'$image_url_start[1]);
        
    $image_url trim($image_url_end[0]);

        return 
    $image_url;
        
    }
    ?>
    Then you would put

    PHP Code:
    <?php
    include('albumart.php');
    $album getAlbumArt("Artist Name - Song Name");
    //Then you could echo it out whenever you wanted
    echo '<img src="'.$album.'">';
    //Or you could use it with GD etc
    ?>

    “two players, two sides.
    one is light, one is dark.”
    - John Locke

  10. #30
    Join Date
    Dec 2004
    Location
    Essex, UK
    Posts
    3,285
    Tokens
    0

    Latest Awards:

    Default

    Nice implementation Thomas



    i used to be NintendoNews. visit my blog or add me on twitter.
    need help with vista? i am a microsoft certified technology specialist in configuring windows vista and connected home integrator.. pm me for help!


    "I am the way, the truth, and the life. No one comes to the Father except through me"
    John 14:6 (NIV)


Page 3 of 6 FirstFirst 123456 LastLast

Posting Permissions

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