[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: 1188
Joined: 14 Jun 2010, 17:20

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

Post by gouxim »

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 »

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: 1188
Joined: 14 Jun 2010, 17:20

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

Post by gouxim »

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

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

Post by steppie »

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
User avatar
gouxim
Nadeo
Nadeo
Posts: 1188
Joined: 14 Jun 2010, 17:20

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

Post by gouxim »

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

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

Post by steppie »

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
User avatar
steppie
Translator
Translator
Posts: 104
Joined: 25 Apr 2011, 21:55
Location: Denmark

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

Post by steppie »

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
User avatar
gouxim
Nadeo
Nadeo
Posts: 1188
Joined: 14 Jun 2010, 17:20

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

Post by gouxim »

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-)
farfa
Nadeo
Nadeo
Posts: 601
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 »

The problem is now fixed.
Also known as: satanasdiabolo
User avatar
steppie
Translator
Translator
Posts: 104
Joined: 25 Apr 2011, 21:55
Location: Denmark

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

Post by steppie »

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

Return to “Ingame Publishing”

Who is online

Users browsing this forum: No registered users and 1 guest