'185629361512225', 'secret' => 'c83a02b02fcc07d654a11d567b7234ea', )); $user = $facebook->getUser(); /* if($website_statut==1){ $user_profile = $facebook->api('/me'); print_r($user_profile); } */ if ($user && !$_SESSION['VIsess']) { try { $user_profile = $facebook->api('/me'); //print_r($user_profile); $req="SELECT * FROM utilisateurs WHERE facebook_id='".$user_profile['id']."'"; $res=mysql_query($req); $row=mysql_num_rows($res); if(!$row){ $req="INSERT INTO utilisateurs (nomutilisateurs, prenomutilisateurs, facebook_id, level) VALUES ('".$user_profile['last_name']."','".$user_profile['first_name']."','".$user_profile['id']."', 3)"; mysql_query($req); }else{ $req="UPDATE utilisateurs SET nomutilisateurs='".$user_profile['last_name']."', prenomutilisateurs='".$user_profile['first_name']."' WHERE facebook_id='".$user_profile['id']."'"; mysql_query($req); } $req="SELECT * FROM utilisateurs WHERE facebook_id='".$user_profile['id']."'"; $res=mysql_query($req); $_SESSION['VIsess']=mysql_fetch_array($res); } catch (FacebookApiException $e) { $user = null; } } // FACEBOOK CONNECT END if($website_statut==2){ if($rub=='fiche' && ($_GET['id']!=$_SESSION['VIsess']['lieu']['ID'] OR !$_GET['id']) ){ if($_GET['id']==101){ }elseif($_SESSION['VIsess']['lieu']['ID']){ header('LOCATION: index.php?rub=fiche&id='.$_SESSION['VIsess']['lieu']['ID']); }else{ header('LOCATION: index.php?rub=ajouterunlieu&step=1'); } } if($rub=='ajouterunlieu'){ if(!$_SESSION['VIsess'] && $_GET['step']>1){ header('LOCATION: index.php?rub=ajouterunlieu&step=1'); } if(!$_SESSION['VIsess']['lieu']['ID'] && $_GET['step']>2){ header('LOCATION: index.php?rub=ajouterunlieu&step=2'); } } if($rub!='fiche' && $rub!='vieprivee' && $rub!='cgv' && $rub!='contact' && $rub!='ajouterunlieu'){ if($_SESSION['VIsess']['lieu']['ID']){ header('LOCATION: index.php?rub=fiche&id='.$_SESSION['VIsess']['lieu']['ID']); }elseif($_SESSION['VIsess']['idutilisateurs']){ if($_SESSION['VIsess']['lieu']){ header('LOCATION: index.php?rub=fiche&id='.$_SESSION['VIsess']['lieu']['ID']); }else{ header('LOCATION: index.php?rub=ajouterunlieu&step=2'); } }else{ header('LOCATION: index.php?rub=ajouterunlieu&step=1'); } }elseif($rub=='fiche' && !$_SESSION['VIsess'] && $_GET['id']!=101){ header('LOCATION: index.php?rub=ajouterunlieu&step=1'); } } include('functions.php'); require("function_tmp.php"); ?>
VacInso.com - Le portail des lieux de vacances insolites et hébergements originaux !
: