Discover Habbo's history
Treat yourself with a Secret Santa gift.... of a random Wiki page for you to start exploring Habbo's history!
Happy holidays!
Celebrate with us at Habbox on the hotel, on our Forum and right here!
Join Habbox!
One of us! One of us! Click here to see the roles you could take as part of the Habbox community!


Page 1 of 2 12 LastLast
Results 1 to 10 of 16

Thread: PHP & ASX?

  1. #1
    Join Date
    May 2006
    Location
    Hull
    Posts
    7,701
    Tokens
    2,430
    Habbo
    Moh

    Latest Awards:

    Default PHP & ASX?

    Well on our site, we have linked all the radio features such as stats, request & player to our radio details in our DJ Panel so we dont have to mass edit files.

    So I was woundering, how could I link the asx file to it?

    Will it be the same as PHP GD? How it changes to a gif/png?

  2. #2
    Join Date
    May 2006
    Location
    Hull
    Posts
    7,701
    Tokens
    2,430
    Habbo
    Moh

    Latest Awards:

    Default

    I found out how to do it, and since no one posted, and I cant edit the above post I may as well post :p

    So if your interesed, the code is as followed

    PHP Code:
    <?php
    header
    ("Cache-control: public");
    header("Content-Disposition: filename=player.asx");
    header("Content-Type: audio/scasx;");

    //SQL
    include("config.php");
    $sql mysql_fetch_array(mysql_query("SELECT * FROM `radioinfo`"));
    $ip = ("{$sql["ip"]}");
    $port = ("{$sql["port"]}");
    $url "http://$ip:$port";
    //End SQL

    echo ("<ASX version = \"3.0\">\n");
    echo (
    "<Entry>\n");
    echo (
    "<title>Tuned into HabbCrazy.net</title>");
    echo (
    "<AUTHOR>HabbCrazy</AUTHOR>");
    echo (
    "<COPYRIGHT>Copyright © 2007-2008 HabbCrazy</COPYRIGHT>");
    echo (
    "<Ref href = \"$url\" />");
    echo (
    "<BANNER HREF=\"\">");
    echo (
    "<ABSTRACT>Click here to visit HabbCrazy!</ABSTRACT>");
    echo (
    "<MOREINFO HREF=\"http://www.habbcrazy.net\" />");
    echo (
    "</BANNER>");
    echo (
    "</Entry>");
    echo (
    "</ASX>");
    ?>
    So just save that as asx.php and when you visit it, it should ask if you want to download player.asx

  3. #3

    Default

    That's a pretty good idea.
    Means it would be possible to update the radio details in a dj panel with a form.

  4. #4
    Join Date
    Dec 2006
    Location
    Swindon
    Posts
    3,299
    Tokens
    215
    Habbo
    dunko

    Latest Awards:

    Default

    Quote Originally Posted by .:Jack120:. View Post
    I found out how to do it, and since no one posted, and I cant edit the above post I may as well post :p

    So if your interesed, the code is as followed

    PHP Code:
    <?php
    header
    ("Cache-control: public");
    header("Content-Disposition: filename=player.asx");
    header("Content-Type: audio/scasx;");

    //SQL
    include("config.php");
    $sql mysql_fetch_array(mysql_query("SELECT * FROM `radioinfo`"));
    $ip = ("{$sql["ip"]}");
    $port = ("{$sql["port"]}");
    $url "http://$ip:$port";
    //End SQL

    echo ("<ASX version = \"3.0\">\n");
    echo (
    "<Entry>\n");
    echo (
    "<title>Tuned into HabbCrazy.net</title>");
    echo (
    "<AUTHOR>HabbCrazy</AUTHOR>");
    echo (
    "<COPYRIGHT>Copyright © 2007-2008 HabbCrazy</COPYRIGHT>");
    echo (
    "<Ref href = \"$url\" />");
    echo (
    "<BANNER HREF=\"\">");
    echo (
    "<ABSTRACT>Click here to visit HabbCrazy!</ABSTRACT>");
    echo (
    "<MOREINFO HREF=\"http://www.habbcrazy.net\" />");
    echo (
    "</BANNER>");
    echo (
    "</Entry>");
    echo (
    "</ASX>");
    ?>
    So just save that as asx.php and when you visit it, it should ask if you want to download player.asx
    Why don't you just do this:

    PHP Code:
    <?php
    header
    ("Cache-control: public");
    header("Content-Disposition: filename=player.asx");
    header("Content-Type: audio/scasx;");

    //SQL
    include("config.php");
    $sql mysql_fetch_array(mysql_query("SELECT * FROM `radioinfo`"));
    $ip = ("{$sql["ip"]}");
    $port = ("{$sql["port"]}");
    $url "http://$ip:$port";
    //End SQL
    ?>
    <ASX version = "3.0">
    <Entry>
    <title>Tuned into HabbCrazy.net</title>
    <AUTHOR>HabbCrazy</AUTHOR>
    <COPYRIGHT>Copyright © 2007-2008 HabbCrazy</COPYRIGHT>
    <Ref href = "<?=$url?>" />
    <BANNER HREF="">
    <ABSTRACT>Click here to visit HabbCrazy!</ABSTRACT>
    <MOREINFO HREF="http://www.habbcrazy.net" />
    </BANNER>
    </Entry>
    </ASX>

  5. #5
    Join Date
    May 2006
    Location
    Hull
    Posts
    7,701
    Tokens
    2,430
    Habbo
    Moh

    Latest Awards:

    Default

    Quote Originally Posted by Blob View Post
    Why don't you just do this:

    PHP Code:
    <?php
    header
    ("Cache-control: public");
    header("Content-Disposition: filename=player.asx");
    header("Content-Type: audio/scasx;");

    //SQL
    include("config.php");
    $sql mysql_fetch_array(mysql_query("SELECT * FROM `radioinfo`"));
    $ip = ("{$sql["ip"]}");
    $port = ("{$sql["port"]}");
    $url "http://$ip:$port";
    //End SQL
    ?>
    <ASX version = "3.0">
    <Entry>
    <title>Tuned into HabbCrazy.net</title>
    <AUTHOR>HabbCrazy</AUTHOR>
    <COPYRIGHT>Copyright © 2007-2008 HabbCrazy</COPYRIGHT>
    <Ref href = "<?=$url?>" />
    <BANNER HREF="">
    <ABSTRACT>Click here to visit HabbCrazy!</ABSTRACT>
    <MOREINFO HREF="http://www.habbcrazy.net" />
    </BANNER>
    </Entry>
    </ASX>
    Because I didn't think :p

    But as long as it works, im fine with it

  6. #6
    Join Date
    Dec 2007
    Posts
    1,683
    Tokens
    0

    Latest Awards:

    Default

    Quote Originally Posted by .:Jack120:. View Post
    Because I didn't think :p

    But as long as it works, im fine with it
    Great idea, if I ever own a radio station again I'll do that

  7. #7
    Join Date
    May 2005
    Location
    San Francisco, CA
    Posts
    7,160
    Tokens
    2,331

    Latest Awards:

    Default

    To be honest, I think it would just be a lot better to just make your DJ Panel create a new/overwrite the existing ASX file with the new radio information (like in powerpanel) as it will decrease the amount of SQL queries performed on your site by quite a lot.

  8. #8
    Join Date
    Dec 2007
    Posts
    1,683
    Tokens
    0

    Latest Awards:

    Default

    Quote Originally Posted by Invent View Post
    To be honest, I think it would just be a lot better to just make your DJ Panel create a new/overwrite the existing ASX file with the new radio information (like in powerpanel) as it will decrease the amount of SQL queries performed on your site by quite a lot.
    Is it really worth the hastle? When you can just simply use that above

  9. #9
    Join Date
    May 2005
    Location
    San Francisco, CA
    Posts
    7,160
    Tokens
    2,331

    Latest Awards:

    Default

    Is it really worth the hastle? When you can just simply use that above
    Well seeing as a free panel already has the required code and that it also makes your radio load quicker, I would say it's worth the "hassle", yeah.

  10. #10
    Join Date
    Dec 2007
    Posts
    1,683
    Tokens
    0

    Latest Awards:

    Default

    Quote Originally Posted by Invent View Post
    Well seeing as a free panel already has the required code and that it also makes your radio load quicker, I would say it's worth the "hassle", yeah.
    Fair enough.

Page 1 of 2 12 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
  •