Page 2 of 3
Re: [Maniaplanet] Add the share button on your Manialink
Posted: 19 Apr 2012, 18:12
by Electron
I don't like that the notification will be sent immediately to all buddies without further inquiry.
This time I opened the Manialink maniaflash?gou1 and clicked on all buttons to scrutinize the sense of this Manialink ("ha ha"). Now all my buddies will ask themselves, why I have recommended this page...
Re: [Maniaplanet] Add the share button on your Manialink
Posted: 19 Apr 2012, 18:33
by gouxim
Electron wrote:I don't like that the notification will be sent immediately to all buddies without further inquiry.
This time I opened the Manialink maniaflash?gou1 and clicked on all buttons to scrutinize the sense of this Manialink ("ha ha"). Now all my buddies will ask themselves, why I have recommended this page...
I do agree it's not perfect for now. However to solve your problem: click on the "X" on the bottom right of the notification, and choose "Delete this item". You're buddies won't see it anymore, neither will you.
Re: [Maniaplanet] Add the share button on your Manialink
Posted: 13 May 2012, 13:36
by om23
what u want for your manialink visitors?
1.Click the share button.
Hi, you are about to share this page/content with your buddys, are you sure you want to do that?
2.Yes, I am.
Ok, if you click the Yes Button, then we go to next step.
3.Yes button clicked.
Warning, the message will be postet on all your Buddys events page, click again yes to send it now.
4.Yes.
You share now this page/item with your buddys, click ok to close this message.
5.Ok.
I like the easy one with less clicks, thx
Re: [Maniaplanet] Add the share button on your Manialink
Posted: 07 Jun 2012, 13:55
by om23
hi, it´s me again :p
how to set a custom style or image on the share button?
to set it I used:
Code: Select all
echo " <frame posn='0 0' >";
echo " <quad sizen='8 6' posn='9 -81 3' manialink='http://maniahome.maniaplanet.com/share/?link=$manialink:blabla?$simplename&contentName=whatever' style='Icons128x128_1' substyle='Share'/>"; echo "\n";
echo " </frame>"; echo "\n";
but this results in a message after click it: invalid manialink
and before the click I see the link, it looks diferent to the included url button link.
info edit: the original include url shows the link urlencoded after the
Code: Select all
<include url="http://maniahome.maniaplanet.com/share/?link=
but at the quad it is not encoded.
thx
Re: [Maniaplanet] Add the share button on your Manialink
Posted: 14 Jun 2012, 13:08
by om23
no help?

Re: [Maniaplanet] Add the share button on your Manialink
Posted: 14 Jun 2012, 13:17
by gouxim
First the link is wrong. The link you are using write now is the link of the include to display the button. What you need instead is the link when you click the button in that particular include:
Code: Select all
http://maniahome.maniaplanet.com/share/send/
Another problem is the encoding of the parameters, and also the encoding of the string inside the xml attribute. Let's do it step by step:
Code: Select all
$url = 'http://maniahome.maniaplanet.com/share/send/'; // Base URL
$params = array('link' => $manialink.'blabla', 'contentName' => 'whatever'); // Parameters
$url = $url.'?'.http_build_query($params); // Automatically escapes the parameters
$url = htmlentities($url, ENT_QUOTES, 'UTF-8'); // Escapes the string to use it in a XML attribute
echo "<quad sizen='8 6' posn='9 -81 3' manialink='$url' style='Icons128x128_1' substyle='Share'/>";
Re: [Maniaplanet] Add the share button on your Manialink
Posted: 14 Jun 2012, 15:56
by om23
ty,
the encoding works good, but on click it says: Undefined parameter: link
the link is the url or not?
Re: [Maniaplanet] Add the share button on your Manialink
Posted: 14 Jun 2012, 16:02
by gouxim
Yes indeed. Previous post fixed.
Re: [Maniaplanet] Add the share button on your Manialink
Posted: 14 Jun 2012, 16:07
by om23
I just tryed to change it to manialink but not link xD
and...
you can also change the 'contentName' into 'message' xD
edit: thanx, it works

Re: [Maniaplanet] Add the share button on your Manialink
Posted: 09 Oct 2012, 18:30
by kroff
Yop !
I tried to add this button for ManiaPress tonight but... it didn't work because I'm a noob ! Actually, I tried to code it as I could and I got this :
Code: Select all
Manialink::beginFrame(0,-10, 0.2);
{
$http = (!empty($_SERVER['HTTPS'])) ? "https://".$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI']: "http://".$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI'];
$url = 'http://maniahome.maniaplanet.com/share/?link='.$http.'&contentName='.maniapress_html_filter(the_title('', '', false));
$ui = new Label (30, 10);
$ui->setStyle(Label::TextButtonNav);
$ui->setText('Partager');
$ui->setUrl($url);
$ui->save();
}
Manialink::endFrame();
I was quite proud not to have the error http 500 at first but then, when I clicked on it, it just redirects
there !
So I don't know why it doesn't work and some help is very welcomed !
EDIT : Finally I found something good and here's the code for people who want/need that feature on their Manialink :
Code: Select all
Manialink::beginFrame(X, Y, Z);
{
$url = 'http://maniahome.maniaplanet.com/share/?link=YourManiaLink&contentName='.maniapress_html_filter(the_title('', '', false));
$ui = new \ManiaLib\Gui\Elements\IncludeManialink();
$ui->setUrl($url);
$ui->save();
}
Manialink::endFrame();
