Happy New Year has you all without forgetting our moderators friends ..
Module Connect with Facebook ,
Для просмотра ссылки Войди или Зарегистрируйся
To have a button on header :
First create a file connect_top.tpl with in :
{if $fbconnect_link}
<a href="{$fbconnect_link|escape}" title="{$fbconnect_title|escape}" >
Connexion Facebook
</a>
{/if}
Then in the file fb connect.php add in the install function
A line below rightCollumn :
!$this->registerHook(top) ||
Then always in the same file after the function :
public function hookRightColumn($params)
{
return $this->hookLeftColumn($params);
}
Add a function :
public function hookTop($params)
{
$logout_url= $this->context->smarty->tpl_vars['base_dir']->value .'modules/fbconnect/logout.php';
$login_url= $this->context->smarty->tpl_vars['base_dir']->value .'modules/fbconnect/login.php';
$fbconnect_result=$this->fbconnect($logout_url,$login_url);
if ($fbconnect_result!=false) {
if ($fbconnect_result['facebook_loginUrl']<>'' and !$this->context->customer->isLogged()) {
$fbconnect_link=$fbconnect_result['facebook_loginUrl'];
$fbconnect_logout='';
$fbconnect_email='';
$fbconnect_firstname='';
$fbconnect_lastname='';
$fbconnect_gender='';
$fbconnect_image='facebook_connect_fr.png';
} elseif ($fbconnect_result['facebook_loginUrl']<>'' and $this->context->customer->isLogged()) {
$fbconnect_link='';
$fbconnect_logout='';
$fbconnect_email='';
$fbconnect_firstname='';
$fbconnect_lastname='';
$fbconnect_gender='';
$fbconnect_image='';
} else {
$fbconnect_link='';
$fbconnect_logout=$fbconnect_result['facebook_logoutUrl'];
$fbconnect_email=$fbconnect_result['facebook_email'];
$fbconnect_firstname=$fbconnect_result['facebook_firstname'];
$fbconnect_lastname=$fbconnect_result['facebook_lastname'];
$fbconnect_gender=$fbconnect_result['facebook_gender'];
$fbconnect_image='facebook_logout_fr.png';
}
$this->smarty->assign(array(
'fbconnect_title' => Configuration::get('PS_FBCONNECT_TITLE'),
'fbconnect_title_logout' => 'Déconnexion Facebook',
'fbconnect_image' => $fbconnect_image,
'fbconnect_link' => $fbconnect_link,
'fbconnect_logout' => $fbconnect_logout
));
return $this->display(__FILE__, 'connect_top.tpl');
}
}