*

Vink

  • *****
  • 329
    • NedDate.nl
MOD: Facebook Login
« on: January 28, 2015, 02:44:14 PM »
Hi
This is the new version of the Facebook Login possibility for OsDate V2.19a to 2.6.5 => MOD Facebook SDK Login V2.1

This Mod fetch the Facebook email, name, first_name, last_name, and gender and store it in the OsDate database.
It don't fetch the user location and city.. why? see: https://developers.facebook.com/docs/facebook-login/permissions/

If you install the previous Facebook login Mod from here you must remove it and replace it with this one.

Installation:
----------------------------------------------------------------------
1)
Download the attachment Mod-FacebookV2.rar
Unrar Mod-FacebookV2.rar
 
2)
Open config.php and add your Facebook App ID and background-color of the place where the loginbutton appears.
You must have a Facebook account to be able to get an App ID, I made a howto that is include in the Mod-FacebookV2.rar
 see Docs => HowTo.htm

3)
in your Osdate index.php find:
Code: [Select]
if ( strlen( $_SERVER['QUERY_STRING'] ) <= 0 or $_SERVER['QUERY_STRING'] == ect. ect.
and make it:
Code: [Select]
if ( strlen( $_SERVER['QUERY_STRING'] ) <= 0 or $_GET['face'] == 'facebook' or $_SERVER['QUERY_STRING'] == ect. ect.
on the end find :
Code: [Select]
$lang['DATE_FORMAT'] = get_lang('DATE_FORMAT');
and add above:
Code: [Select]
if ( isset( $_GET['face'] ) ) {

        $passw = $_GET['passw'];
        $face = 1;
        $t->assign ( 'passw', $passw );
$t->assign ( 'face', $face );
$t->assign('rendered_page', $t->fetch('homepage.tpl') );

}

4)
Add a small Iframe in your template index.tpl where the Facebook login button is shown.
This is all up to you where you want the button to appear.
Code: [Select]
{if $smarty.session.UserId == ''}
<iframe  style="visibility:hidden;" onload="this.style.visibility ='visible';" src="facebook/fblogin.php" WIDTH="150" HEIGHT="22" scrolling="no"  frameborder="0" ></iframe>
{/if}

5)
Now we add a dialog only for users who logged in with there Facebook account.
Change the text to your needs.
In your template homepage.tpl add where you want the dialog to appear:
Code: [Select]
{if $face == '1'}
<table width="99%" align="center" style="border:solid 1px #A7A7A7;">
<tr >
<td align="center">Welcome! you logged in with your Facebook account.<br><br />
Your Username is: <font color="#484800"><b>{$smarty.session.UserName}</b></font> and your password is: <font color="#484800"><b>{$passw}</b></font>
 <br /><br />
For your safety we recommend to change your password now.<br />
When you do the next time you can not login with your Facebook account but<br>
you must login on the normal way with your new password.<br>
</td>
</tr>  
  </table>
{/if}

This Dialog only shown once after the Facebook user login.

6)
Upload the facebook dir and facelogin.php to your server root.
Upoad your index.php to your server root.
Upload homepage.tpl and index.tpl to your template dir.

Thats it! Test your Facebook login and hopefully you get many new members! :)

regards
Vink

Thanks to HandsUpBoy for testing!


« Last Edit: February 03, 2015, 07:53:11 PM by Vink »
Regards
Vink
osDate 2.19a | PHP 5.3.8 | MySQL  5.0.91

Re: MOD: Facebook Login
« Reply #1 on: February 02, 2015, 09:52:56 PM »
No Problem, Vink!

In the app settings you can adjust later another things, e.g. Age range, from which country he must come etc.

It's so fine, and it's work great!  :D

Re: MOD: Facebook Login
« Reply #2 on: February 03, 2015, 04:31:42 PM »
Thanks a lot. Mod is working. Just need to tweak it a little bit. Great work.
osDate 2.6.5 |PHP/5.4.36  | MySQL: 5.1.73

Re: MOD: Facebook Login
« Reply #3 on: February 12, 2015, 08:05:17 PM »
hi vink, appreciate the hard work put into this, i know using this means people can quickly register with your site by login in with this? which is ok but then nothing else gets filled out in the signup process? meaning fields are left un filled, details that are required as in city etc are not filled in, am i  missing the point of this?

also, i have nearby profiles installed or geo location that becomes active once a member has upgraded their membership to a premium level, however, if a member signs in through the facebook login and then upgrades this feature no longer becomes active?
« Last Edit: February 12, 2015, 08:45:05 PM by mnarkyp77 »

*

Vink

  • *****
  • 329
    • NedDate.nl
Re: MOD: Facebook Login
« Reply #4 on: February 12, 2015, 09:41:59 PM »
Hi Mnarkyp,
Well, this mod deals with those people who don't want to fill in a long signup page.. its nowadays a allmost common and populair way to signup to a site..
 
If your region or country has a lot of datingsites and the competition is big, you must make it people easy and attractief with this kind of thinks.

This Mod gets the basic allowed Facebook information of a user.. you can get more.. but then you must have permission and a review from Facebook for your app/site to do so:
Facebook say:
Quote
Permissions that require review are generally reviewed within 3 business days. Some permissions may take up to 7 days to review, and are marked as such in the reference.
see allso: https://developers.facebook.com/docs/facebook-login/permissions

If you got more permissions to log from a user, it can easily implemented in this Mod.

greatings Vink

tip: if you don't like this way of signup.. don't use it  ;)
Regards
Vink
osDate 2.19a | PHP 5.3.8 | MySQL  5.0.91

Re: MOD: Facebook Login
« Reply #5 on: February 12, 2015, 09:47:33 PM »
hi vink,

i do like this way of signing up, the problem i have is my site is an adult dating site and getting facebook to allow what i need is going to be difficult, i was kind of hoping you knew a way round it? even if i could get some of the simple fields filled in through the plugin like location, country that would work great, but i also do not understand why geo location wont work wit the login, it must be something to do with the files we add because if i remove the fb plugin then sign in manually with the members details the geo location then starts working again , its a strange one,
 
« Last Edit: February 12, 2015, 10:02:07 PM by Vink »

*

Vink

  • *****
  • 329
    • NedDate.nl
Re: MOD: Facebook Login
« Reply #6 on: February 12, 2015, 10:06:40 PM »
Hi Mnarkyp,
Please do not QUOTE a complete answer.. evrybody knows your reaction is on my answer.. thats how forums works.
 
Regards
Vink
osDate 2.19a | PHP 5.3.8 | MySQL  5.0.91

Re: MOD: Facebook Login
« Reply #7 on: February 12, 2015, 11:11:10 PM »
Well the mod from Vink does work ans its up to you how you want to tweak it. I'm adjusting Vinks mod. In stead of automaticcaly generating a user in the database I use the mod to autofill the details in the register form. Trying to get the profile picture from facebook as well.
osDate 2.6.5 |PHP/5.4.36  | MySQL: 5.1.73

Re: MOD: Facebook Login
« Reply #8 on: February 12, 2015, 11:14:16 PM »
would be interested to see and use if possible your final mark up of this, and im not disputing that vink has done a top job, i was simply outlining that it doesnt currently fill out the required fields
« Last Edit: February 12, 2015, 11:17:37 PM by mnarkyp77 »

*

Vink

  • *****
  • 329
    • NedDate.nl
Re: MOD: Facebook Login
« Reply #9 on: February 14, 2015, 11:05:32 AM »
Hi Mnarkyp,
it does fill out the required fields to get into your site.. you can  encourage Facebook subscribers in your Facebook dialog field.. to complete there profile and show a link to edituser.php
 
Regards
Vink
osDate 2.19a | PHP 5.3.8 | MySQL  5.0.91

Re: MOD: Facebook Login
« Reply #10 on: June 01, 2015, 12:37:45 PM »
Dear Vink,

Thanks for the great mod.

Is there anyway I can download the profile pic from FB to my db? Dat will be a great feature too..

mathes

*

Vink

  • *****
  • 329
    • NedDate.nl
Re: MOD: Facebook Login
« Reply #11 on: June 02, 2015, 10:48:05 AM »
Hi Mathes,
I agree with you but unfortunately i have found no way of doing this..
 
Regards
Vink
osDate 2.19a | PHP 5.3.8 | MySQL  5.0.91