Latest News: (loading..)
Add to facebook link
Started by tractormad, Nov 13 2007, 14:24
9 replies to this topic
#1
Posted 13 November 2007, 14:24
There is a facility of facebook where you can have a link on your site to facebook, and when the user clicks it, it adds the url to the users facebook account....thus allowing 30million people to see it;
Anyway, the code facebook provide looks like this;
--------------
<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,hei
ght=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>
---------------
Im thinking of placing it instead of my REVIEWS button (which isnt used), in product_info.php
Can anyone make a stab at how this code would need editing to work on product_info.php and return the correct URL?
Anyway, the code facebook provide looks like this;
--------------
<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,hei
ght=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>
---------------
Im thinking of placing it instead of my REVIEWS button (which isnt used), in product_info.php
Can anyone make a stab at how this code would need editing to work on product_info.php and return the correct URL?
#2
Posted 23 August 2009, 15:22
tractormad, on Nov 13 2007, 10:24 AM, said:
There is a facility of facebook where you can have a link on your site to facebook, and when the user clicks it, it adds the url to the users facebook account....thus allowing 30million people to see it;
Anyway, the code facebook provides looks like this;
--------------
<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,hei
ght=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>
---------------
Im thinking of placing it instead of my REVIEWS button (which isnt used), in product_info.php
Can anyone make a stab at how this code would need editing to work on product_info.php and return the correct URL?
Anyway, the code facebook provides looks like this;
--------------
<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,hei
ght=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>
---------------
Im thinking of placing it instead of my REVIEWS button (which isnt used), in product_info.php
Can anyone make a stab at how this code would need editing to work on product_info.php and return the correct URL?
Find
<?php echo '<a href="' . tep_href_link(FILENAME_PRODUCT_REVIEWS, tep_get_all_get_params()) . '">' . tep_image_button('button_reviews.gif', IMAGE_BUTTON_REVIEWS) . '</a>'; ?>
Then, Make a small Facebook Banner in Photoshop, or Paint, similar to [img]http://www.tboltusa.com/709images/addTBoltonFacebook.png[/img]
then go to your page, and copy your page's URL. It should look something like
http://www.facebook.com/profile.php?id=672481566 Or [url="http://www.facebook.com/utensil"]http://www.facebook.com/utensil[/url]
Then replace the first code I had you find on Product_info.php with
<a href="http://www.facebook.com/YOUR_URL"><img src="http://www.tboltusa.com/709images/addTBoltonFacebook.png?YOUR_HOSTED_IMAGE"></a>
A little knowledge of php goes a long way.
#3
Posted 26 August 2009, 12:10
I added a facebook link today to my store, I didnt bother with coding I just used a banner and linked the banner image to my facebook group url. Much easier, I found. Take a look here www.styleme4less.com.au
Hope this helps
Hope this helps
#4
Posted 11 January 2010, 00:03
panicgripdesigns, on 23 August 2009, 15:22, said:
Find
Then, Make a small Facebook Banner in Photoshop, or Paint, similar to [img]http://www.tboltusa.com/709images/addTBoltonFacebook.png[/img]
then go to your page, and copy your page's URL. It should look something like
Then replace the first code I had you find on Product_info.php with
<?php echo '<a href="' . tep_href_link(FILENAME_PRODUCT_REVIEWS, tep_get_all_get_params()) . '">' . tep_image_button('button_reviews.gif', IMAGE_BUTTON_REVIEWS) . '</a>'; ?>
Then, Make a small Facebook Banner in Photoshop, or Paint, similar to [img]http://www.tboltusa.com/709images/addTBoltonFacebook.png[/img]
then go to your page, and copy your page's URL. It should look something like
http://www.facebook.com/profile.php?id=672481566 Or [url="http://www.facebook.com/utensil"]http://www.facebook.com/utensil[/url]
Then replace the first code I had you find on Product_info.php with
<a href="http://www.facebook.com/YOUR_URL"><img src="http://www.tboltusa.com/709images/addTBoltonFacebook.png?YOUR_HOSTED_IMAGE"></a>
I still cannot get the facebook link to post. I have done all of the changes that you put up, but I don't see any difference on my website. Should i change something other than the product_info.php?
This is my signature.
#5
Posted 11 January 2010, 00:38
gruntstyle, on 11 January 2010, 00:03, said:
I still cannot get the facebook link to post. I have done all of the changes that you put up, but I don't see any difference on my website. Should i change something other than the product_info.php?
http://www.facebook.com/share.php?u=http://www.yoursite.com&title=yoursitename
Use whatever graphic you want.
Edited by mdtaylorlrim, 11 January 2010, 00:38.
Avoid the most asked question. See How to Secure My Site and How do I...?
#6
Posted 10 November 2010, 00:00
Does anyone know a way of tracking if they actually shared the link so you could reward them e.g with a coupon?
Kym
We support qdPM Open Framework Project Management
We support qdPM Open Framework Project Management
#7
Posted 23 February 2011, 01:18
Did you get this working yet?
#8
Posted 08 June 2011, 08:35
Hi,
Where can I find the product_php? I also want to place the Facebook link on homepage of website. I dont know how to find these things. Need help.
Where can I find the product_php? I also want to place the Facebook link on homepage of website. I dont know how to find these things. Need help.
#9
Posted 02 November 2011, 03:28
This is my own solution to adding a custom facebook share button on the product_info.php file:
<?php $prodlink = 'http://'.$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI'];?>
<?php $prodimage = 'http://'.$_SERVER['SERVER_NAME'].'/'.DIR_WS_IMAGES . $product_info['products_image'];?>
<a href="http://www.facebook.com/sharer.php?s=100&p[title]=<?php echo $title;?>&p[summary]=<?php echo $tags_array['desc'] ?>&p[url]=<?php echo $prodlink;?>&p[images][0]=<?php echo $prodimage;?> "target="blank"><img src="../images/custom_images/bb-fb.png" width="14" height="14" border="0" alt="Share on Facebook"></a>
Hope this helps someone. All the best - Dave Roberts - cycleridr@gmail.com
<?php $prodlink = 'http://'.$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI'];?>
<?php $prodimage = 'http://'.$_SERVER['SERVER_NAME'].'/'.DIR_WS_IMAGES . $product_info['products_image'];?>
<a href="http://www.facebook.com/sharer.php?s=100&p[title]=<?php echo $title;?>&p[summary]=<?php echo $tags_array['desc'] ?>&p[url]=<?php echo $prodlink;?>&p[images][0]=<?php echo $prodimage;?> "target="blank"><img src="../images/custom_images/bb-fb.png" width="14" height="14" border="0" alt="Share on Facebook"></a>
Hope this helps someone. All the best - Dave Roberts - cycleridr@gmail.com
#10
Posted 02 November 2011, 12:46
what happened if you use, the facebook share from 2.3.??..
or
or use wibya tool bar?
or
or use wibya tool bar?
Edited by axioma, 02 November 2011, 12:47.














