Topic-icon Manual share on Timeline

Active Subscriptions:

None
11 years 2 weeks ago #32142 by acexgames
Hi,

Is it possible to configure a button to share on timeline? I've configured the "Like Button" and the "Send to Friends Button" however, did not find anything related to share on timeline, except for the automatic posts (using actions).

Could you please let me know how to display a button "Share on timeline"?

Regards,
Rafael
The topic has been locked.
Support Specialist
11 years 2 weeks ago #32148 by alzander
Replied by alzander on topic Manual share on Timeline
There's a few different ways to do that. If it's a specific 'action' you want to implement for certain pages of your site, like "John enjoyed xyz" or "Rafael cooked a recipe", that would be implemented with Open Graph Actions. Those are a little more complex to implement, but very specific and don't require any popups for the user.. they just click a button and it posts the 'action' to their Timeline.

Alternatively, you can create a simple button that will popup a feed post box for the user to add a comment and post the share to their timeline. To do so, you'd just want to add the following code to your page, template, or a custom module:
<a href="javascript:void(0);" onclick="jfbc.social.feedPost("Title of the page","A caption for this post","A pre-filled description for the page that the user will be able to edit",window.location,'http://yoursite.com/link-to-an-image.jpg')><img src="http://yoursite.com/post-to-wall-button.jpg" /></a>
Hopefully, those fields above make sense, but if you have questions, just let me know.

Best of luck,
Alex
The topic has been locked.
Active Subscriptions:

None
11 years 2 weeks ago #32150 by acexgames
Replied by acexgames on topic Manual share on Timeline
Thanks for your quick reply, Alex

So, using Open Graph Actions... the user in my website can generate coupons (discounts) to be used in partners (restaurants, etc).

There is a button "Generate Coupon" which invokes generate_coupon.php... which will handle all the coupon generation.

I've created in FB Open Graph, an object (COUPON) and an action (GENERATE)...

Could you please explain me how to configure the button click event to automatically post in timeline something like: "Rafael has generated a coupon in website XYZ". ?

Another (stupid :-)))) question: I have no plugins enable for Open Graph in my Joomla... (please check the picture below)... from where I need to download, and exactly which one should I install?

screencast.com/t/rtJXE1eA

Kind Regards,
Rafael
The topic has been locked.
Active Subscriptions:

None
11 years 1 week ago #32263 by acexgames
Replied by acexgames on topic Manual share on Timeline
Hi alzander,

Any news? Thanks again for your support.

Kind Regards,
Rafael Diel
The topic has been locked.
Support Specialist
11 years 1 week ago #32270 by alzander
Replied by alzander on topic Manual share on Timeline
Rafael,
Sorry for the delay. Your question is a bit more complex in JFBConnect than we'd like it to be.. something we're working on improving in an upcoming release.

For now, you'd want to install the Open Graph - Custom plugin, which is in the main JFBConnect zip file you download from this site in the 'opengraph' directory of that package.

Then, create an 'object' in the Open Graph area of type "Custom". Set the type as "coupon" (or whatever you want it to be. In the righthand side for query parameters, set the values for your custom component, like:
option=com_coupons
view=coupon

With that, on each coupon page, JFBConnect will set the og:type tag of 'coupon'.

Next, create a custom 'action'. The action type would be "generate". Set the action type to "Manual" and make sure it's associated with the 'coupon' object you created. Save and note the ID number of the action (likely '1'). Then, on your page that generates the coupon, add a button like:
<a href="#" onclick="jfbc.opengraph.triggerAction('1','http://site.com/link-to-coupon-page')"><img src="http://site.com/button-image.jpg" /></a>
Update the '1' there to the actual action id.

When clicked, that should trigger the action on the page and show the blue box popup that an action has posted to the timeline.

I hope that helps, but obviously test and let us know how it goes.

Thanks,
Alex
The topic has been locked.
Active Subscriptions:

None
11 years 1 week ago #32272 by acexgames
Replied by acexgames on topic Manual share on Timeline
Thanks again for your help...

However, the action should be triggered while clicking in a button, which is available in a Jumi module (with PHP code).

For this reason, there is no com_<coupon> or something like this.

I should use com_jumi ? And what I should write in the view parameter?

Kind Regards,
Rafael Diel
The topic has been locked.
Active Subscriptions:

None
11 years 1 week ago #32275 by acexgames
Replied by acexgames on topic Manual share on Timeline
echo 'Você ainda pode gerar 4 cupons deste estabelecimento no mês corrente. Pressione o botão "Gerar Cupom" caso deseje usufruiu do seu benefício nos próximos dois dias. Lembre-se de que, após gerado, o seu cupom tem validade de 48 horas.Gerar CupomGerar CupomGerar CupomGerar Cupom';

This is the code which is available in the page to generate coupons (with 4 buttons)... I did change only the first button, as you can see above. Can you check if it is correct?

Regards,
Rafael
The topic has been locked.
Active Subscriptions:

None
11 years 1 week ago #32276 by acexgames
Replied by acexgames on topic Manual share on Timeline

acexgames wrote:

echo 'Você ainda pode gerar 4 cupons deste estabelecimento no mês corrente. Pressione o botão "Gerar Cupom" caso deseje usufruiu do seu benefício nos próximos dois dias. Lembre-se de que, após gerado, o seu cupom tem validade de 48 horas.Gerar CupomGerar CupomGerar CupomGerar Cupom';

This is the code which is available in the page to generate coupons (with 4 buttons)... I did change only the first button, as you can see above. Can you check if it is correct?

Regards,
Rafael



The code is not correct in the previous post... trying again:
echo '<center><table><tbody><tr><td width="20%"><center><img src="images/coupon_novo.png" /></center></td><td width="20%"><center><img src="images/coupon_novo.png" /></center></td><td width="20%"><center><img src="images/coupon_novo.png" /></center></td><td width="20%"><center><img src="images/coupon_novo.png" /></center></td><td width="20%"><h5><center><p class="info">Voc&ecirc; ainda pode gerar 4 cupons deste estabelecimento no m&ecirc;s corrente. Pressione o bot&atilde;o "Gerar Cupom" caso deseje usufruiu do seu benef&iacute;cio nos pr&oacute;ximos dois dias.</p> <p class="error">Lembre-se de que, ap&oacute;s gerado, o seu cupom tem validade de 48 horas.</p></center></h5></td></tr><tr><td width="20%"><center><a class="btn btn-info" href="#" onclick="jfbc.opengraph.triggerAction("1","gerar_cupom.php?data='.$today.'&user='.$userId.'&estab='.$itemid.'")">Gerar Cupom</a></center></td><td width="20%"><center><a class="btn btn-info" href="gerar_cupom.php?data='.$today.'&user='.$userId.'&estab='.$itemid.'">Gerar Cupom</a></center></td><td width="20%"><center><a class="btn btn-info" href="gerar_cupom.php?data='.$today.'&user='.$userId.'&estab='.$itemid.'">Gerar Cupom</a></center></td><td width="20%"><center><a class="btn btn-info" href="gerar_cupom.php?data='.$today.'&user='.$userId.'&estab='.$itemid.'">Gerar Cupom</a></center></td><td width="20%"></td></tr></tbody></table></center>';
The topic has been locked.
Support Specialist
11 years 1 week ago #32294 by alzander
Replied by alzander on topic Manual share on Timeline
Rafael,
A few questions:

However, the action should be triggered while clicking in a button, which is available in a Jumi module (with PHP code).

The code above should work for that with a little modification. Basically, you'll update the onclick call to call our code and *then* redirect to the page you want. However, that page you're redirecting to will have to be a Joomla page of some sort. JFBConnect only knows about "Joomla", so if you're generating that page outside of Joomla, there will likely be issues as we won't be able to assign the object stuff to the coupon page. Our logic also checks to make sure that the action you're trying to trigger is properly associated with the object, which would fail (and stop the posting) if your page isn't in Joomla.

Can you explain more about how your extension/coupon creation is working?

As for the code you posted:
onclick="jfbc.opengraph.triggerAction("1","gerar_cupom.php?data='.$today.'&user='.$userId.'&estab='.$itemid.'")
You need to use a full URL, like: yoursite.com/gerar_cupom.php?data=1010&user=123&estab=1. The parameters should be fine, just hard-code the http://... portion in there.

Let me know more about the creation process and we'll see what we can do.

Thanks,
Alex
The topic has been locked.
Active Subscriptions:

None
11 years 1 week ago #32298 by acexgames
Replied by acexgames on topic Manual share on Timeline
Hi Alex

The issue is related to the "#" in the href clause... when I click in the button, the page is refreshed...

Let me explain to you about the modules, and the gerar_cupom.php

The page has some joomla modules (custom_html)... the bottom module is a JUMI module, which uses a "cupom.php" file...

The buttons to generate the coupons are located in this cupom.php, with the code below:
echo '<td width="20%"><center><a class="btn btn-info" href="#" onclick="jfbc.opengraph.triggerAction("1","http://www.mydomain.com.br/gerar_cupom.php?data='.$today.'&user='.$userId.'&estab='.$itemid.'")">Gerar Cupom</a></center></td>';

It means, when I click in the button "Gerar Cupom", it should invoke the "gerar_cupom.php" (which is not a Joomla com) and, in the end, redirects the user to the previous page.

Let me know if it's clear.

Regards,
Rafael
The topic has been locked.