php - TXT
php - TXT
First off Id like to thank you for creating such an excellent utility to work with shoutcast... works perfect..
Now.. Would it possible to make it Update a .txt file with song info and radio station info in this way? at the same time the PHP file is updated.
Doing this will make it very easy to stream Station/song data right into a flash file, thus making things easier and can customize the way it looks with endless posibilities
Now.. Would it possible to make it Update a .txt file with song info and radio station info in this way? at the same time the PHP file is updated.
Code: Select all
&songvar=song name&
with help from a friend I have actually figured out a solution,
My web radio is up and the example is here http://69.47.6.217/php/statustest.html
this is a private radio server, for testing purposes right now
As you can see it displays the current song, soon it will display other stuff, like Last songs played and so fourth.
When im finished i can put a little tutorial for those wanting to do somthing like this if you'd like
My web radio is up and the example is here http://69.47.6.217/php/statustest.html
this is a private radio server, for testing purposes right now
As you can see it displays the current song, soon it will display other stuff, like Last songs played and so fourth.
When im finished i can put a little tutorial for those wanting to do somthing like this if you'd like
Im posting this because I havnt seen any Tut\'s about this issue. My first Tutorial, bare with me
TUTORIAL: How to stream SHOUTcast Web radio information into a Swish, flash movie.
REQUIREMENTS: Swishmax, SHOUTcast, RadioToolbox, and a Web host that supports PHP
This Is assuming you already know how to use Radio Toolbox with Shoutcast , basic knowledge of PHP. and how to create a Dynamic Text or Input Box
Here we Go:
STEP ONE: Create another .php doc in the same directory as includes.php (where Radiotoolbox stores its PHP files), Lets name the .php file \"extras.php\"
STEP TWO: in the PHP file you just created put the following:
The contents of this file will be Explained Later.
STEP THREE: Now Open SwishMAX and create a new blank movie.
STEP FOUR: Make 3 Static Text Boxes in the first one Put \"Current Song\" in the second one put \"Listeners\" and in the third put \"Last Song\". Line them up one on top of the other. Like this
STEP SIX: in the script for the \"Scene\" put the following:
This will load the Variables from the PHP file and place the results in the Dynamic Text Boxes. All PHP and .swf files MUST be in the same directory for this to work. You can now test to see if it is loading correctly by uploading your .swf file and PHP files (includes.php, extras.php) onto your host.
OK... Now that thats done lets look at Refreshing the .swf so that it will update the song, listeners, and last song every so so seconds.
STEP SEVEN: Create a new .html doc, wither with notepad or your favorite HTML editor (i use dreamweaver) and name it \"status.html\"
STEP EIGHT: Put the folloing code in the HEAD of the document:
EDIT the path to your .swf file... The \"30\" tells the web page how many seconds befor it should refresh.
Now place the following code in the BODY of the HTML doc, anywhere you want the SWF to show.
Now upload your .html doc and test it out. Make sure your SHOUTcast server is on at the time, along with RadioToolbox, so you can test if the content in the SWF is updating correcty.
Im sure you can use this same type of method for other flash programs such as Flash MX
SOrry im not too good with words I hope I explained everything I should have and clearly.
TUTORIAL: How to stream SHOUTcast Web radio information into a Swish, flash movie.
REQUIREMENTS: Swishmax, SHOUTcast, RadioToolbox, and a Web host that supports PHP
This Is assuming you already know how to use Radio Toolbox with Shoutcast , basic knowledge of PHP. and how to create a Dynamic Text or Input Box
Here we Go:
STEP ONE: Create another .php doc in the same directory as includes.php (where Radiotoolbox stores its PHP files), Lets name the .php file \"extras.php\"
STEP TWO: in the PHP file you just created put the following:
Code: Select all
<?php
include (\"includes.php\");
$current_song = $current_song;
echo \"¤t_song=\".$current_song;
$lastsong[1] = $lastsong[1];
echo \"&last_song=\".$lastsong[1];
$server[0][\'listeners\'] = $server[0][\'listeners\'];
echo \"¤t_listen=\".$server[0][\'listeners\'];
?>
STEP THREE: Now Open SwishMAX and create a new blank movie.
STEP FOUR: Make 3 Static Text Boxes in the first one Put \"Current Song\" in the second one put \"Listeners\" and in the third put \"Last Song\". Line them up one on top of the other. Like this
STEP FIVE: Create 3 \"dynamic\" text Boxes, all with a differant name. In the First text box Set the Variable text to say \"current_song\" (MUST be differant than the NAME of the Dynamic Text Box) in the second dynamic text box put \"current_listen\" and the third put \"current_listen\"Current song
Listeners
Last Song
STEP SIX: in the script for the \"Scene\" put the following:
Code: Select all
onFrame (1) {
_root.loadVariables(\"extras.php\",\'GET\');
}
OK... Now that thats done lets look at Refreshing the .swf so that it will update the song, listeners, and last song every so so seconds.
STEP SEVEN: Create a new .html doc, wither with notepad or your favorite HTML editor (i use dreamweaver) and name it \"status.html\"
STEP EIGHT: Put the folloing code in the HEAD of the document:
Code: Select all
<meta http-equiv=refresh content=\"30; http://yourdomain.com/status.swf\">
Now place the following code in the BODY of the HTML doc, anywhere you want the SWF to show.
Code: Select all
<iframe src=\"http://yourdomain.com/status.swf\" height=\"105\" width=\"369\" scrolling=\"no\" frameborder=\"0\"></iframe></embed>
Again, edit the path to your .swf file... Also edit the Proportions of the iframe with the same propotions of the .swf file. (width, Height)
Im sure you can use this same type of method for other flash programs such as Flash MX
SOrry im not too good with words I hope I explained everything I should have and clearly.
hmm, the forum changed a few unwanted things automatically, I also posted this at www.swish-db.com, if you are confused
http://www.swish-db.com/forum/index.php?showtopic=18353
Heres another Example, Result of this method of putting into Flash
http://69.47.6.217/CDstats.html - a project im doing for CD Radio
Also, the refresh method I used here doesnt quite work right for people useing FireFox Web Browser. Ill have a fix for that soon
http://www.swish-db.com/forum/index.php?showtopic=18353
Heres another Example, Result of this method of putting into Flash
http://69.47.6.217/CDstats.html - a project im doing for CD Radio
Also, the refresh method I used here doesnt quite work right for people useing FireFox Web Browser. Ill have a fix for that soon