Friday, May 10, 2024
132
rated 0 times [  133] [ 1]  / answers: 1 / hits: 13272  / 10 Years ago, thu, march 20, 2014, 12:00:00

I am new to facebook app development. I want users to share contents from my website on their wall. I got share plugin code from facebook development docs. But when I embed that code, it shows social plugin related info on share window.



<div class=fb-share-button data-href=https://developers.facebook.com/docs/plugins/ data-type=button_count></div>


I think it is because data-href attribute value. If yes, then please help me to know how this attribute is used. If there is any other way to achieve this task, please let me know.


More From » facebook-graph-api

 Answers
2

if you can find solution for PHP then this answer will help you:



Add this in html head section:



<meta property=og:title content=Content titile />
<meta property=og:image content=image ulr path />
<meta property=og:url content=url of page />
<meta property=og:description content=your content />


Add this in script:



<?php
$title=urlencode('Content title');
$url= urlencode('url of page');
$summary=urlencode(Content you can dynamically display like: (E.g.: Time:.(($usertime < 3600)?($usertime.' Seconds'): (round($usertime/60, 2)). Minutes, Points.$userscore.) ) );
$image=urlencode('image url path to display image');
?>


code for link button to share



  <a onClick=window.open('http://www.facebook.com/sharer.php?s=100&amp;p[title]=<?php echo $title;?>&amp;p[summary]=<?php echo $summary;?>&amp;p[url]=<?php echo $url; ?>&amp;p[images][0]=<?php echo $image;?>','sharer','toolbar=0,status=0,width=550,height=300'); href=javascript: void(0)>

[#46694] Wednesday, March 19, 2014, 10 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
tayaw

Total Points: 749
Total Questions: 88
Total Answers: 86

Location: Djibouti
Member since Sun, Feb 27, 2022
2 Years ago
tayaw questions
;