ManiaHome Library, Feed the Community

This is the place where you can find everything related to the dedicated server, control scripts and community tools.

Moderators: Pit Crew, TM-Patrol

User avatar
SaTaNaSDiaBoLo
Pit Crew
Pit Crew
Posts: 346
Joined: 16 Aug 2005 14:53
Owned TM-games: TMO TMS TMN TMU TMUF
Manialink(s): maniahome
Location: In my Home on ManiaHome Manialink

ManiaHome Library, Feed the Community

Post by SaTaNaSDiaBoLo » 18 May 2010 07:55

Edit: April 21st, 2011
This topic is now deprecated!


With the new version of ManiaHome, we updated the PHP library and the documentation. In a effort to centralize information & support, you should now use the dedicated ManiaHome forum at:

ManiaHome Forum with updated docs

Thanks!
NADEO
You want to be part of the ManiaHome System? This topic is made for you!
To sent 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.

User avatar
SaTaNaSDiaBoLo
Pit Crew
Pit Crew
Posts: 346
Joined: 16 Aug 2005 14:53
Owned TM-games: TMO TMS TMN TMU TMUF
Manialink(s): maniahome
Location: In my Home on ManiaHome Manialink

Re: ManiaHome Library, Feed the Community

Post by SaTaNaSDiaBoLo » 18 May 2010 07:56

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

User avatar
SaTaNaSDiaBoLo
Pit Crew
Pit Crew
Posts: 346
Joined: 16 Aug 2005 14:53
Owned TM-games: TMO TMS TMN TMU TMUF
Manialink(s): maniahome
Location: In my Home on ManiaHome Manialink

Re: ManiaHome Library, Feed the Community

Post by SaTaNaSDiaBoLo » 18 May 2010 07:56

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
Image

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'); 
?>

User avatar
SaTaNaSDiaBoLo
Pit Crew
Pit Crew
Posts: 346
Joined: 16 Aug 2005 14:53
Owned TM-games: TMO TMS TMN TMU TMUF
Manialink(s): maniahome
Location: In my Home on ManiaHome Manialink

Re: ManiaHome Library, Feed the Community

Post by SaTaNaSDiaBoLo » 18 May 2010 07:57

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);
?>
Imagecolor>

User avatar
apovtx
happy cruiser
happy cruiser
Posts: 154
Joined: 04 Dec 2008 16:06
Owned TM-games: TMUF,TMNF,TMN
Manialink(s): funteam
Location: Xanthi,Greece
Contact:

Re: ManiaHome Library, Feed the Community

Post by apovtx » 18 May 2010 17:04

Hello! Is it possible to use it with manialib?
The

Code: Select all

spl_autoload_register('restClientAutoload');
seems to cause problems. I tested it with a simple manialink (not with manialib) and it works fine.
Sorry for the "noob" question, but i'm new to php :scene:

Regards,
Apovtx
Do you wanna be a journalist?
Contact me with PM!
Image

User avatar
SaTaNaSDiaBoLo
Pit Crew
Pit Crew
Posts: 346
Joined: 16 Aug 2005 14:53
Owned TM-games: TMO TMS TMN TMU TMUF
Manialink(s): maniahome
Location: In my Home on ManiaHome Manialink

Re: ManiaHome Library, Feed the Community

Post by SaTaNaSDiaBoLo » 18 May 2010 18:20

Don't use the library for the moment.
Tomorrow we planned to make a big update on the library and ManiaHome:Manager.
So wait until tomorrow before using it. Sorry for the disagreement
Imagecolor>

Markus10
tricycle manager
tricycle manager
Posts: 29
Joined: 29 Mar 2008 09:30
Owned TM-games: TMN,TMU

Re: ManiaHome Library, Feed the Community

Post by Markus10 » 18 May 2010 18:26

what exactly can i do if I'm premium member, which features do I have and so on?

Do I have to Log-in anywhere?

User avatar
apovtx
happy cruiser
happy cruiser
Posts: 154
Joined: 04 Dec 2008 16:06
Owned TM-games: TMUF,TMNF,TMN
Manialink(s): funteam
Location: Xanthi,Greece
Contact:

Re: ManiaHome Library, Feed the Community

Post by apovtx » 18 May 2010 18:27

SaTaNaSDiaBoLo wrote:Don't use the library for the moment.
Tomorrow we planned to make a big update on the library and ManiaHome:Manager.
So wait until tomorrow before using it. Sorry for the disagreement
Ok no problem! I will be waiting!

Thanks!
Do you wanna be a journalist?
Contact me with PM!
Image

Gekko
speedy pilot
speedy pilot
Posts: 550
Joined: 03 Sep 2006 18:20
Owned TM-games: ALL
Location: Naples - Italy
Contact:

Re: ManiaHome Library, Feed the Community

Post by Gekko » 18 May 2010 18:36

What the ManiaHome Library is made for?
Can you explain some features before a user register and download it?
Thx and good work mates!

User avatar
SaTaNaSDiaBoLo
Pit Crew
Pit Crew
Posts: 346
Joined: 16 Aug 2005 14:53
Owned TM-games: TMO TMS TMN TMU TMUF
Manialink(s): maniahome
Location: In my Home on ManiaHome Manialink

Re: ManiaHome Library, Feed the Community

Post by SaTaNaSDiaBoLo » 18 May 2010 18:49

ManiaHome Library is made for manialink creator who want to send notifications to ManiaHome. For example, when a player download a mod or something like that, you can send a notifications to the player. When you add some new content on your manialink, you can send a notification from your manialink.
If someone want to make a plug-in for dedicated server, you will be able to send notifications for record online
Imagecolor>

Th3_Darkness
highway camper
highway camper
Posts: 3
Joined: 17 Sep 2009 16:18
Owned TM-games: TMN, TMNF, TMUF
Manialink(s): tf

Re: ManiaHome Library, Feed the Community

Post by Th3_Darkness » 18 May 2010 22:01

Heya,
i dont want to spam your msg box, so i decided to write here :)
I don't know if you noticed but there is a problem with your <include> because it is not possible to include via a rgistered code like

Code: Select all

<include url="maniahome:add?name=[ManialinkName]&url=[ManialinkUrl]&picture=[pictureUrl]"/>
You need to write down the full URL to the php file. I told you this because i thought there wont be changes in this direction so the bug wont be found ;)

Sry for my bad english :P


Cheers
Darkness

User avatar
SaTaNaSDiaBoLo
Pit Crew
Pit Crew
Posts: 346
Joined: 16 Aug 2005 14:53
Owned TM-games: TMO TMS TMN TMU TMUF
Manialink(s): maniahome
Location: In my Home on ManiaHome Manialink

Re: ManiaHome Library, Feed the Community

Post by SaTaNaSDiaBoLo » 19 May 2010 04:36

thx, I forgot, I edit my message, now it's ok
Imagecolor>

User avatar
SaTaNaSDiaBoLo
Pit Crew
Pit Crew
Posts: 346
Joined: 16 Aug 2005 14:53
Owned TM-games: TMO TMS TMN TMU TMUF
Manialink(s): maniahome
Location: In my Home on ManiaHome Manialink

Re: ManiaHome Library, Feed the Community

Post by SaTaNaSDiaBoLo » 19 May 2010 09:46

For those who have already downloaded the library please download the new version on [url=tmtp:///:ManiaHome:Manager]ManiaHome:Manager[/url]. Moreover if you want your notifications to be saved linked your account with your manialink on ManiaHome:Manager
Imagecolor>

User avatar
apovtx
happy cruiser
happy cruiser
Posts: 154
Joined: 04 Dec 2008 16:06
Owned TM-games: TMUF,TMNF,TMN
Manialink(s): funteam
Location: Xanthi,Greece
Contact:

Re: ManiaHome Library, Feed the Community

Post by apovtx » 19 May 2010 09:49

Can you check again the download please? I get error "Access denied"

Apovtx
Do you wanna be a journalist?
Contact me with PM!
Image

User avatar
w1lla
TM-Patrol
TM-Patrol
Posts: 1466
Joined: 23 May 2007 07:20
Owned TM-games: TMU, TMN, TMF
Manialink(s): intr
Location: Venray

Re: ManiaHome Library, Feed the Community

Post by w1lla » 19 May 2010 09:53

same here...

Code: Select all

tmnforever is nations and united makes it special. tmnforever has united. I need united!

Post Reply