Page 1 of 1

Translation problem

Posted: 29 Jan 2012, 18:43
by kroff
Hello everyone,

I just have some difficulties with this code :

Code: Select all

manialink="<?php echo $http_location;?>?shoutbox=shoutboxInput"
How do you "translate" that one there in this ?

Code: Select all

$ui->setManialink(???);
I tried everything without results... Hope someone can help me ;)

Re: Translation problem

Posted: 29 Jan 2012, 21:47
by m4rcel
Without knowing the internals of ManiaLib, I would try the following line:

Code: Select all

$ui->setManialink($http_location.'?shoutbox=shoutboxInput');
where of course $http_location must be set before calling this line.

Re: Translation problem

Posted: 30 Jan 2012, 10:55
by gouxim
Indeed you need to write:

Code: Select all

$ui->setManialink($http_location.'?shoutbox=shoutboxInput');
However one thing to note: when you put the URL directly in the XML code, you have to XML-encode it before echoing it in the XML. You don't need to do that with ManiaLib since it automatically encodes the parameters.

Re: Translation problem

Posted: 30 Jan 2012, 22:32
by kroff
Well, thanks to you guys ! :thumbsup: