Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

All other Modules /

Discuss all other Modules here.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

ShareThis module with Facebook?


Go to End


2 Posts   2886 Views

Avatar
Optimuz

Community Member, 1 Post

14 May 2009 at 2:12am

Hi I'm new to the forums, and I'm also new to the whole silverstripe programming. I don't have much of a PHP knowledge, and I've been trying to get the facebook share working on the sharethis module.

I've managed to get it working by editing the config file in the ShareThis module:

"facebook"=> array(
"url"=>"http://www.facebook.com/sharer.php?" .htmlentities("u=$page_url&title=$page_title&"),
"title" => "Facebook"),

But the advice I need is how do I make it perform like the coding facebook has given below:

<script>function fbs_click() {u=location.href;t=document.title;window.open('http://www.facebook.com/sharer.php?u='+encodeURIComponent(u)+'&t='+encodeURIComponent(t),'sharer','toolbar=0,status=0,width=626,height=436');return false;}</script><a href="http://www.facebook.com/share.php?u=<url>" onclick="return fbs_click()" target="_blank">Share on Facebook</a>

I've been trying to work on this for 12 hours, and I'm lost on how to input the java to open in a new window. I'm only good at html, but as far as PHP knowledge it's pretty bad. So if anyone would like to help me it would be much appreciated.

Thanks!

Avatar
TotalNet

Community Member, 181 Posts

13 July 2009 at 12:52pm

I was searching the forum to find anyone who has used this module, did you get it working?
I'm using a free bit of code from www.addthis.com put in page.ss but don't really like using a third party to do this. Will have a go with Share This on my dev server in a bit but would like to hear from anyone who's using it.

Cheers,

Rich