Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • artij Friend
    #952017

    Hi,
    Unfortunatelly there is still something wrong – new post from fb still upload with poor quality images.
    I’ve tried everything:

    1. I’ve installed update- nothing change.
    2. One again I’ve installed fixed plugin (from previous topic)- nothing change.
    3. I’ve deleted everything (even social_feed catalog with images) and installed plugin once again- still some images have good quality and others poor.
      Any idea?
      Regards,
      Artur
      site: wwr.com.pl
    Mo0nlight Moderator
    #952816

    Hi
    You can try this:
    Edit the file: /plugins/plg_system_jasocial_feed/jasocial_feed.php

    Find for code:

    $post['source_images'] = $this->getFacebookImage('<img src="'.$dt->img.'" />',$img_caption, $img_caption);

    Add this code above.

    if (preg_match('/i.ytimg.com/', $dt->img)) { // img from youtube
                            preg_match('/url=(.*?)$/', $dt->img, $mat);
                            if (!empty($mat[1])) {
                                $dt->img = str_replace(array('&cfs=1', 'maxresdefault'), array('', '0'), urldecode($mat[1]));
                            }
                        }

    Regards.

    artij Friend
    #952916

    Hello, Now importing post with link to youtube works fine, but still there is problem with some typical facebook posts (it imports only thumbnails). Examples: http://wwr.com.pl/facebook/1695-facebook-id-10154307564385762 http://wwr.com.pl/facebook/1660-facebook-id-10154092108620762 http://wwr.com.pl/facebook/1659-facebook-id-10154192643445762 Regards, Artur

    Luna Garden Moderator
    #954972

    Hi.
    for that case.
    You can try this.
    Edit the file: /plugins/plg_system_jasocial_feed/jasocial_feed.php
    Find for.

    
        } else {
                                $aImages[$index] = $img;
                            }

    Change to:

      } else {
                                if (preg_match('/external/', $img))
                                    $aImages[$index] = str_replace(array('w=130', 'h=130'), array('w=476', 'h=249'), $img);
                                else
                                    $aImages[$index] = $img;
                            }

    Regards.

    artij Friend
    #955548

    Hi,
    Unfortunatelly, nothing changed.
    Regards,
    Artur

    Luna Garden Moderator
    #955565

    Hi,

    In this case, please update FTP info of your site, we’ll check and fix directly on your site.

    artij Friend
    #955983
    This reply has been marked as private.
    artij Friend
    #956881

    Hi,
    I see that you made changes, now it looks perfect. Thank you!
    Regards,
    Artur

    Mo0nlight Moderator
    #956915

    Hi

    Yes, I made some changes in file /plugins/system/jasocial_feed/jasocial_feed.php

    at line : 342-344. add this code.

    if (preg_match('/w=130&h=130/', $item->picture) && preg_match('/fbstaging/', $item->picture)) {
                    $item->picture = str_replace('w=130&h=130','w=476&h=249',$item->picture);
                }

    and change the code at line : 1869-1896

    foreach ($aImages as $index => $img) {
                        if(strpos($img, 'fbcdn') !== false) {
                            if(preg_match('/url\=http/', $img)) {
                                //eg: https://fbexternal-a.akamaihd.net/safe_image.php?d=AQBr4qx2iuYe6k6f&w=158&h=158&url=https%3A%2F%2Fscontent-a-lax.xx.fbcdn.net%2Fhphotos-xpf1%2Ft31.0-8%2Fs720x720%2F10943719_848687791857700_7419083212834719221_o.jpg
                                $img = preg_replace('/^(.*?)url\=http/', '', $img);
    //                          $img = preg_replace('/.*?url\=(http.*)/', '$1', $img);
                                $img = 'http'.rawurldecode($img);
                                $img = preg_replace('/\&cfs\=1(.*?)$/', '', $img);
                                $aImages[$index] = $img;
                            }
    
                            if(preg_match('#/([0-9]+)_([0-9]+)_([0-9]+)_(o|b)?\.(jpg|png|jpeg|gif|bmp)#i', $img, $matches)) {
                                //is original, big image
                                $aImages[$index] = $img;
                            } else if(preg_match('#/([0-9]+)_([0-9]+)_([0-9]+)(?:_[a-z])?\.(jpg|png|jpeg|gif|bmp)#i', $img, $matches)) {
                                if (!strpos($img, 'hphotos')) // if the image from fb already big size.
                                    $img = 'https://graph.facebook.com/'.$matches[2].'/picture';
                                $aImages[$index] = $img;
                            } else if (preg_match($patternSmallImg, $img)) {
                                $aImages[$index] = preg_replace($patternSmallImg, '_b.$1', $img);
                            }
                        } else {
                            if (preg_match('/external/', $img))
                                $aImages[$index] = str_replace(array('w=130', 'h=130'), array('w=476', 'h=249'), $img);
                            else
                                $aImages[$index] = $img;
                        }
                    }

    Regards

Viewing 9 posts - 1 through 9 (of 9 total)

This topic contains 10 replies, has 3 voices, and was last updated by  Mo0nlight 8 years, 3 months ago.

We moved to new unified forum. Please post all new support queries in our New Forum