Page 1 of 3

[Maniaplanet] Add the share button on your Manialink

Posted: 02 Feb 2012, 11:32
by farfa
1 - Introduction

Use the "share button" on your Manialink to allow your visitors to easilly share your content on ManiaHome!

Like the Bookmark button, this new feature comes with a new button, simple to integrate to your ManiaLink. You have an example of the share button on the maniaplanet-store. Once integrated, the player just have to click on the button to share some content.

In this guide we will see how to add such a button on your Manialink by using XML code only.

2 - Simple button

At least, you need to specify the link to the content you want to share, and the name of the product. We will generate an automatic message with those elements.

This is a sample code

Code: Select all

<include url="http://maniahome.maniaplanet.com/share/?link=maniaplanet-store&contentName=%24fffMania%2409fplanet-skin"/>
The message generated will be: "Nickname recommands Maniaplanet-skin", and with a link to maniaplanet-store once the player click the notification. (I've replaced the white by a light grey for reading purpose ;))

There is 2 parameters in this URL, link and contentName, they are separated by "&" and not "&". This because the URL is XML-escaped.

You can also notice "%24fffMania%2409fplanet-skin" that stands for "$fffMania$09fplanet-skin". Here's why:

URL-ENCODE YOUR PARAMETERS BEFORE PUTTING THEM IN THE URL!

3 - Manialink version="0" support

The included view uses by default version="1" with the new position/size system. If you're Manialink still uses version="0", you can specify it in the URL of the include:

Code: Select all

Code: Select all

<include url="http://maniahome.maniaplanet.com/add/?url=manialoto&version=0"/>

Re: [Maniaplanet] Add the share button on your Manialink

Posted: 02 Feb 2012, 15:18
by m4rcel
Nice feature ;)

Only one question: Is there any difference in sending a Notification over the Share-button and sending a custom Notification via postPersonalNotification() to myself? (Except that you need PHP for the latter ^^)

Re: [Maniaplanet] Add the share button on your Manialink

Posted: 02 Feb 2012, 15:32
by farfa
Yes, with this solution you don't have to authenticate the player. If you use the other solution you have to do it.
But this feature is mainly made for players who don't have big knowledge in development.

Re: [Maniaplanet] Add the share button on your Manialink

Posted: 14 Mar 2012, 21:56
by bryan1998
Is there a way to do this with PHP ? ( Yes i know i can echo the XML code - but i want PHP include. )

Also - how do i position this ?

Re: [Maniaplanet] Add the share button on your Manialink

Posted: 15 Mar 2012, 08:56
by farfa
There is no particular solution to do it in PHP.
To position it, you can include the markup in a frame

Re: [Maniaplanet] Add the share button on your Manialink

Posted: 01 Apr 2012, 20:47
by om23
seriously, how do i set the position?
I am noob :p

I have included this code in my mainpage, it is shown in the middle.
echo " <include url='http://maniahome.maniaplanet.com/share/ ... f0ั\$ec0巳/>"; echo "\n";

Re: [Maniaplanet] Add the share button on your Manialink

Posted: 01 Apr 2012, 21:08
by htbplayer
make a frame around the button and you can place it everywhere.
Look on the post of farfa exactly the same as i said.

Re: [Maniaplanet] Add the share button on your Manialink

Posted: 01 Apr 2012, 21:34
by om23
oh, ahh ok, i just didnt understand what markup in a frame is mean :D
got it now, thx

Re: [Maniaplanet] Add the share button on your Manialink

Posted: 04 Apr 2012, 19:42
by kroff
Hello,

Is it possible to have a maniapress-version of this ? :D Would be awesome !

Thanks ! :thx:

Re: [Maniaplanet] Add the share button on your Manialink

Posted: 04 Apr 2012, 20:48
by gouxim
Good idea, we'll do that. :thumbsup: