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

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

Moderator: NADEO

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

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

Post by gouxim » 21 Apr 2011, 18:06

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 the PHP Library.
Looking for the same feature without using PHP?
Check out this tutorial!
2 - Requirements

In order to use the ManiaHome library to add a bookmark button you need:
* PHP 5.2

3 - Download the ManiaHome PHP Library

Download the latest version of the ManiaHome SDK at:
http://code.google.com/p/manialib/downloads/list

Then put the maniahome.php file somewhere in your project so you can include it your php files.

4 - Simple button

Let's take an example with the "maniapub" Manialink. The code is so simple I won't even explain it :)

Code: Select all

<?php 

require_once '/path/to/maniahome.php';

echo ManiaHome::bookmarkButton('maniapub'); 

?>
5 - Button with a formatted name

Let's take an example with the "maniapub" Manialink. The code is so simple I won't even explain it :)

Code: Select all

<?php 

require_once '/path/to/maniahome.php';

echo ManiaHome::bookmarkButton('maniapub', '$i$F60ManiaPub'); 

?>
Note the single quotes to avoid interpreting the "$" as PHP variables.

5 - Button with an image

Code: Select all

<?php 

require_once '/path/to/maniahome.php';

echo ManiaHome::bookmarkButton('maniapub', '$i$F60ManiaLive', 
   'http://manialink.manialive.com/images/manialive_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
kroff
Posts: 58
Joined: 15 Jun 2010, 12:34

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

Post by kroff » 23 Apr 2011, 16:34

My question will maybe seem a little bit "silly" but where do I put this code to get the button ?! In a <frame> ?

I just begin with PHP, i tried the XML one but it doesn't work (no image).

Thanks !
Image
Image

Image

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

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

Post by gouxim » 23 Apr 2011, 17:44

kroff wrote:My question will maybe seem a little bit "silly" but where do I put this code to get the button ?! In a <frame> ?

I just begin with PHP, i tried the XML one but it doesn't work (no image).

Thanks !
It will basically print the code of an include tag. So if you want to place it somewhere in your manialink page you can just put it in a frame to specify its position. For example:

Code: Select all

<frame posn="12 15 2">
<?php 

require_once '/path/to/maniahome.php';

echo ManiaHome::bookmarkButton('maniapub'); 

?>
</frame>
Please do not PM for support. Instead, create a thread so that everyone can contribute or benefit from the answer! 8-)

User avatar
steppie
Translator
Translator
Posts: 104
Joined: 25 Apr 2011, 21:55
Location: Denmark
Contact:

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

Post by steppie » 25 Apr 2011, 22:04

Hi

I have problem displaying the bookmark images.
I made a png 400x100, i have checked the link to the images, but it will not show under bookmarks.
What did I do wrong?

/Steppie
Image
.Image

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

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

Post by gouxim » 25 Apr 2011, 23:26

The servers checks if the image exists. can you give me the URL so I can look into the problem?
steppie wrote:Hi

I have problem displaying the bookmark images.
I made a png 400x100, i have checked the link to the images, but it will not show under bookmarks.
What did I do wrong?

/Steppie
Please do not PM for support. Instead, create a thread so that everyone can contribute or benefit from the answer! 8-)

User avatar
steppie
Translator
Translator
Posts: 104
Joined: 25 Apr 2011, 21:55
Location: Denmark
Contact:

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

Post by steppie » 26 Apr 2011, 06:01

gouxim wrote:The servers checks if the image exists. can you give me the URL so I can look into the problem?
Sure here it is: http://unc-crew.dk/unc/images/maniapub.png
Same link I use to my signature image below.
Image
.Image

User avatar
steppie
Translator
Translator
Posts: 104
Joined: 25 Apr 2011, 21:55
Location: Denmark
Contact:

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

Post by steppie » 05 May 2011, 12:26

Any update to this problem?
gouxim wrote:The servers checks if the image exists. can you give me the URL so I can look into the problem?
steppie wrote:Hi

I have problem displaying the bookmark images.
I made a png 400x100, i have checked the link to the images, but it will not show under bookmarks.
What did I do wrong?

/Steppie
Image
.Image

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

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

Post by gouxim » 05 May 2011, 14:02

steppie wrote:Any update to this problem?
We've been very busy lately and we unfortunately didn't had time to look into it yet. I bielieve it should be fixed before sometime next week. I'll keep you posted when we fix it anyways.
Please do not PM for support. Instead, create a thread so that everyone can contribute or benefit from the answer! 8-)

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 (PHP)

Post by farfa » 05 May 2011, 15:52

The problem is now fixed.
Also known as: satanasdiabolo

User avatar
steppie
Translator
Translator
Posts: 104
Joined: 25 Apr 2011, 21:55
Location: Denmark
Contact:

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

Post by steppie » 05 May 2011, 16:14

I see, thank you, keep up the good work :)
Image
.Image

Post Reply

Return to “Ingame Publishing”

Who is online

Users browsing this forum: No registered users and 1 guest