Forum Replies Created

Viewing 15 replies - 1 through 15 (of 16 total)
  • Thread Starter zoran100

    (@zoran100)

    oh, yes, and I run PHP version 5.2.11 so its not that my php is old…

    You must be out of your mind to pay, not once but each month!…there are very nice free php scripts out there that provide live support on your site…

    @milordk

    I did not mean to undermine your work, just to give you an average user perspective, it simple: we install and it does not work. I think that you invested great amount of work and if you want to share, so you should make sure that others can successfully install your plugin. I tell you what: Soon I have time,I will make one test site and see if I can learn what needs to be done in order for your code to work on a new site, straight from the box. Will let you know…

    @milordk

    If there must be conflicts, what’s the point of making plug-ins? You can’t have good site with just one plug-in. But regardless of conflicts, I don’t understand why your plug-in during the installation doesn’t create everything it needs, including db tables. Many other plug-ins do that without problem. Good plug-ins also remove everything during the un-installation process.

    In addition to incomplete installation, Jet Event System does not have clean un-installation either. After I uninstalled your plug-in, I found in my current theme folder called “events” which was left over by your plug-in, with bunch of items and subfolders in it. Therefore, as much as I would like to have events on my site, I am afraid to make changes to my database with “administrative panel plug-in” because if I damage my database, that will render my entire site in error.

    @cicelle, did you manage to fix your database or did you uninstall this plugin?

    Hello milordk,

    On your demo site it may work bcs you may did some adjustments that we did’nt. Good plugins should not interact/interfere 2 eachother…My site also returns error: There was an error saving event details, please try again [001]…You should investigate…your plugin looks great but simple it does not work at this point out of your site…

    Great! Let us know when you update your files to contain new function.php cause it will make your plugin officially bugs free, at least as far as I could test! Also, let us know where is your official plugin page so that we can vote!

    Every buddypress installation should have this fantastic and easy to use plugin and im sure many will have it soon! Congratulation on creating awesome contribution to wordpress /buddypress community!

    As for the ajaxchat, I am still looking into it’s code and testing but no result yet… If no progress, I will just go with the different chat plugin. 2 bad for the localization and theme I already created ??

    Hello again valentinas…I email you all files…but something just crossed my mind: what happens if your buddypress already has registered user that has exact same name as the new user that is trying to connect for the first time to your buddypress via his facebook account? Did not test this, but thought its worth letting you know that this is the possibility…

    told you avatars are far away ??

    more i look into this more it looks like its ajaxchat that creates this conflict…some ajaxchat files are missing ?> on the end…I will email you files now…

    so, after that, blank white page was gone. You should change this file in next upgrade as 1st time users will not know to refresh page and that will think that your plugin does not work.

    Second thing:

    This one im not sure how to fix yet: There was a conflinct with another plugin that I have installed before ( took me some time to figure out witch one):

    === AjaxChat ===
    Contributors: Payden Sutherland
    Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=GMXNW6GGYR5LG&lc=US&item_name=Payden%20Sutherland&currency_code=USD&bn=PP%2dDonationsBF%3abtn_donate_LG%2egif%3aNonHosted
    Tags: chat, ajax, instant, messaging
    Requires at least: 2.9.2
    Tested up to: 3.0
    Stable Tag: 0.4.2

    ____________________________

    Once I turn off ajaxchat, Facebook Connect started working like a charm! Anyway, here is the error_log that I found in ajaxchat plugin folder related to your plugin:
    _____________________________
    [29-Dec-2010 02:10:53] PHP Parse error: syntax error, unexpected $end in /home/manager1/public_html/wp-content/plugins/wp-facebook-connect/fb-connect.php on line 41
    _____________________________

    I did not try to mess with fb-connect.php line 41, yet but I will try to see if I can figure out how to turn both plugins on. I dont know php but i am advanced vb6 programmer so lets see…

    Anyway,I tought that there could be more plugins on other ppl installations that will create error in your plugin like ajaxchat, so I am letting you know. Other that that, your plugin is now fully funcional. Its actually on right now on one of my brand new sites!

    I will get back here if I fix fb-connect.php line 41 error.
    Again, grat job so far, great plugin, I will vote after this error is cleared highest posible rate!

    OK…It took some time but here are results:

    1st yes! it works! Great job fixing the bug. All errors related to that bug are gone! But there are 2 issues I found that you should know about:

    One: this one is easy. Just like donatien I run into white blank page after upgrade so I changed functions.php to this:

    <?php
    /**
    * facebook_header()
    *
    * @package fb-connect
    * @since 1.0
    *
    * javascript for header
    * taken from here: https://developers.facebook.com/docs/guides/web
    *
    */
    function facebook_header(){
    ?>
    <script src=”https://connect.facebook.net/en_US/all.js”></script&gt;
    <script>
    jQuery(document).ready(function(){
    FB.init({appId: ‘<?php echo FACEBOOK_APP_ID; ?>’, status: true,
    cookie: true, xfbml: true});
    FB.Event.subscribe(‘auth.sessionChange’, function(response) {
    if (response.session) {
    jQuery(‘body’).html(”);
    window.location.href=window.location.href;
    } else {
    jQuery(‘body’).html(”);
    window.location.href=window.location.href;
    }
    });
    });
    </script>
    <?php
    }

    /**
    * fb_logout_url()
    *
    * @package fb-connect
    * @since 1.0
    *
    * logout url for people who are logged in with FB
    *
    */
    function fb_logout_url($url){
    $cookie = get_facebook_cookie(FACEBOOK_APP_ID, FACEBOOK_SECRET);
    if($cookie)
    return “javascript:FB.logout(function(){location.href='” . $url . “‘})”;
    else
    return $url;
    }

    /**
    * fb_footer()
    *
    * @package fb-connect
    * @since 1.0
    *
    * markup for footer
    * taken from here: https://developers.facebook.com/docs/guides/web
    *
    */
    function fb_footer(){
    ?> <div id=”fb-root”></div> <?php
    }

    /**
    * get_facebook_cookie()
    *
    * @package fb-connect
    * @since 1.0
    *
    * gets facebook cookie (yummy thing that is created when user is authenticated with FB in your website)
    * taken from here: https://developers.facebook.com/docs/guides/web
    *
    * @return array|null
    *
    */
    function get_facebook_cookie($app_id, $application_secret) {
    $args = array();
    parse_str(trim($_COOKIE[‘fbs_’ . $app_id], ‘\\”‘), $args);
    ksort($args);
    $payload = ”;
    foreach ($args as $key => $value) {
    if ($key != ‘sig’) {
    $payload .= $key . ‘=’ . $value;
    }
    }
    if (md5($payload . $application_secret) != $args[‘sig’]) {
    return null;
    }
    return $args;
    }

    /**
    * fb_login_user()
    *
    * @package fb-connect
    * @since 1.0
    *
    * this is the main function that performs the login or user creation process
    *
    * @return true
    */
    function fb_login_user(){
    global $wpdb;
    //@todo: investigate: does this gets included doing regular request?
    require_once( ABSPATH . ‘wp-includes/registration.php’ );
    //mmmm, cookie
    $cookie = get_facebook_cookie(FACEBOOK_APP_ID, FACEBOOK_SECRET);
    //if we have cookie, then try to get user data
    if ($cookie) {
    //get user data
    $user = json_decode(@file_get_contents(‘https://graph.facebook.com/me?access_token=&#8217; . $cookie[‘access_token’]));
    //if user data is empty, then nothing will happen
    if( !empty($user) ){
    //this should never happen, since email address is required to register in FB
    //I put it here just in case of API changes or some other disaster, like wrong API key or secret
    if( !isset($user->email) || empty($user->email) ){
    do_action(‘fb_connect_get_email_error’);
    //do not use wp_die here, because it adds styles which can mess up the whole looks of the site
    die(“Error: failed to get your email from Facebook!”);
    }

    //if user is logged in, then we just need to associate FB account with WordPress account
    if( is_user_logged_in() ){
    global $current_user;
    get_currentuserinfo();
    $fb_uid = get_user_meta($current_user->ID, ‘fb_uid’, true);

    if($fb_uid == $user->id)
    return true;

    if( $user->email == $current_user->user_email ) {
    //if FB email is the same as WP email we don’t need to do anything.
    do_action(‘fb_connect_wp_fb_same_email’);
    $fb_uid = get_user_meta($current_user->ID, ‘fb_uid’, true);
    if( !$fb_uid )
    update_user_meta( $current_user->ID, ‘fb_uid’, $user->id );
    return true;
    } else {
    //else we need to set fb_uid in user meta, this will be used to identify this user
    do_action(‘fb_connect_wp_fb_different_email’);
    $fb_uid = get_user_meta($current_user->ID, ‘fb_uid’, true);
    if( !$fb_uid )
    update_user_meta( $current_user->ID, ‘fb_uid’, $user->id );
    $fb_email = get_user_meta($current_user->ID, ‘fb_email’, true);
    if( !$fb_uid )
    update_user_meta( $current_user->ID, ‘fb_email’, $user->email );
    //that’s it, we don’t need to do anything else, because the user is already logged in.
    return true;
    }
    }else{
    //check if user has account in the website. get id
    $existing_user = $wpdb->get_var( ‘SELECT DISTINCT u.ID FROM ' . $wpdb->users . ' u JOIN ' . $wpdb->usermeta . ' m ON u.ID = m.user_id WHERE (m.meta_key = “fb_uid” AND m.meta_value = “‘ . $user->id . ‘” ) OR user_email = “‘ . $user->email . ‘” OR (m.meta_key = “fb_email” AND m.meta_value = “‘ . $user->email . ‘” ) LIMIT 1 ‘ );
    //if the user exists – set cookie, do wp_login, redirect and exit
    if( $existing_user > 0 ){
    $fb_uid = get_user_meta($existing_user, ‘fb_uid’, true);
    if( !$fb_uid )
    update_user_meta( $new_user, ‘fb_uid’, $user->id );
    $user_info = get_userdata($existing_user);
    do_action(‘fb_connect_fb_same_email’);
    wp_set_auth_cookie($existing_user, true, false);
    do_action(‘wp_login’, $user_info->user_login);
    if (wp_get_referer()) {
    wp_redirect(wp_get_referer());
    } else {
    wp_redirect( $_SERVER[‘REQUEST_URI’] );
    }
    exit();
    //if user don’t exist – create one and do all the same stuff: cookie, wp_login, redirect, exit
    } else {
    do_action(‘fb_connect_fb_new_email’);
    //sanitize username
    $username = sanitize_user($user->first_name, true);

    //check if username is taken
    //if so – add something in the end and check again
    $i=”;
    while(username_exists($username . $i)){
    $i=absint($i);
    $i++;
    }

    //this will be new user login name
    $username = $username . $i;

    //put everything in nice array
    $userdata = array(
    ‘user_pass’ => wp_generate_password(),
    ‘user_login’ => $username,
    ‘user_nicename’ => $username,
    ‘user_email’ => $user->email,
    ‘display_name’ => $user->name,
    ‘nickname’ => $username,
    ‘first_name’ => $user->first_name,
    ‘last_name’ => $user->last_name,
    ‘role’ => ‘subscriber’
    );
    $userdata = apply_filters(‘fb_connect_new_userdata’, $userdata, $user);
    //create new user
    $new_user = absint(wp_insert_user($userdata));
    do_action(‘fb_connect_new_user’, $new_user);
    //if user created succesfully – log in and reload
    if( $new_user > 0 ){
    update_user_meta( $new_user, ‘fb_uid’, $user->id );
    $user_info = get_userdata($new_user);
    wp_set_auth_cookie($new_user, true, false);
    do_action(‘wp_login’, $user_info->user_login);
    wp_redirect(wp_get_referer());
    exit();
    } else {
    wp_die(‘Facebook Connect: Error creating new user!’);
    }
    }
    }
    }
    }
    }
    ?>

    Hello Valentinas, just got the message…I am testing right now will let you know results asap

    Just one note, maybe important. I just realized that Capital letters are no problem for wordpress…you can enter them anyway if you manually add new users from your admin panel. Why they prohibited new users from doing that on registration is beyond my understanding because all people names start with capital letters. I will se if I can manage to correct that on my site. Anyway, so, you don’t have to change facebook capital letters in your plugin, what messes up wordpress and buddypress are only blank spaces.

    Glad I could point to it. I value people who are share their hard work. I wish I could be of more help but like I said, I don’t know how to code in PHP ??

    I’m also almost sure that all other problems are related to that same issue and I can’t wait to test your new version.

    If you wish to go fancy about that, you can give the admin couple of options on how the names will be pulled from the facebook into buddypress. For example 1st option will be that first and last name from facebook becomes one word and that word becomes account name in buddypress. 2nd option that first name from facebook becomes account name and last name from facebook becomes profile name…and vice versa.

    I think that will be of help for different people who setup different web sites on different ways and with different themas but that could be perhaps something for your next version I guess.

    For now, as long as your plugin starts working, I am sure many people will have a great usage for it. Avatar can come even later. If you want me and others to test, just let us know when you post that beta…All the best and Merry Christmas!

    First of valentines, thank you for this plugin. I have latest versions of wordpress and buddypress and just installed your plugin and initially it worked but…I run with couple of errors that I think are all related to the same issue:

    Profile Settings Not AvailableUser who’s login for the 1st time with facebook can not ever access his profile settings. User who makes his account via normal buddypress registration form is able to do so.

    Password Can Not Be ChangedFacebook user can not change his password. Actually he can, but then the new password does not work. From the moment he 1st time use facebook login, he will only be able to login via facebook. Even users who 1st created account using buddypress registration will not be able to successfully change passwords once they login via facebook.

    Add Photo Redirection ErrorI use BP-Album+ for photo album. Users who login with facebook, once they add photo are rederected to site main page in the stead back to album.

    There could be more errors related to the this. I assumed that all of them has something to do with the way your plugin creates names from facebook accounts. WordPress ( thus buddypress ) does not allow capital letters and spaces for account names. Your plugin does. Your plugin should make sure that facebook names are adjusted to wordpress standard: Steve Richardson should be renamed steverichardson before his account is created in word/buddypress.

    I am not sure that’s the problem and solution, this was just my wild guess and i decided to let you know. Again thanks for the plugin but right now I can not use it on my live site due to above. I also don’t know to code PHP so this was the best I could help you with. Looking forward to hear from you and to see the updated version clear from this errors. Also, like she said above, it will be great to fetch users avatars but that’s way down the road, I guess.

    Regards,
    Zoran

Viewing 15 replies - 1 through 15 (of 16 total)