[TMF] Add a bookmark button on your Manialink (XML)

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

Moderator: NADEO

Post Reply
User avatar
gouxim
Nadeo
Nadeo
Posts: 1159
Joined: 14 Jun 2010, 17:20

[TMF] Add a bookmark button on your Manialink (XML)

Post by gouxim » 21 Apr 2011, 17:42

1 - Introduction

You can add a bookmark button on your Manialink for people to add your Manialink in their bookmarks. The button looks like this:

Image

In this guide we will see how to add such a button on your Manialink by using XML code only. Everything is based on a Manialink Include, you just need to specify the right URL. Let's see how!
Looking for the same feature with the ManiaHome PHP Library?
Check out this tutorial!
2 - Simple button

At least, you need to specify the code/url of your Manialink. Let's take an example with "maniapub" (change maniapub with whatever your Manialink is!). The code is very simple. Just put it in your page where you want to display the button.

Code: Select all

<include url="http://maniahome.trackmania.com/add/?url=maniapub"/>
3 - Button with a formatted name

You can also specify the name of your Manialink using special characters. Let's take an example with the manialink "maniapub" and it's name "$i$F60ManiaPub" (change maniapub and the formatted name with whatever your Manialink is!). The code is the same but we add the "name" parameter. Note that parameters are not separated by "&" but by "&". This because the URL is XML-escaped.

Code: Select all

<include url="http://maniahome.trackmania.com/add/?url=maniapub&name=%24i%24F60ManiaPub"/>
You just saw something weird didn't you? I wrote "$i$F60ManiaPub" before, and "%24i%24F60ManiaPub" in the URL above. Okay, this is important so I'll write it with big letters:
URL-ENCODE YOUR PARAMETERS BEFORE PUTTING THEM IN THE URL!

URL-encoding is very simple. Here's a tool to do that: http://meyerweb.com/eric/tools/dencoder/

4 - Button with an image

You can change the default image that is associated with the bookmarks page on ManiaHome. To do that, you need to specify the "picture" parameter in the URL. Let's take an example with "manialive" and its beautiful banner (courtesy of aseco :)):

Image
Only JPG and PNG are supported now. DDS is not supported anymore!
Our three parameters (url, name, picture) are:

Code: Select all

manialive
$i$F60ManiaLive
http://manialink.manialive.com/images/manialive_bookmark.png
In case you missed the sentance the first time:
URL-ENCODE YOUR PARAMETERS BEFORE PUTTING THEM IN THE URL!

So those three parameters once encoded are:

Code: Select all

manialive
%24i%24F60ManiaLive
http%3A%2F%2Fmanialink.manialive.com%2Fimages%2Fmanialive_bookmark.png
And then we just need to put everything in the URL of the include:

Code: Select all

<include url="http://maniahome.trackmania.com/add/?url=manialive&name=%24i%24F60ManiaLive&picture=http%3A%2F%2Fmanialink.manialive.com%2Fimages%2Fmanialive_bookmark.png"/>
Please do not PM for support. Instead, create a thread so that everyone can contribute or benefit from the answer! 8-)

User avatar
Electron
Posts: 706
Joined: 15 Jun 2010, 18:02
Contact:

How to position the bookmark button on my Manialink (XML)

Post by Electron » 22 Apr 2011, 14:14

It works. But how to position the bookmark button on the Manialink?

The following Manialink shows the bookmark button always centered behind the text (or other elements).

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<manialink>
  <type>default</type>
  <format textsize="2" textcolor="900f"></format>
  <background bgcolor="ffcf" bgborderx="2" bgbordery="1.5"></background>
  <line>
    <cell>
      <text halign="center">Some text</text>
    </cell>
  </line>
  <include url="http://maniahome.trackmania.com/add/?url=Electron"/>
</manialink>
When i attempt to position the button like following, it does not load.

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<manialink>
  <type>default</type>
  <format textsize="2" textcolor="900f"></format>
  <background bgcolor="ffcf" bgborderx="2" bgbordery="1.5"></background>
  <line>
    <cell>
      <text halign="center">Some text</text>
    </cell>
  </line>
  <line height="0.05">
    <cell></cell>
  </line>
  <line>
    <cell>
      <include url="http://maniahome.trackmania.com/add/?url=Electron"/>
    </cell>
  </line>
</manialink>
Image
TM²: TrackMania Telemetry Monitor version 1.1.1

User avatar
gouxim
Nadeo
Nadeo
Posts: 1159
Joined: 14 Jun 2010, 17:20

Re: [HOW-TO] Add a bookmark button on your Manialink (XML)

Post by gouxim » 22 Apr 2011, 16:04

I am not sure what's the beaviour when you mix old-style manialink code with the most recent manialink format. Bear in mind that the include tag will include new-style manialink code.

Basically when you make the include the game just replace the include tag with the code of the include. So in your case the code is:

Code: Select all

<frame>
  <quad sizen="20 5" manialink="maniahome?authentication=1&ml-
    forcepathinfo=%2Fbookmarks%2Fadd%2F&name=&
    url=Electron&picture=&1886542185="
    image="http://maniahome.trackmania.com/images/favAdd.dds" 
    imagefocus="http://maniahome.trackmania.com/images/favAdd_focus.dds"/>
</frame> 
So it just create a 20x5 quad where the include is. When you use the new manialink format, to position the button in your page, you can use a frame, like this:

Code: Select all

<frame posn="12 -24 1">
    <include url="http://maniahome.trackmania.com/add/?url=Electron"/>
</frame>
Please do not PM for support. Instead, create a thread so that everyone can contribute or benefit from the answer! 8-)

User avatar
Electron
Posts: 706
Joined: 15 Jun 2010, 18:02
Contact:

Re: [HOW-TO] Add a bookmark button on your Manialink (XML)

Post by Electron » 22 Apr 2011, 16:44

Using the frame element to position the button works. Thank you!

But i have still a problem. :oops: My user-defined picture is not shown...

The ratio of the banner must be of four to one (mine is 300x75) and JPG, PNG and DDS file formats are supportet, right?

I can change the formatting/coloring of the ManiaLink URL (second param) and immediate can see the results. But no banner picture... Here is my Manialink code:

Code: Select all

<frame pos="0.155 -0.67 -0.75"> 
<include url="http://maniahome.trackmania.com/add/?url=GbxDump&name=%24i%24ff3GbxDump&picture=http%3A%2F%2Fwww.wolfgang-rolke.de%2Fmisc%2Fgbxdump.png"/>
</frame>
Last edited by Electron on 25 Apr 2011, 22:14, edited 1 time in total.
Image
TM²: TrackMania Telemetry Monitor version 1.1.1

User avatar
gouxim
Nadeo
Nadeo
Posts: 1159
Joined: 14 Jun 2010, 17:20

Re: [HOW-TO] Add a bookmark button on your Manialink (XML)

Post by gouxim » 22 Apr 2011, 17:06

Actually only JPG and PNG are supported (DDS is not supported anymore), I updated the guide accordingly.

There may be a small bug with image, I'll look into it next week.
Please do not PM for support. Instead, create a thread so that everyone can contribute or benefit from the answer! 8-)

User avatar
Manowar_bg
Posts: 3
Joined: 26 Jun 2011, 14:43
Contact:

Re: [HOW-TO] Add a bookmark button on your Manialink (XML)

Post by Manowar_bg » 28 Jul 2011, 03:09

Hi
I try to do this but don't works.My Manialink is TrackManiaManowar

I try with this codes:

Code: Select all

<include url="http://maniahome.trackmania.com/add/?url=trackmaniamanowar"/>

Code: Select all

<include url="http://maniahome.trackmania.com/add.php?name=[TrackManiaManowar]&url=[TrackManiaManowar]&picture=[urlimage.jp]"/>
Image
Image

User avatar
gouxim
Nadeo
Nadeo
Posts: 1159
Joined: 14 Jun 2010, 17:20

Re: [HOW-TO] Add a bookmark button on your Manialink (XML)

Post by gouxim » 28 Jul 2011, 10:38

Manowar_bg wrote:Hi
I try to do this but don't works.
The right code is the first one:

Code: Select all

<include url="http://maniahome.trackmania.com/add/?url=trackmaniamanowar"/>
If you want to add a picture:

Code: Select all

<include url="http://maniahome.trackmania.com/add/?url=trackmaniamanowar&picture=http%3A%2F%2Furl.com%2Fof%2Fyour%2Fpicture.jpg"/>
If you still have an error, tell me the exact time at which the error happend to I can check the error logs.
Please do not PM for support. Instead, create a thread so that everyone can contribute or benefit from the answer! 8-)

User avatar
Manowar_bg
Posts: 3
Joined: 26 Jun 2011, 14:43
Contact:

Re: [HOW-TO] Add a bookmark button on your Manialink (XML)

Post by Manowar_bg » 28 Jul 2011, 14:31

thanx,now it works
Image

User avatar
TStarGermany
Posts: 470
Joined: 15 Jun 2010, 11:05
Contact:

Re: [HOW-TO] Add a bookmark button on your Manialink (XML)

Post by TStarGermany » 31 Aug 2011, 16:58

Is this already functional for TM2 ? I just wonder, I always get a "Cannot retrieve the Manialink. http error 403".

User avatar
farfa
Nadeo
Nadeo
Posts: 599
Joined: 14 Jun 2010, 16:15
Location: In front of your hood with one lap late

Re: [HOW-TO] Add a bookmark button on your Manialink (XML)

Post by farfa » 31 Aug 2011, 18:08

We are working on it. It will be back very soon
Also known as: satanasdiabolo

Post Reply

Return to “Ingame Publishing”

Who is online

Users browsing this forum: No registered users and 1 guest