Facebook Connect Support Thread
#141
Posted 01 November 2011, 20:29
If you have 5 shops you need to register 5 FB accounts, really stupid
#142
Posted 26 November 2011, 00:35
Quote
<tr>
<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
<td align="right"><?php echo tep_image_submit('button_login.gif', IMAGE_BUTTON_LOGIN); ?></td>
<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
</tr>
These lines dont exist in oscommerce 2.3.1 version of login.php ?? There are major changes I think, that require a reword of the files.
Quote
the question is, 'if we do not code, are we really alive?'
-- anonymous
#143
Posted 15 December 2011, 11:53
I'm supprise that OScommerce has not incorporated this into there OS
Ari
#144
Posted 16 December 2011, 11:51
Issue:
Clicking on the fb button in login.php does nothing. -
anyone got this working for 2.3.1?
INSTALLED:Document Manager / Monthly Sales and Tax Returns / Batch Print Invoices / Ultimate HTML EMAILs / AJAX Attribute Manager / OSC PDF Catalog / Move Bookmarks / Sort Order / Easy Populate / Sales Reports / Low Stock Report / Admin: Model # on Category / Product Administration Screen / Mini images in admin / SLiCK reCaptcha / Google + / Beautiful Breadcrumbs / 2.3.1 - Banner Language Mod / ADD New Page / EASY MAP (google) v.3.0 / Who's Online Enhancement for 2.3.1 / Admin Notes / scrambled order number / remove_unused_images / Quantity Select / Unit Weight / Product Specifions (filter results) / AJAX Product Attributes/ Attribute Codes/ Date & Order No. to Invoice/ O.P.I. 2.0 / Attribute Images / Manual Order Editor / Attributes Clone / Order Editor / Create Order / Company VAT No. / Add customer/ CKEditor 2.3.1 / Page Manager / Default images via admin / Percentage Shipping Price / QTPro / Scroll to Top / PDF Invoice / Featured Products / Product Listing Enhancements / AutoBackups / ..Custom Admin Mods /
#145
Posted 17 December 2011, 16:23
Installed as per instructions.
when i click fb button nothing happens.
#146
Posted 19 December 2011, 16:14
#147
Posted 20 December 2011, 21:41
This happens; When I haven't logged into Facebook, nothing happens when I click the buttom. When I am logged into Facebook, I am comming to the logout.php page when I click the login buttom
Anyone have a clue what's wrong?
Cheers
Andreas
#148
Posted 21 December 2011, 08:33
Facebook has recently updated its API and make it compulsory for Facebook Connect applications to use the latest OAuth 2.0. The announcement was made last Tuesday, 13th December 2011 in the official. It is after that date this integration doesnt work.
Some older keys were not configured to support OAuth2.0 upgrades, so I resetted tha Facebook app to have a new 15 character key (the new standard) I also changed this in the database. Since the api key and app ID now is the same, maybe there must be some more changes than just update them in the fbconnect.php file?
Does anyone get connect to work with OSCommerce 2.2 RC2?
//Andreas
#149
Posted 21 December 2011, 09:45
http://developers.fa.../blog/post/614/
https://developers.f.../blog/post/525/
Btw. Now when I did a resetting, nothing happens when I click the fb.button. The same problem for me now with 2.2 RC2 as you before with OScommerce version 2.3.1
Edited by addeaz, 21 December 2011, 09:48.
#150
Posted 22 December 2011, 14:21
addeaz, on 21 December 2011, 09:45, said:
http://developers.fa.../blog/post/614/
https://developers.f.../blog/post/525/
Btw. Now when I did a resetting, nothing happens when I click the fb.button. The same problem for me now with 2.2 RC2 as you before with OScommerce version 2.3.1
I do not know much about php, maybe you can find some other contribution to work in joomla, or any other and adapt to our needs in oscommerce, any news or if someone could make corrections post to the forum, thanks
#151
Posted 22 December 2011, 14:40
this website explains how to integrate facebook connect with your page step by step, gives a link to the requirements for what facebook required.
This perhaps may be of great help for you to tailor them to the contribution of oscommerce
this is the link of the page:
http://www.emenia.es/crear-aplicacion-facebook-phpsdk-oauth/and this is the link of the sample files with the new requirements:https://github.com/facebook/php-sdk/
if I can adapt, or someone manages to do so, post here, please
#152
Posted 27 December 2011, 17:10
- As said before, replace the files in the catalog / includes / classes / files in the src folder downloaded here [url="https://github.com/facebook/php-sdk/"]https://github.com/facebook/php-sdk/ [/ url]
- Then in fbconnect.php
<?php
//Facebook Connect
$fbconfig['appid' ] = ""; //your application id
$fbconfig['api' ] = ""; //your api key
$fbconfig['secret'] = ""; //your application secret
// Create our Application instance.
$facebook = new Facebook(array(
'appId' => $fbconfig['appid'],
'secret' => $fbconfig['secret'],
'cookie' => true,
));
remove the api, which apparently serves no pa na ..
[font="Courier New"]<?php
//Facebook Connect
$fbconfig['appid' ] = ""; //your application id
$fbconfig['secret'] = ""; //your application secret
// Create our Application instance.
$facebook = new Facebook(array(
'appId' => $fbconfig['appid'],
'secret' => $fbconfig['secret'],
));[/font]
AND THEN IN [/font]
[font="Courier New"][font="Courier New"]$session = $facebook->getSession();
$fbme = null;
// Session based graph API call.
if ($session) {
$uid = $facebook->getUser();
$fbme = $facebook->api('/me');
}
?>[/font][/font]
[font="Courier New"]suggesting I changed the link [url] http://developers.facebook.com/blog/post/503 [/ url], replacing $ uid and $ fbme of our old code ...
$uid = $facebook->getUser();[/font]
[font="Courier New"]if ($uid) {
try {
// Procedemos a saber si tenemos a un usuario que se ha identificado en Facebook que está autentificado.
// Si hay algún error se guarda en un archivo de texto (error_log)
$fbme = $facebook->api('/me');
} catch (FacebookApiException $e) {
error_log($e);
$uid = null;
}
}[/font]
[font="Courier New"]?>
good and following the last link [url] http://www.emenia.es/crear-aplicacion-facebook-phpsdk-oauth/ [/ url]
in create_account.php and login.php
<fb:login-button autologoutlink="true" perms="email,offline_access,user_birthday,user_location,user_work_history,user_religion_politics,user_relationships">Login with Facebook</fb:login-button>
remplace by
<fb:login-button autologoutlink="true" scope="email,offline_access,user_birthday,user_location,user_work_history,user_religion_politics,user_relationships">Conectarse con Facebook</fb:login-button>
good try and tell me, Greetings
Edited by juanmasi1, 27 December 2011, 17:23.
#153
Posted 28 December 2011, 09:48
- Descargar el nuevo PHP-SDK de: "https://github.com/facebook/php-sdk/"
- Subir los archivos de la carpeta: "\facebook-php-sdk-4ea94b9\src\" a: "catalog/includes/classes/"
En catalog/fbconnect.php
<?php
// Facebook Connect
$fbconfig['appid' ] = "xxxxxxxxxxxxxxx"; // your application id
$fbconfig['api' ] = ""; // your api key
$fbconfig['secret'] = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"; // your application secret
// Create our Application instance.
$facebook = new Facebook(array(
'appId' => $fbconfig['appid'],
'secret' => $fbconfig['secret'],
'cookie' => true,
));
// We may or may not have this data based on a $_GET or $_COOKIE based session.
// If we get a session here, it means we found a correctly signed session using
// the Application Secret only Facebook and the Application know. We dont know
// if it is still valid until we make an API call using the session. A session
// can become invalid if it has already expired (should not be getting the
// session back in this case) or if the user logged out of Facebook.
$user = $facebook->getUser();
$fbme = null;
// Session based graph API call.
if ($user) {
try {
$uid = $facebook->getUser();
$fbme = $facebook->api('/me');
} catch (FacebookApiException $e) {
echo '<pre>'.htmlspecialchars(print_r($e, true)).'</pre>';
$user = null;
}
}
?>
En catalog/login.php
Ojo!!!! todo debe ir debajo de: require('includes/application_top.php');
require('includes/application_top.php');
// Facebook Connect
include('includes/classes/facebook.php');
include_once('fbconnect.php');
// If user is logged in and session is valid.
if ($fbme) {
// Collect some data using legacy api
$param = array(
'method' => 'users.getinfo',
'uids' => $fbme['id'],
'fields' => 'birthday_date, locale',
'callback' => ''
);
try{
$info = $facebook->api($param);
}
catch(FacebookApiException $e) {
error_log("Legacy Api Calling Error!");
echo '<pre>' . htmlspecialchars(print_r($e, true)) . '</pre>';
$fbme = null;
}
}
<div id="fb-root"></div>
<script type="text/javascript">
window.fbAsyncInit = function() {
FB.init({appId: '<?php echo $fbconfig['appid']; ?>', status: false, cookie: true, xfbml: true, oauth: true});
/* All the events registered */
FB.Event.subscribe('auth.login', function(response) {
// do something with response
login();
});
FB.Event.subscribe('auth.logout', function(response) {
// do something with response
logout();
});
};
(function() {
var e = document.createElement('script');
e.type = 'text/javascript';
e.src = document.location.protocol +
'//connect.facebook.net/es_LA/all.js';
e.async = true;
document.getElementById('fb-root').appendChild(e);
}());
function login(){
document.location.href = "login.php";
}
function logout(){
document.location.href = "logoff.php";
}
function createAccount(){
document.location.href = "create_account.php";
}
</script>
<p>
<fb:login-button autologoutlink="true" scope="email, offline_access, user_birthday, user_location, user_about_me, user_work_history, sms, user_website, user_groups, user_online_presence">Identificarme con Facebook</fb:login-button>
</p>
En catalog/create_account.php
Ojo!!!! todo debe ir debajo de: require('includes/application_top.php');
require('includes/application_top.php');
// Facebook Connect
include('includes/classes/facebook.php');
include_once('fbconnect.php');
// If user is logged in and session is valid.
if ($fbme){
// Collect some data using legacy api
$param = array(
'method' => 'users.getinfo',
'uids' => $fbme['id'],
'fields' => 'birthday_date, locale',
'callback' => ''
);
try{
$info = $facebook->api($param);
}
catch(FacebookApiException $e){
error_log("Legacy Api Calling Error!");
echo '<pre>' . htmlspecialchars(print_r($e, true)) . '</pre>';
$fbme = null;
}
// Convert fb gender
if ($fbme['gender'] == 'female') {
$fbgender = 'f';
}elseif ($fbme['gender'] == 'male') {
$fbgender = 'm';
}
// Convert fb birthday
function fb_birthday($birthday) {
list($m, $d, $a) = explode("/", $birthday);
return $d . "/" . $m . "/" . $a;
}
}
<div id="fb-root"></div>
<script type="text/javascript">
window.fbAsyncInit = function() {
FB.init({appId: '<?php echo $fbconfig['appid' ]; ?>', status: false, cookie: true, xfbml: true, oauth: true});
/* All the events registered */
FB.Event.subscribe('auth.login', function(response) {
// do something with response
login();
});
FB.Event.subscribe('auth.logout', function(response) {
// do something with response
logout();
});
};
(function() {
var e = document.createElement('script');
e.type = 'text/javascript';
e.src = document.location.protocol +
'//connect.facebook.net/es_LA/all.js';
e.async = true;
document.getElementById('fb-root').appendChild(e);
}());
function login(){
document.location.href = "create_account.php";
}
function logout(){
document.location.href = "logoff.php";
}
</script>
<?php if ($fbme) {
} else { ?>
<p>
<fb:login-button autologoutlink="true" scope="email, offline_access, user_birthday, user_location, user_about_me, user_work_history, sms, user_website, user_groups, user_online_presence">Registrarme usando Facebook</fb:login-button>
</p>
<?php } ?>
En catalog/logoff.php debajo de: $cart->reset();
$cart->reset();
// Facebook Connect
include('includes/classes/facebook.php');
include_once('fbconnect.php');
if ($fbme > 0) {
tep_session_unregister('fb_' . $facebook->getAppId() . '_user_id');
tep_session_unregister('fb_' . $facebook->getAppId() . '_code');
tep_session_unregister('fb_' . $facebook->getAppId() . '_access_token');
// setcookie('fbsr_' . $facebook->getAppId(), '', time()-100, '/', '.' . HTTP_COOKIE_DOMAIN);
setcookie('fbsr_' . $facebook->getAppId());
}
Edited by gjferrando, 28 December 2011, 10:01.
#154
Posted 28 December 2011, 10:37
juanmasi1, on 27 December 2011, 17:10, said:
Need to be replaced "$session" per "$user"
#155
Posted 28 December 2011, 11:53
gjferrando, on 28 December 2011, 09:48, said:
- Descargar el nuevo PHP-SDK de: "https://github.com/facebook/php-sdk/"
- Subir los archivos de la carpeta: "\facebook-php-sdk-4ea94b9\src\" a: "catalog/includes/classes/"
En catalog/fbconnect.php
<?php
// Facebook Connect
$fbconfig['appid' ] = "xxxxxxxxxxxxxxx"; // your application id
$fbconfig['api' ] = ""; // your api key
$fbconfig['secret'] = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"; // your application secret
// Create our Application instance.
$facebook = new Facebook(array(
'appId' => $fbconfig['appid'],
'secret' => $fbconfig['secret'],
'cookie' => true,
));
// We may or may not have this data based on a $_GET or $_COOKIE based session.
// If we get a session here, it means we found a correctly signed session using
// the Application Secret only Facebook and the Application know. We dont know
// if it is still valid until we make an API call using the session. A session
// can become invalid if it has already expired (should not be getting the
// session back in this case) or if the user logged out of Facebook.
$user = $facebook->getUser();
$fbme = null;
// Session based graph API call.
if ($user) {
try {
$uid = $facebook->getUser();
$fbme = $facebook->api('/me');
} catch (FacebookApiException $e) {
echo '<pre>'.htmlspecialchars(print_r($e, true)).'</pre>';
$user = null;
}
}
?>
En catalog/login.php
Ojo!!!! todo debe ir debajo de: require('includes/application_top.php');
require('includes/application_top.php');
// Facebook Connect
include('includes/classes/facebook.php');
include_once('fbconnect.php');
// If user is logged in and session is valid.
if ($fbme) {
// Collect some data using legacy api
$param = array(
'method' => 'users.getinfo',
'uids' => $fbme['id'],
'fields' => 'birthday_date, locale',
'callback' => ''
);
try{
$info = $facebook->api($param);
}
catch(FacebookApiException $e) {
error_log("Legacy Api Calling Error!");
echo '<pre>' . htmlspecialchars(print_r($e, true)) . '</pre>';
$fbme = null;
}
}
<div id="fb-root"></div>
<script type="text/javascript">
window.fbAsyncInit = function() {
FB.init({appId: '<?php echo $fbconfig['appid']; ?>', status: false, cookie: true, xfbml: true, oauth: true});
/* All the events registered */
FB.Event.subscribe('auth.login', function(response) {
// do something with response
login();
});
FB.Event.subscribe('auth.logout', function(response) {
// do something with response
logout();
});
};
(function() {
var e = document.createElement('script');
e.type = 'text/javascript';
e.src = document.location.protocol +
'//connect.facebook.net/es_LA/all.js';
e.async = true;
document.getElementById('fb-root').appendChild(e);
}());
function login(){
document.location.href = "login.php";
}
function logout(){
document.location.href = "logoff.php";
}
function createAccount(){
document.location.href = "create_account.php";
}
</script>
<p>
<fb:login-button autologoutlink="true" scope="email, offline_access, user_birthday, user_location, user_about_me, user_work_history, sms, user_website, user_groups, user_online_presence">Identificarme con Facebook</fb:login-button>
</p>
En catalog/create_account.php
Ojo!!!! todo debe ir debajo de: require('includes/application_top.php');
require('includes/application_top.php');
// Facebook Connect
include('includes/classes/facebook.php');
include_once('fbconnect.php');
// If user is logged in and session is valid.
if ($fbme){
// Collect some data using legacy api
$param = array(
'method' => 'users.getinfo',
'uids' => $fbme['id'],
'fields' => 'birthday_date, locale',
'callback' => ''
);
try{
$info = $facebook->api($param);
}
catch(FacebookApiException $e){
error_log("Legacy Api Calling Error!");
echo '<pre>' . htmlspecialchars(print_r($e, true)) . '</pre>';
$fbme = null;
}
// Convert fb gender
if ($fbme['gender'] == 'female') {
$fbgender = 'f';
}elseif ($fbme['gender'] == 'male') {
$fbgender = 'm';
}
// Convert fb birthday
function fb_birthday($birthday) {
list($m, $d, $a) = explode("/", $birthday);
return $d . "/" . $m . "/" . $a;
}
}
<div id="fb-root"></div>
<script type="text/javascript">
window.fbAsyncInit = function() {
FB.init({appId: '<?php echo $fbconfig['appid' ]; ?>', status: false, cookie: true, xfbml: true, oauth: true});
/* All the events registered */
FB.Event.subscribe('auth.login', function(response) {
// do something with response
login();
});
FB.Event.subscribe('auth.logout', function(response) {
// do something with response
logout();
});
};
(function() {
var e = document.createElement('script');
e.type = 'text/javascript';
e.src = document.location.protocol +
'//connect.facebook.net/es_LA/all.js';
e.async = true;
document.getElementById('fb-root').appendChild(e);
}());
function login(){
document.location.href = "create_account.php";
}
function logout(){
document.location.href = "logoff.php";
}
</script>
<?php if ($fbme) {
} else { ?>
<p>
<fb:login-button autologoutlink="true" scope="email, offline_access, user_birthday, user_location, user_about_me, user_work_history, sms, user_website, user_groups, user_online_presence">Registrarme usando Facebook</fb:login-button>
</p>
<?php } ?>
En catalog/logoff.php debajo de: $cart->reset();
$cart->reset();
// Facebook Connect
include('includes/classes/facebook.php');
include_once('fbconnect.php');
if ($fbme > 0) {
tep_session_unregister('fb_' . $facebook->getAppId() . '_user_id');
tep_session_unregister('fb_' . $facebook->getAppId() . '_code');
tep_session_unregister('fb_' . $facebook->getAppId() . '_access_token');
// setcookie('fbsr_' . $facebook->getAppId(), '', time()-100, '/', '.' . HTTP_COOKIE_DOMAIN);
setcookie('fbsr_' . $facebook->getAppId());
}
Corregir catalog/logoff.php
Reemplazar:
// setcookie('fbsr_' . $facebook->getAppId(), '', time()-100, '/', '.' . HTTP_COOKIE_DOMAIN);
setcookie('fbsr_' . $facebook->getAppId());
Por:
unset($_COOKIE['fbsr_' . $facebook->getAppId()]);
setcookie('fbsr_' . $facebook->getAppId(), NULL, -1);
Obs.: Agregar estas dos líneas para que no aparezca en el "log" el error: Unknown algorithm. Expected HMAC-SHA256
Edited by gjferrando, 28 December 2011, 11:54.
#156
Posted 28 December 2011, 14:18
Para que funcione en Internet Explorer, Chrome y Mozilla Firefox (no probé en los otros, pero seguro funciona)
Reemplazar:
document.location.href = "login.php";por:
setTimeout('document.location.href = "login.php"', 0);
owindow.location.reload();por:
setTimeout('document.location.reload()',0);
Edited by gjferrando, 28 December 2011, 14:22.
#157
Posted 28 December 2011, 16:30
#158
Posted 28 December 2011, 20:29
gjferrando, on 28 December 2011, 14:18, said:
Para que funcione en Internet Explorer, Chrome y Mozilla Firefox (no probé en los otros, pero seguro funciona)
Reemplazar:
document.location.href = "login.php";por:
setTimeout('document.location.href = "login.php"', 0);
owindow.location.reload();por:
setTimeout('document.location.reload()',0);
uno hace click en el boton de facebook, popup de facebook requiere los permisos para la app, uno lo acepta, desaparece el popup, se refresca la pagina de create_account y el problema viene acá... no escribe los datos del usuario en el formulario de registro... pero sin embargo si yo refresco de nuevo la pagina Voila!!! si aparecen los datos, podés suponer a que se debe esto?, un abrazo
#159
Posted 29 December 2011, 13:30
juanmasi1, on 28 December 2011, 20:29, said:
uno hace click en el boton de facebook, popup de facebook requiere los permisos para la app, uno lo acepta, desaparece el popup, se refresca la pagina de create_account y el problema viene acá... no escribe los datos del usuario en el formulario de registro... pero sin embargo si yo refresco de nuevo la pagina Voila!!! si aparecen los datos, podés suponer a que se debe esto?, un abrazo
Si, me pasaba lo mismo con Internet Explorer y Mozilla Firefox por eso le agregué el setTimeout('document.location.href = "create_account.php"', 0);
Cuál navegador usas..?
Edited by gjferrando, 29 December 2011, 13:42.
#160
Posted 30 December 2011, 01:47














