✅ Karenderia Forum COMMUNITY
 

Avatar FB - V1

0 Members and 1 Guest are viewing this topic.

Offline Khoallah

  • *
  • 4
  • +1/-0
    • View Profile
Avatar FB - V1
« on: May 31, 2020, 10:17:23 AM »
Hello everyone, I have a problem with the facebook avatar on V1, has anyone managed to solve it?
Basti's Cron task didn't work
Thank you

Offline Conejo

  • *****
  • 47
  • +501/-1
    • View Profile
Re: Avatar FB - V1
« Reply #1 on: June 01, 2020, 05:26:07 AM »
Hello everyone, I have a problem with the facebook avatar on V1, has anyone managed to solve it?
Basti's Cron task didn't work
Thank you

Please upload an image with the issue :D
We are here for help

Offline Khoallah

  • *
  • 4
  • +1/-0
    • View Profile
Re: Avatar FB - V1
« Reply #2 on: June 01, 2020, 04:01:16 PM »
It's not a single image, users complain that the app changes the person's avatar

Offline Conejo

  • *****
  • 47
  • +501/-1
    • View Profile
Re: Avatar FB - V1
« Reply #3 on: June 02, 2020, 10:01:15 AM »
It's not a single image, users complain that the app changes the person's avatar

Yes but please upload a imagen where showing.
We are here for help

Offline wariclis

  • *
  • 4
  • +1/-0
    • View Profile
Re: Avatar FB - V1
« Reply #4 on: June 04, 2020, 10:26:51 AM »
i have same problem , the problem is from users in iphone , check phpmyadmin and check avatar field , check if the name of avatar is the same in customer  , table mt_client field avatar. You will find a lot of  user with same name picture like cdv_photo_001.jpg.jpg or cdv_photo_002.jpg.jpg . Im checking to fix it , i think is a problem in function .

Offline Khoallah

  • *
  • 4
  • +1/-0
    • View Profile
Re: Avatar FB - V1
« Reply #5 on: June 04, 2020, 04:41:06 PM »
The function is:

public static function saveFbAvatarPicture($id='')
   {               
      if( @ini_get('allow_url_fopen') ) {            
         $fbid=$id;
         $fb_avatar_filename="avatar_".$id.".jpg";          
         $context = stream_context_create(array('http' => array('header'=>'Connection: close\r\n')));         
         $image = json_decode(file_get_contents("https://graph.facebook.com/$fbid/picture?type=large&redirect=false",false,$context),true);             
         if(isset($image['data']['url'])){
            $image = file_get_contents($image['data']['url']);
            @file_put_contents( FunctionsV3::uploadPath()."/$fb_avatar_filename",$image);
            return $fb_avatar_filename;
         }
      }
      return false;
   }


was thinking of changing to:

public static function saveFbAvatarPicture($id='')
   {               
      if( @ini_get('allow_url_fopen') ) {            
         $fbid=$id;
                        $fb_avatar_filename="/protected/modules/mobileapp/assets/images/user.png";
         $context = stream_context_create(array('http' => array('header'=>'Connection: close\r\n')));         
         $image = json_decode(file_get_contents("https://graph.facebook.com/$fbid/picture?type=large&redirect=false",false,$context),true);             
         if(isset($image['data']['url'])){
            $image = file_get_contents($image['data']['url']);
            @file_put_contents( FunctionsV3::uploadPath()."/$fb_avatar_filename",$image);
            return $fb_avatar_filename;
         }
      }
      return false;
   }

and make sure you at least save a still image.

Offline Conejo

  • *****
  • 47
  • +501/-1
    • View Profile
Re: Avatar FB - V1
« Reply #6 on: June 05, 2020, 10:37:27 AM »
is a bug, will be updated in the next version.
We are here for help

Offline wariclis

  • *
  • 4
  • +1/-0
    • View Profile
Re: Avatar FB - V1
« Reply #7 on: June 06, 2020, 11:27:29 AM »
update for karenderia mobile app v1?

Offline Conejo

  • *****
  • 47
  • +501/-1
    • View Profile
Re: Avatar FB - V1
« Reply #8 on: June 19, 2020, 01:19:53 AM »
no bro, i will recommend you change to the version 2

https://codecanyon.net/item/karenderia-app-version-2/24402087
We are here for help

Offline dibydrams

  • *
  • 2
  • +0/-0
    • View Profile
Re: Avatar FB - V1
« Reply #9 on: June 19, 2020, 05:52:06 AM »
i have same problem , the problem is from users in iphone , check phpmyadmin and check avatar field , check if the name of avatar is the same in customer  , table mt_client field avatar. You will find a lot of  user with same name picture like cdv_photo_001.jpg.jpg or cdv_photo_002.jpg.jpg . Im checking to fix it , i think is a problem in function .

It's a Facebook API issue, sometimes Facebook API give "undefined" as email address, so every time a user log in with that problem it updates always the same account with email address "undefined" (client ID 34 for me). It has been fixed for app v2 already I guess if you have last update, and I recently ask the code for app v1 to put in apicontroller.php, but yes if I remember well you have also a fix to add for the Cron task for the profile picture, you should find it browsing the comments in Comments Section of KMRS and related mobile apps.

So you have to understand that it's like you have all these users sharing same account, for me it's about 50 customers. In the orders list, you will see that some client names are strangely changing sometimes, it's because of that problem.

It's not a single image, users complain that the app changes the person's avatar

It's not really the app, but the last user that logs in the "undefined" email address account I guess. It's not only profile picture but also history and probably some other elements as they are all sharing same customer account.

update for karenderia mobile app v1?

In apicontroller.php of mobile app 1 in function actionregisterUsingFb()

after this line:

Code: [Select]
$DbExt=new DbExt;
add this:

Code: [Select]
$Validator=new Validator;

$Validator->email(array(
          'email'=>$this->t("Invalid email address")
        ),$this->data);

        if(!$Validator->validate()){
           $this->msg=AddonMobileApp::parseValidatorError($Validator->getError());       
           $this->output();
        }
« Last Edit: June 19, 2020, 06:05:24 AM by dibydrams »

 


Hire