DemptD |
|
---|---|
How can i use it on my site?
I have the code for it in my news.tpl, but when i "share" it it doesnt show the news just a link to my site. Is it any way to get it to share the news, forum posts and such? http://www.facebook.com/share_partners.php Facebook: The code: <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><style> 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/images/share/facebook_share_icon.gif?8:26981) no-repeat top right; } html .fb_share_button:hover { color:#fff; border-color:#295582; background:#3b5998 url(http://b.static.ak.fbcdn.net/images/share/facebook_share_icon.gif?8:26981) no-repeat top right; text-decoration:none; } </style> <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> |
Lombi |
|
---|---|
Right, that code shares the URL you're on. If you click on the news post and then share, it will share the news.
You'd need something a bit less simple as that snippet. <a href="http://www.domenlo.com">Surreal Art</a>
|
DemptD |
|
---|---|
Yeah, it shares the current url.
On one site it also has a CMS, dont know what kind he has a Share on facebook button every news item with a link to that news. The url on the share link: http://www.facebook.com/sharer.php?u=http%3A%2F%2Fwww.sommertreff.no%2FNyheter%2Flyd-pa-hjul-til-vartreffet.html The site: http://www.sommertreff.no/ |
Lissbol |
|
---|---|
I just added this code to my page.tpl or whatever .tpl file you want to share.
<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><style> html .fb_share_link { padding:2px 0 0 20px; height:16px; background:url(http://b.static.ak.fbcdn.net/images/share/facebook_share_icon.gif?8:26981) no-repeat top left; border:none; }</style><a href="http://www.facebook.com/share.php?u=<url>" onclick="return fbs_click()" target="_blank" class="fb_share_link">Share on Facebook</a> Same as you posted in your 1st post if you add that to the page.tpl you will have the same as on that other site. LISSBOL Designs
|
DemptD |
|
---|---|
All that comes up in the popup with that code on my site is:
Arctic Gatebil - Bilklubben for Troms og omegn! But on the page/gallery.tpl and such it shows the info about whats on the page. |