Page 1 of 1

Facebook share icon

Posted: Sun Sep 27, 2009 4:50 pm
by mtaney
Can someone direct me to a post on how to include the Facebook share icon and script?

I have searched the forums and can't find anything.  There is a post by JeremyBass, but I need more instructions than provided there. 

I have a handful of sites that I've created with CMS Made Simple, so I do know how to open and edit pages, themes, and stylesheets. 

Here is the code I got from Facebook which would display the Facebook icon and the phrase Shrare on Facebook.
I would replace u= with u=.

I have attempted to place this code in various places and always get smarty errors.

function fbs_click() {u=location.href;t=document.title;window.open('http://www.facebook.com/sharer.php?u='+ ... height=436');return false;} html .fb_share_button { display: -moz-inline-block; display:inline-block; padding:1px 20px 0 5px; height:15px; border:1px solid #d8dfea; background:url(http://b.static.ak.fbcdn.net/rsrc.php/z ... 73uaqa.gif) no-repeat top right; } html .fb_share_button:hover { color:#fff; border-color:#295582; background:#3b5998 url(http://b.static.ak.fbcdn.net/rsrc.php/z ... 73uaqa.gif) no-repeat top right; text-decoration:none; } " class="fb_share_button" onclick="return fbs_click()" target="_blank" style="text-decoration:none;">Share

Re: Facebook share icon

Posted: Sun Sep 27, 2009 6:55 pm
by Peciura
This one should go to ypur stylesheet

Code: Select all

html .fb_share_button {
   display: -moz-inline-block;
   display:inline-block; 
   padding:1px 20px 0 5px;
   height:15px; 
   border:1px solid #d8dfea; 
   background:url(http://b.static.ak.fbcdn.net/rsrc.php/zAB5S/hash/4273uaqa.gif) no-repeat top right; 
} 
html .fb_share_button:hover {
   color:#fff; border-color:#295582; 
   background:#3b5998 url(http://b.static.ak.fbcdn.net/rsrc.php/zAB5S/hash/4273uaqa.gif) no-repeat top right;   
   text-decoration:none; 
}


This one goes to the top of  bage body in your  template

Code: Select all

{literal}
<__script__  type="text/javascript">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>
{/literal}
And this one - anywhere you want "share" link to apear.

Code: Select all

<a href="http://www.facebook.com/share.php?u=<url>" class="fb_share_button" onclick="return fbs_click()" target="_blank" style="text-decoration:none;">Share</a>
You may want to create User defined tag "my_url"

Code: Select all

return 'http://www.'.$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI'];
and replace '' with '{my_url}'

Re: Facebook share icon

Posted: Mon Sep 28, 2009 12:24 am
by mel
Search for "SocialBookmarking" in Forge.