A very common magento facebook login extension:
Belvg_FacebookFree
http://www.magentocommerce.com/magento-connect/facebook-connect-and-like-free.html?
However it is not supporting multi site, so i did some changes to extension its function.
The check existing fb id function only check the fb id if it is unique, without the current store id "where" clause
(1) Add a store_id column to database table 'belvg_facebook_customer'
(2) Add the check existence function in
/app/code/community/Belvg/FacebookFree/controllers/CustomerController.php
in around line 52
$sql = 'SELECT `customer_id`
FROM `' . $tablePrefix .
'belvg_facebook_customer`
WHERE `fb_id` = ' . $me['id'] .
'
AND `store_id` = '.$store_id.'
LIMIT 1';
Add AND `store_id` = '.$store_id.'
(3) Insert the customer id/fb id pair with store id
At around line 71,
$store_id = Mage::app()->getStore()->getStoreId(); // a new variable to save the current store_id
$sql = 'INSERT INTO `' . $tablePrefix . 'belvg_facebook_customer`
VALUES (' . $r['entity_id'] . ', ' . $me['id'] .', '.$store_id. ')';
Add one more column, the store id should be included in the insert clause.
(4) Finished!
then the same fb_id can related to differrent magneto customer Id in different store
Programming language e.g. PHP, JAVASCRIPT, coding, web developing hints and skills applying on mobile device e.g. iphone
2014/04/26
2012/03/23
將Facebook iFrame Tab 設定高度大於 800 Pixels
One of the best things to happen in Facebook development lately was to enable iframe application tabs. This was widely welcomed by developers. However many blog posts wrongly assumed there was a 800 pixel limit on the tab height. Behold, here is the 5000 pixel tab.
New Tab is iFrame Canvas Application
New tab works the same way as iframe canvas application. First load the JavaScript SDK. Easiest is to load it synchronously using a script tag (for production you want to load SDK asynchronously since it gives impression of faster loading page).<script type="text/javascript" src="http://connect.facebook.net/en_US/all.js"></script> <script type="text/javascript" charset="utf-8"> /* Resizing code will be here. */ </script>When JavaScript SDK is loaded you have access to FB.Canvas.setSize and FB.Canvas.setAutoResize methods. If you know the content size wont change later resize the frame only once when page loads.
FB.Canvas.setSize();You can also pass the desired size as parameter.
FB.Canvas.setSize({ width: 520, height: 600 });If content is dynamic and size might change tell Facebook to resize the iframe periodically.
FB.Canvas.setAutoResize();Default is to try resizing every 100ms. If you want to force resizing more often you can pass desired interval as parameter.
FB.Canvas.setAutoResize(50);
Is There a Maximum Limit?
Quick search on Google did not reveal any browser limitation. Theoretically on 32 bit machines maximum page length would be2011/07/26
facebook sharer.php
set icon and description
<link rel="image_src" href="http://icons.iconarchive.com/icons/walrick/openphone/256/Phone-icon.png" />
<meta name="description" content="TESTING: This is the description of my webpage that I really want to have shared on Facebook!" />
<link rel="image_src" href="http://icons.iconarchive.com/icons/walrick/openphone/256/Phone-icon.png" />
<meta name="description" content="TESTING: This is the description of my webpage that I really want to have shared on Facebook!" />
訂閱:
文章 (Atom)