cilwang
04-27-2007, 12:53 PM
Hi everyone, I'm Cyril and new to this forum but not to pixelpost since I've been using this wonderful app for 2 years now with infinite pleasure ! than you to all you guys who made my "dream photobloggin app" possible (not even mentionning the 1.6 version which is something like "rhha lovely" :-) ).
Now I have a question to submit to you users !
I have been using for a moment the fantastic rogue Amoeba app called nicecast (http://www.rogueamoeba.com/nicecast/) that turns your computer into a broadcating machine from any audio source from your comp... It has a build in server and I would like to let people know when I am broadcasting on my website running pixelpost, by displaying a "radio online" or "radio offline" text... Problem is that I'm not fond of php and I'm not sure how to integrate this, although it doesn't seem complicated. Maybe you can help me ?
here is how it work, I'm copy pasting the tutorial from rogue amoeba, but I don't know where to put these functions, how ton integrate them, and how to call it in the image_template.html file of my template :
PHP Function :
function onAirTest($ipaddress, $port)
{
if ($ret = @fsockopen($ipaddress, $port, $errno, $errstr, 1))
{
fclose($ret);
return true;
}
else
{
return false;
}
}
Once this function is available (by sticking it at the top of the page, or in a PHP functions file for your site (index.php in pixelpost ???????), it can be combined with a simple if/else statement as follows. Be sure to adjust the address (WWW.EXAMPLE.COM) and the name (MY STATION) as need. This setup can also be spruced up with graphics and alternate text as desired.
if (onAirTest("WWW.EXAMPLE.COM", "8000"))
{
print "MY STATION Is Currently On The Air";
}
else
{
print "MY STATION Is Currently Off The Air";
}
I'm thanking you in advance for the help !
Cyril - http://www.unjouraparis.com
Now I have a question to submit to you users !
I have been using for a moment the fantastic rogue Amoeba app called nicecast (http://www.rogueamoeba.com/nicecast/) that turns your computer into a broadcating machine from any audio source from your comp... It has a build in server and I would like to let people know when I am broadcasting on my website running pixelpost, by displaying a "radio online" or "radio offline" text... Problem is that I'm not fond of php and I'm not sure how to integrate this, although it doesn't seem complicated. Maybe you can help me ?
here is how it work, I'm copy pasting the tutorial from rogue amoeba, but I don't know where to put these functions, how ton integrate them, and how to call it in the image_template.html file of my template :
PHP Function :
function onAirTest($ipaddress, $port)
{
if ($ret = @fsockopen($ipaddress, $port, $errno, $errstr, 1))
{
fclose($ret);
return true;
}
else
{
return false;
}
}
Once this function is available (by sticking it at the top of the page, or in a PHP functions file for your site (index.php in pixelpost ???????), it can be combined with a simple if/else statement as follows. Be sure to adjust the address (WWW.EXAMPLE.COM) and the name (MY STATION) as need. This setup can also be spruced up with graphics and alternate text as desired.
if (onAirTest("WWW.EXAMPLE.COM", "8000"))
{
print "MY STATION Is Currently On The Air";
}
else
{
print "MY STATION Is Currently Off The Air";
}
I'm thanking you in advance for the help !
Cyril - http://www.unjouraparis.com