[deprecated] ManiaHome Library, Feed the Community

Discuss all the publishing tools, including ManiaHome, ManiaPub, ManiaFlash and ManiaPress in this forum

Moderator: NADEO

Post Reply
farfa
Nadeo
Nadeo
Posts: 585
Joined: 14 Jun 2010, 16:15
Location: In front of your hood with one lap late

[deprecated] ManiaHome Library, Feed the Community

Post by farfa »

Edit: April 21st 2011
DEPRECATED INFORMATION, PLEASE CHECK THE NEW TUTORIALS !
You want to be part of the ManiaHome System? This topic is made for you!
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');
Now you can uploads the library on your server. Please respect the folder organisation

How to add the bookmark button on your manialink
The bookmark button:
Image

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).
Be extra careful with this solution. You have to encode every string you put as argument. I recommend you use this link to do this: http://meyerweb.com/eric/tools/dencoder/

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.
Here is a sample

Code: Select all

<? 
require_once PATH_TO_CONFIG_FILE.'config.php'; 

//Votre code 
//.... 

$mHClient = new ManiaHomeClient(); 
echo $mHClient->displayBookmarkButton('Your manialink Name','urlVersUneImage'); 
?>
How to send notifications

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.
Now the method required depends of the visibility of the notification. You can send a notification to a player. This notification will be seen by the player and his/her friends. Choose this kind of notification when a player download a file on your manialink or make any action which can be interesting for his/her network.
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
Here is a sample:

Code: Select all

<?php
require_once(PATH_TO_CONFIG_FILE.'config.php');
//Your script
$maniaHomeClient = new ManiaHomeClient();
$maniaHomeClient->sendNotificationToPlayer($message, $login, $link, $type);
?>
Send a notification from a manialink
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);
?>
Also known as: satanasdiabolo
User avatar
xxluke
Posts: 114
Joined: 13 Jul 2010, 15:24
Contact:

Re: ManiaHome Library, Feed the Community

Post by xxluke »

I don't understand how I can send a notification from my manialink with an icon :( .
This code doesn't work:

Code: Select all

...
require_once(PATH_TO_CONFIG_FILE.'config.php');
//Your script
$maniaHomeClient = new ManiaHomeClient("My Manialink");
$maniaHomeClient->sendNotificationFromManialink("A message", "link", "TRACK");
...
farfa
Nadeo
Nadeo
Posts: 585
Joined: 14 Jun 2010, 16:15
Location: In front of your hood with one lap late

Re: ManiaHome Library, Feed the Community

Post by farfa »

It's the type of notification you use which is not correct. Look a the code I put below

Code: Select all

...
require_once(PATH_TO_CONFIG_FILE.'config.php');
//Your script
$maniaHomeClient = new ManiaHomeClient("My Manialink");
$maniaHomeClient->sendNotificationFromManialink("A message", "link", ManiaHomeClient::TRACK);
...
Also known as: satanasdiabolo
User avatar
xxluke
Posts: 114
Joined: 13 Jul 2010, 15:24
Contact:

Re: ManiaHome Library, Feed the Community

Post by xxluke »

Without the

Code: Select all

[b][/b]
I think.

Thanks, it works now, I tried it before with ". :)
farfa
Nadeo
Nadeo
Posts: 585
Joined: 14 Jun 2010, 16:15
Location: In front of your hood with one lap late

Re: ManiaHome Library, Feed the Community

Post by farfa »

Indeed, without ^^
I edit my post for futur reader
Also known as: satanasdiabolo
Post Reply

Return to “Ingame Publishing”

Who is online

Users browsing this forum: No registered users and 1 guest