
I've just started using ManiaConnect, and have successfully created a simple script to return my login when I login through the Player Page (HTML + PHP).
I have a problem when I try to use the same code in a Manialink. I keep getting Unknown Resource Type errors, and I was wondering what they mean, and what I have done wrong in my code.
Here is the working HTML + PHP script:
Code: Select all
<?php
require_once 'libraries/autoload.php';
define('USERNAME', 'MAH USHURNAHM');
define('PASSWORD', 'MAH PASSWHURD');
define('SCOPE', 'basic buddies');
$maniaconnect = new \Maniaplanet\WebServices\ManiaConnect\Player(USERNAME, PASSWORD);
$player = $maniaconnect->getPlayer();
// If the player is connected/logged in, return player's login.
if($player)
{
$login = $player->login;
}
// If the player is not connected/logged in, move them into the player page to sign in.
else
{
$loginURL = $maniaconnect->getLoginURL(SCOPE);
echo '<a href="'.$loginURL.'">Login with your Maniaplanet account</a>';
}
?>
<html>
<head>
<title>Return Login</title>
</head>
<body>
<?php echo $login; ?>
</body>
</html>
Code: Select all
<?php
require_once 'libraries/autoload.php';
define('USERNAME', 'MAH USHURNAHM');
define('PASSWORD', 'MAH PASSWHURD');
define('SCOPE', 'basic buddies');
$maniaconnect = new \Maniaplanet\WebServices\ManiaConnect\Player(USERNAME, PASSWORD);
$player = $maniaconnect->getPlayer();
// If the player is connected/logged in, return player's login.
if($player)
{
//echo $player->login;
echo '<manialink>';
echo '<frame posn="0 0 0">';
echo '<label posn="0 0 0" scale="1.5" text="'echo $player->login'"/>';
echo '</frame>';
echo '</manialink>';
}
// If the player is not connected/logged in, move them into the player page to sign in.
else
{
$loginURL = $maniaconnect->getLoginURL(SCOPE);
//echo '<a href="'.$loginURL.'">Login with your Maniaplanet account</a>';
echo '<manialink>';
echo '<frame posn="0 0 0">';
echo '<label posn="0 0 0" scale="1.5" text="Please sign in..."/>';
echo '<label posn="0 -10 0" style="CardButtonMedium" text="Sign In" manialink="'$loginURL'"/>';
echo '</frame>';
echo '</manialink>';
}
?>
Thanks guys

