Author Topic: Etano facebook connect  (Read 19601 times)

csibusz

  • Prime Member
  • ****
  • Posts: 166
  • Karma: +17/-2
Etano facebook connect
« on: June 25, 2014, 01:26:40 PM »
wdd-sample.php post data mysql database

wdd-sample.php
Code: [Select]
<?php
require_once("src/facebook.php");

   
$config = array(
      
'appId' => '......',
      
'secret' => '.......',
      
'fileUpload' => false// optional
      
'allowSignedRequest' => false// optional, but should be set to false for non-canvas apps
  
);

  
$facebook = new Facebook($config);
  
$user_id $facebook->getUser();
  if(
$user_id) {

          
// We have a user ID, so probably a logged in user.
          // If not, we'll get an exception, which we handle below.
          
try {
    
            
$user_profile $facebook->api('/me','GET');

$_SESSION['a']=print_r($user_profile);
echo $_SESSION['a'];

            echo 
"<pre>";
            
$age $user_profile ;
            echo 
"</pre>";
             echo 
$age['name'];
          } catch(
FacebookApiException $e) {
            
// If the user is logged out, you can have a 
            // user ID even though the access token is invalid.
            // In this case, we'll get an exception, so we'll
            // just ask the user to login again here.
            
$login_url $facebook->getLoginUrl(); 
            echo 
'Please <a href="' $login_url '">login.</a>';
            
error_log($e->getType());
            
error_log($e->getMessage());
          }   
    } else {
          
// No user, print a link for the user to login
          
$login_url $facebook->getLoginUrl();
          echo 
'No Log. Please <a href="' $login_url '">login.</a>';

    }
?>


Marble

  • Global Moderator
  • Veteran Member
  • *****
  • Posts: 965
  • Karma: +56/-7
Re: Etano facebook connect
« Reply #1 on: June 26, 2014, 12:23:52 PM »
Can you give instructions on how to add this to a site?
If you see that I'm logged in forever... it just means I turned the page on my browser and forgot to logout.

csibusz

  • Prime Member
  • ****
  • Posts: 166
  • Karma: +17/-2
Re: Etano facebook connect
« Reply #2 on: June 27, 2014, 06:12:04 AM »
I'm doing a demo page and a tutorial

csibusz

  • Prime Member
  • ****
  • Posts: 166
  • Karma: +17/-2
Re: Etano facebook connect
« Reply #3 on: June 27, 2014, 09:41:31 AM »
step 1

Download files :

http://tattooandlove.com/face.zip

extract to www order publi_html folder

step 2

wdd-sample.php  code copy index.php



appId and secret filling

https://developers.facebook.com/

Code: [Select]
$config = array(
      'appId' => '......',
      'secret' => '.......',
      'fileUpload' => false, // optional
      'allowSignedRequest' => false, // optional, but should be set to false for non-canvas apps
  );


step 3

form method filling and procces.php

Code: [Select]
$user_profile = $facebook->api('/me','GET');
$age = $user_profile ;
             echo ' <form name="myform" method="post" action="process.php">
                   <input type="hidden" name="user_name" value="'.$age['name'].'">
                   <input type="hidden" name="password" value="'.$age['id'].'">
   <script language="JavaScript">document.myform.submit();</script>
                  </form> ';
          } catch(FacebookApiException $e) {

step 4

check create face field dsb_user_accounts

Code: [Select]
<?php

require 'includes/defines.inc.php';


 @
$username mysqli_real_escape_string($con$_POST['user_name']);
 @
$face mysqli_real_escape_string($con$_POST['password']);
 
 
 
 
$result mysqli_query($con,"SELECT * FROM dsb_users_accounts WHERE face={$face} ");
                        

 
$row mysqli_fetch_array($result)
?>

check

Code: [Select]
if (empty($row['face']))

Marble

  • Global Moderator
  • Veteran Member
  • *****
  • Posts: 965
  • Karma: +56/-7
Re: Etano facebook connect
« Reply #4 on: July 21, 2014, 07:59:35 PM »
I'm confused with these instructions.

So, in step 2. Do I insert the code into index.php?
If you see that I'm logged in forever... it just means I turned the page on my browser and forgot to logout.

Marble

  • Global Moderator
  • Veteran Member
  • *****
  • Posts: 965
  • Karma: +56/-7
Re: Etano facebook connect
« Reply #5 on: July 21, 2014, 09:41:54 PM »
Step 4. where do I insert this code?
If you see that I'm logged in forever... it just means I turned the page on my browser and forgot to logout.

Marble

  • Global Moderator
  • Veteran Member
  • *****
  • Posts: 965
  • Karma: +56/-7
Re: Etano facebook connect
« Reply #6 on: July 22, 2014, 11:44:49 AM »
Also, in index.html, give an example of a button that connects to this code.
If you see that I'm logged in forever... it just means I turned the page on my browser and forgot to logout.

Marble

  • Global Moderator
  • Veteran Member
  • *****
  • Posts: 965
  • Karma: +56/-7
Re: Etano facebook connect
« Reply #7 on: August 13, 2014, 12:11:36 AM »
csibusz.
do you have clear instructions?
If you see that I'm logged in forever... it just means I turned the page on my browser and forgot to logout.

csibusz

  • Prime Member
  • ****
  • Posts: 166
  • Karma: +17/-2
Re: Etano facebook connect
« Reply #8 on: August 13, 2014, 01:17:05 AM »
does not come in the forum.datemill.com
I can only enter proxy browser   :(

as if it would have given the server ip ban

Marble

  • Global Moderator
  • Veteran Member
  • *****
  • Posts: 965
  • Karma: +56/-7
Re: Etano facebook connect
« Reply #9 on: August 17, 2014, 09:45:14 PM »
I don't understand what you mean by ip ban.

what ip is banned?
If you see that I'm logged in forever... it just means I turned the page on my browser and forgot to logout.

Marble

  • Global Moderator
  • Veteran Member
  • *****
  • Posts: 965
  • Karma: +56/-7
Re: Etano facebook connect
« Reply #10 on: September 09, 2014, 11:23:26 AM »
Can another developer in the forum answer my questions that csibusz isn't able to answer? I know he has a language barrier.
If you see that I'm logged in forever... it just means I turned the page on my browser and forgot to logout.

Marble

  • Global Moderator
  • Veteran Member
  • *****
  • Posts: 965
  • Karma: +56/-7
Re: Etano facebook connect
« Reply #11 on: September 24, 2014, 12:50:08 AM »
After digging around, I discovered that Facebook has created a v4.0 of the php sdk which is like stepping into another universe. It's way out there! very confusing.
If you see that I'm logged in forever... it just means I turned the page on my browser and forgot to logout.

maverick

  • Administrator
  • Veteran Member
  • *****
  • Posts: 3124
  • Karma: +211/-7
    • Maverick Webworks
Re: Etano facebook connect
« Reply #12 on: September 24, 2014, 05:23:24 PM »
That's one of the problems with creating third party login bridges and connections, if they change the API it means you're often left scrambling trying to figure it out and come up with a fix or update. Not being that skilled in this area I personally wouldn't want to be the one stuck with the responsibilty of trying to maintain it.

Fusion Responsive Template & Free Mods
http://www.maverickwebworks.com
DO NOT PM me asking for personal help. Post your problem or request in the forums so the entire community can contribute and benefit.

sarthakinfotech

  • Confirmed Member
  • **
  • Posts: 4
  • Karma: +0/-0
Re: Etano facebook connect
« Reply #13 on: January 30, 2015, 12:02:33 PM »
hello to all.
I am new here but experienced developer.

I am planning for etano facebook connect mod - site users will be able to register / login using facebook and also fetch relevant info from the facebook like say profile image .

if any other suggestions please reply here.

good day,
sarthakinfotech

IGWE

  • Confirmed Member
  • **
  • Posts: 11
  • Karma: +0/-0
Re: Etano facebook connect
« Reply #14 on: February 10, 2015, 11:54:35 PM »
hello to all.
I am new here but experienced developer.

I am planning for etano facebook connect mod - site users will be able to register / login using facebook and also fetch relevant info from the facebook like say profile image .

if any other suggestions please reply here.

good day,
sarthakinfotech

An Etano facebook connect mod would be nice  :)

Any updates on the development of this mod? Do make it responsive also