Facebook share icon

Talk about writing modules and plugins for CMS Made Simple, or about specific core functionality. This board is for PHP programmers that are contributing to CMSMS not for site developers
Post Reply
mtaney
New Member
New Member
Posts: 2
Joined: Sun Dec 07, 2008 5:32 am

Facebook share icon

Post 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
Peciura

Re: Facebook share icon

Post 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}'
mel
Forum Members
Forum Members
Posts: 147
Joined: Mon Dec 11, 2006 11:53 pm

Re: Facebook share icon

Post by mel »

Search for "SocialBookmarking" in Forge.
Version 1.6-MLE
Post Reply

Return to “Developers Discussion”