PDA

View Full Version : PHP & ASX?



Moh
23-03-2008, 06:30 PM
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?

Moh
23-03-2008, 07:39 PM
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 :D



<?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 :D

Jme
23-03-2008, 08:12 PM
That's a pretty good idea.
Means it would be possible to update the radio details in a dj panel with a form.

Blob
23-03-2008, 08:15 PM
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 :D



<?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 :D

Why don't you just do this:



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

Moh
23-03-2008, 08:18 PM
Why don't you just do this:



<?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 :D

Independent
24-03-2008, 12:38 AM
Because I didn't think :p

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

Invent
24-03-2008, 12:40 AM
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.

Independent
24-03-2008, 12:44 AM
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 (:

Invent
24-03-2008, 12:52 AM
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.

Independent
24-03-2008, 12:53 AM
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.

Moh
24-03-2008, 01:07 PM
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 this in a new version of powerpanel?

Independent
24-03-2008, 01:09 PM
Is this in a new version of powerpanel?

yeah, I used it briefly from my computer. (xampp!)

Moh
24-03-2008, 01:14 PM
yeah, I used it briefly from my computer. (xampp!)
You used this version or you have a copy of your own?

Independent
24-03-2008, 01:15 PM
You used this version or you have a copy of your own?
Copy of powerpanel / used it before

I'd give you like some sort of preview, but I can't remember how to configure my router to allow connections on port 80.

Moh
24-03-2008, 01:17 PM
Copy of powerpanel / used it before

I'd give you like some sort of preview, but I can't remember how to configure my router to allow connections on port 80.
Took me ages to port foward also :p

Well as long as this code works, im fine.

Its only so if the radio dosn't work they can download it for wmp :p

Independent
24-03-2008, 01:22 PM
Took me ages to port foward also :p

Well as long as this code works, im fine.

Its only so if the radio dosn't work they can download it for wmp :p

:p
ok.

Want to hide these adverts? Register an account for free!