Facebook Link for LINKIT bookmarks

Post custom hacks and enhancements for phpwcms here only. Maybe some of these things will be included in official release later.
Post Reply
User avatar
360fusion
Posts: 120
Joined: Wed 30. Aug 2006, 01:15
Location: Yarm, UK
Contact:

Facebook Link for LINKIT bookmarks

Post by 360fusion »

Hi

I have added a link to add webpages to Facebook to add on to the [LINK_IT] tag.


All you need to do is add these lines of code to linkme.php in template/inc_script/frontend_render.

Code: Select all

$bm['service']['facebook']['url']		 = 'http://www.facebook.com/sharer.php?u='.$bm['url'].'&exttitle='.$bm['title'].'&extdesc='.$bm['bodytext'];
$bm['service']['facebook']['alt']		 = 'Facebook';
Download the image for the Facebook icon here:

http://static.ak.facebook.com/images/sh ... f?12:26981

then rename it to facebook and upload it to: template/img/bookmarklets.

the just add {FACEBOOK} to your template or web page with all the other LINKIT tags.

With Facebook the login page should open up in a small window controlled by javascript. I couldn't find a way to add this to the link. If anyone else knows how please let me know.


I have created this by hacking together some code supplied by facebook and mashing it with other code already in linkme.php. I'm not a php expert so if anyone spots any errors please point them out.

face book code

Code: Select all

<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://static.ak.facebook.com/images/share/facebook_share_icon.gif?12:26981) no-repeat top left; }</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>
Hope someone finds this useful.

Ben

<!--DETAIL_ONLY-->
[LINK_IT]
<p>{WONG} {DIGG} {DELICIOUS} {TECHNORATI} {SPURL} {FURL} {YAHOO} {GOOGLE} {MAGNOLIA} {NEWSVINE} {REDDIT} {FACEBOOK}</p>
[/LINK_IT]
User avatar
Oliver Georgi
Site Admin
Posts: 9889
Joined: Fri 3. Oct 2003, 22:22
Contact:

Post by Oliver Georgi »

You code is a bit wrong but Facebook Bookmarklet is now official part of linkme.php.

Code: Select all

	$bm['service']['facebook']['url']	 = 'http://www.facebook.com/sharer.php?u='.$bm['url'].'&t='.$bm['title'];
	$bm['service']['facebook']['alt']	 = 'Share on Facebook';
And rename the icon to "facebook.gif"

Oliver
Oliver Georgi | phpwcms Developer | GitHub | LinkedIn | Систрон
User avatar
360fusion
Posts: 120
Joined: Wed 30. Aug 2006, 01:15
Location: Yarm, UK
Contact:

Post by 360fusion »

Hi Oliver,

Thanks for that, I'll update my current sites and look forward to the next release.

Thanks
Ben
zuker
Posts: 80
Joined: Fri 18. May 2007, 17:13
Location: Lithuania

Re: Facebook Link for LINKIT bookmarks

Post by zuker »

Hi
It would be nice to have bookmarktag {BUZZ} to add webpage link to Google Buzz service.
٩(͡๏̯͡๏)۶
Post Reply