You want to be part of the ManiaHome System? This topic is made for you!Edit: April 21st 2011
DEPRECATED INFORMATION, PLEASE CHECK THE NEW TUTORIALS !
To send notifications on ManiaHome with your manialink you have to register on [manialink=maniahome:manager]maniahome:manager[/manialink]
The download the library. The zip package is registered in you Skin folder.
The you just have to follow the instructions in the readme file, or read the following topic
Caution: This library require php5 or higher on your server to run.
How to config the library
Edit the config.php file located in the config folder.
Then edit de following lines, by replacing the value Username, Password and ManialinkShortUrl with the one you register on [manialink=maniahome:manager]maniahome:manager[/manialink]
Code: Select all
define('MANIAHOME_USERNAME', 'Username');
define('MANAIHOME_PASSWORD', 'Password');
define('MANIAHOME_MANIALINK', 'ManialinkShortUrl');
How to add the bookmark button on your manialink
The bookmark button:

There is two solutions to add the bookmark button on your manialink.
The first is for people who don't want to use php on their manialink. Just copy the following line then replace the brackets by the necessary informations.
Code: Select all
<include url="http://maniahome.trackmania.com/add.php?name=[ManialinkName]&url=[ManialinkUrl]&picture=[pictureUrl]"/>
- ManialinkName should be the name of your manialink, as you want it will be seen on ManiaHome
- ManialinkUrl should be replace by the url to your manialink
- pictureUrl is an optional parameter but if it's set you will have a personal picture instead of the default picture with your manialink name on it. This picture must have its width 4 time bigger than its height (e.g. w:400px,h:100px).
Here is the default bookmark picture
The second solution use the Library you have downloaded on [manialink=ManiaHome:manager]ManiaHome:manager[/manialink]
- Require the config.php file
- Create a new instance of ManiaHomeClient class.
- Call the method displayBookmarkButton, and put the name of your manialink, and the url to your bookmark picture as parameters.
Code: Select all
<?
require_once PATH_TO_CONFIG_FILE.'config.php';
//Votre code
//....
$mHClient = new ManiaHomeClient();
echo $mHClient->displayBookmarkButton('Your manialink Name','urlVersUneImage');
?>
To send a notification there is two method to do this, but beginning is the same.
- Require the config.php file
- Create a new instance of ManiaHomeClient class.
The second kind of notification can be seen by people who have your manialink in their bookmarks. Use this kind of notification to notify new contents on your manialink or other events related to your manialink
Send a notification to a player
Here we have to use the sendNotificationToPlayer method. Let see its parameter
- message, it's the message of the notification itself (e.g.: downloaded contentName on myManialink)
- login, it's the login of the player who will possessed this notification
- link, it's the link to the content or action. For exemple on maniaspace for a download, it's the details page of the track
- type, it's a parameter which can take one of the following value
- ManiaHomeClient::NONE,it's the default value
- ManiaHomeClient::TRACK, it's for every notifications in relation with a track
- ManiaHomeClient::REPLAY, it's for every notifications related to a record or replay
Code: Select all
<?php
require_once(PATH_TO_CONFIG_FILE.'config.php');
//Your script
$maniaHomeClient = new ManiaHomeClient();
$maniaHomeClient->sendNotificationToPlayer($message, $login, $link, $type);
?>
This time you have to use the sendNotificationFromManialink method. This method requires the same parameters than the previous one, except the login.
Code: Select all
<?php
require_once(PATH_TO_CONFIG_FILE.'config.php');
//Your script
$maniaHomeClient = new ManiaHomeClient();
$maniaHomeClient->sendNotificationFromManialink($message, $link, $type);
?>