Jump to content

Read message request

Recommended Posts

Hello I have a problem. Songs on request in PHP are working very well, but my question is how can I read the dedication of the song?

Looking everywhere but no information, once seen as a picture message body was visible in Sam Broadcaster

Link to comment
Share on other sites

I want to see text messages in Sam Broadcaster
It is possible to display the dedication within the PAL editor however that is not a very good solution, the best way is to develop a PHP script which there some posted in the Spacial forums to display upcoming requests and dedications prior to them playing.


Rob Oyler

5280 Jazz

Link to comment
Share on other sites

I found a script Pal works very well. shows the message in the editing pal "on the right side script

the script could be useful to someone



// Requests on Stream.pal// 2008-11-12 v1.1 Moonbase

// Originally based on Xgeek's "Inject Request Dedication.pal" v0.05, 2004-11-12


PAL.Loop := True;



// Instantiate Song Info objects

var curSong: TSongInfo;

var updSong: TSongInfo;

var dedicationText: String = '';



curSong := TSongInfo.Create;

updSong := TSongInfo.Create;



// Save info about current song ActivePlayer might change while we work!

curSong := nil;

if (ActivePlayer nil) then

curSong := ActivePlayer.GetSongInfo;



if (curSong nil) then


// Something is playing, see if it is a request

if (curSong['requestID'] > 0) then




// we have a request, get requester's name and dedication text (if given)

var reqInfo: TDataSet = Query('SELECT name, msg FROM requestlist WHERE id = ' + curSong['requestID'], [], true); // r/o query

var requestBy: String = reqInfo['name'];

var dedicationMsg: String = reqInfo['msg'];




var i: Integer;

var c: String;

var addStr, newTitle: String;



// clean up unwanted characters (i.e., line feeds, control characters; leave only ISO-8859-1)

i := 1;

while (i


c := CharAt(dedicationMsg, i);

if (((CompareStr(c, ' ') >= 0) and (CompareStr(c, ' ') = 0) and (CompareStr(c, ' ')

dedicationText := dedicationText + c;

i := i + 1;




// build addistional info string

addStr := ' ~PAGEIDAUTA -';

if (requestBy > '') then


// we have requester's name

addStr := addStr + ' : ' + requestBy;

if (dedicationText > '') then

// we also have a dedication

addStr := addStr + '"' + dedicationText + '"';

addStr := addStr + '~';



// requester didn't give his name, we won't show anonymous dedications

addStr := addStr + '~';







writeln(addStr); // debug

updSong['artist'] := curSong['artist'];

newTitle := curSong['title'] + addStr;

// force maximum length of 150 characters

// (shoutCAST server bug: shows password since v1.9.2 if > 150 characters!)

if (Length(updSong['artist'] + '' + newTitle) > 150) then

newTitle := Copy(ActivePlayer.GetSongInfo['title'] + addStr, 1, 146 - Length(updSong['artist'])) + '...';

updSong['title'] := newTitle;


writeln(updSong['artist'] + ' - ' + updSong['title']);



PAL.WaitForPlayCount(1); // wait until current finished




// Nothing is playing, wait a while and see again






// Release data structures





Link to comment
Share on other sites

That would be the least likely solution I would go with, Keeping the PAL IDE open would lend itself to possible issues, like locking up the broadcast machine if an inadvertent change was made to the running script because of a keystroke not intended etc.


Rob Oyler

5280 Jazz

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...