Lastsong and more Questions

Ask questions, request features, or just complement us about our software and services.
Post Reply
xen
Posts: 3
Joined: Fri Sep 24, 2004 1:54 am

Lastsong and more Questions

Post by xen »

I downloaded RTB and got it up and running with sending the script to my site and everything. It's all working fine, I just have a few display questions. I don't know anything about PHP, but I got a few things just looking at it, so I'm not completely retarded. I just have no idea what's possible, or how.

1. I noticed that the current song also shows on the Last However Many Songs list. It's not really a recently played song, it's a currently playing song (go to http://airradio.net/inside/listen.php to see what I'm talking about if it's just me). I changed the number in the PHP from 0 to 1 (i=o to i=1), and that certainly worked. But then it messed up the displayed number of songs. After I changed it, only 9 songs showed (which makes sense if it still counts the current song but just doesn't display it). Is there anyway I can fix this? I want the last 10 played songs to show, not 9 and the current.

2. If you go to my site you can see that every now and then a song is too long to remain on one line. Can I somehow cut off the number of displayed characters? Like, instead of "Actionslacks - We Are Not The Losers (Anymore)" showing, only "Actionslacks - We Are Not The Losers" would show up.

3. Last question I can come up with for now, and it might not be able to be done with RTB. Underneath the total users I want to display the average listen time (that is, if it ever becomes respectable). Are there any PHP codes that I can use with RTB for this? Or, if not, does anyone know a way for me to integrate this dynamically onto my site? I could always just change it myself, but if there's an easier way...

Thanks for any help that you can offer.
User avatar
Jay
Will work for food (Administrator)
Posts: 3020
Joined: Mon Jan 14, 2002 12:48 am
Location: Next Door
Contact:

Re: Lastsong and more Questions

Post by Jay »

xen wrote:1. I noticed that the current song also shows on the Last However Many Songs list. It's not really a recently played song, it's a currently playing song (go to http://airradio.net/inside/listen.php to see what I'm talking about if it's just me). I changed the number in the PHP from 0 to 1 (i=o to i=1), and that certainly worked. But then it messed up the displayed number of songs. After I changed it, only 9 songs showed (which makes sense if it still counts the current song but just doesn't display it). Is there anyway I can fix this? I want the last 10 played songs to show, not 9 and the current.
well that's probably just a bug in the example docs. I whipped those up pretty fast to show the power of the system and most will not use it or will modify it to their liking. You can certainly fix that problem by modifing the for loop as you mentioned and having it display i-1 rather then i and setting the $song_history number to 11 in the catcher's config file
xen wrote: 2. If you go to my site you can see that every now and then a song is too long to remain on one line. Can I somehow cut off the number of displayed characters? Like, instead of "Actionslacks - We Are Not The Losers (Anymore)" showing, only "Actionslacks - We Are Not The Losers" would show up.
There is no reliable way, for instance it would not be cut off at a particular character like a space unless you code that up and seeing as you are just starting out it might be a little beyond you, the easiest method is to use a substr() on the var in question and set it to a certain amount of characters. Or set the cell properties of that table to NOWRAP.
xen wrote: 3. Last question I can come up with for now, and it might not be able to be done with RTB. Underneath the total users I want to display the average listen time (that is, if it ever becomes respectable). Are there any PHP codes that I can use with RTB for this? Or, if not, does anyone know a way for me to integrate this dynamically onto my site? I could always just change it myself, but if there's an easier way...
no seeing as RTB doesn't aggragate that information and send it out to the catcher there is no way to have it done that way. What reason would there be to display this information to the user? To be frank, in my opinion, they won't care or understand what it means anyways. If they did they would just go to your shoutcast admin page and look it up. I am sure there are plenty of other site integration scripts more php based which will do this stat I am just not currently aware of such a solution.
- Jay
xen
Posts: 3
Joined: Fri Sep 24, 2004 1:54 am

Post by xen »

Thanks for the answer :)

1. The only problem I have with setting it to 11 songs and then showing the 10 is that I have the lastsong(i) (or whatever) thing on my page that shows the number of previous songs being listed. If I set it to 11 and only 10 show, that'd be weird. Is there a way to have it be lastsong - 1, or something?

2. True. I'll look into that and see if it works well.

3. I didn't think RTB could do it, but just thought I'd ask. And as for why, just to have it. Just more interesting info to have I guess.

One more question: My site is technically two streams, mine and my friends. Sometimes mine is up, sometimes his is up. Is there a way to show which stream is currently running? I have my stream named AIR Radio -s- and his is named AIR Radio - Y-. I know that RTB sees that info, but I don't know if it can send it or what the PHP script for that would be.

Sorry if I'm being an annoying newb.
User avatar
Jay
Will work for food (Administrator)
Posts: 3020
Joined: Mon Jan 14, 2002 12:48 am
Location: Next Door
Contact:

Post by Jay »

xen wrote:Thanks for the answer :)

1. The only problem I have with setting it to 11 songs and then showing the 10 is that I have the lastsong(i) (or whatever) thing on my page that shows the number of previous songs being listed. If I set it to 11 and only 10 show, that'd be weird. Is there a way to have it be lastsong - 1, or something?
exactly just add a -1 to the var and it should fix the problem
xen wrote:One more question: My site is technically two streams, mine and my friends. Sometimes mine is up, sometimes his is up. Is there a way to show which stream is currently running? I have my stream named AIR Radio -s- and his is named AIR Radio - Y-. I know that RTB sees that info, but I don't know if it can send it or what the PHP script for that would be.
Yes if you have server details being sent then it's simply a matter of finding the variable you want to work with in the includes.php file. Make sure that send server details is checked in Radio Toolbox's option pane "Script Service". Once that is done let it touch a couple of times and then view the includes.php you will see all sorts of nifty variables you can work with. In your script you can get to the vars by calling 'echo $var;' where var is the name of the variable you want to output. Also check out php.net for more information on what php is and how it works. There are some great tutorials there which will help you understand better how this system works.
- Jay
xen
Posts: 3
Joined: Fri Sep 24, 2004 1:54 am

Post by xen »

Thank you once more, you tireless administrator. The help has been wonderful. I'll report back if, for some freaky reason, I'm having troubles.
Post Reply