WordPress.org

Ready to get started?Download WordPress

Forums

FBF Facebook page Feed Widget
[resolved] Inline images in larger size (10 posts)

  1. kmb@deam.org
    Member
    Posted 1 year ago #

    Hi,

    the current images within the feed are only around 90px in width - if you want to show a decent intro to the facebook page, this is not the way you wanna go.

    So here a dirty hack, that might be useful in future or could be made "more safe":

    // Replace the Image-References
    if($options['replace_img_urls']) {
    $desc = preg_replace("/img\s+class=\"img\"\s+src\=\"http(?:s|)\:\/\/.*\/hphotos\-ak\-(.*)\/(.*)\_s\.jpg\"/i",
    'img class="img replaced" src="https://fbcdn-sphotos-b-a.akamaihd.net/hphotos-ak-$1/s320x320/$2_n.jpg"',
    $desc);
    }

    The option:
    array(
    'name' => 'replace_img_urls',
    'label' => __( 'Try to replace img-URLs (beta)', 'fbf' ),
    'type' => 'checkbox'
    ),

    The complete code based on 1.2.1: http://pastebin.com/KgB7tn5i

    http://wordpress.org/extend/plugins/fbf-facebook-page-feed-widget/

  2. lakshmananphp
    Member
    Plugin Author

    Posted 1 year ago #

    Hi,

    Thanks for the hack,

    Showing feed images in larger size will be useful for those who show their fb page activity in a page or post (rather than sidebar).

    Is image dimensions are restricted or can we use our own height and width?

    If feed supports any dimension then we could have an option for showing image size? (/s320x320/$2 to /s$user_defined_widthx$user_defined_height/$2)

    Thanks
    Lakshmanan.

  3. ShoGun.se
    Member
    Posted 1 year ago #

    Hi,
    This would be a really cool feature. I tried to inserting the code (replaced the original from pastebin) but it doesn´t seem to work for me. I tried to put also an option in the shortcode...

    [fbf_page_feed pageID="xxx" num="10" show_description="true" update="true" show_avatar="" avatar_size="square" link_target_blank="true" feed_title = "true" replace_img_urls="true" like_button="true" like_button_position="bottom"]

    //Robert

  4. kmb@deam.org
    Member
    Posted 1 year ago #

    @ShoGun.se:
    I did not add this to the shortcode-Version, only to the Widget-Version; it's just a hack so far :)
    But you may try this: http://pastebin.com/deKSPXbD (but beware, I did not tested it)

    @lakshmananphp:
    Afaik facebook pre-generates those sizes and they are not exact - they are just boundaries.
    And I don't know if those images are always present if the small version from the rss-feed is there.

    So the question is, do you want to proceed based on this hack or do you want to build a more flexible solution?

    I could think of the possibility that one grabs the largest image, stores/ caches it and process it locally to a customizeable size.

    This simple solution is currently the one I'm happy with :)

  5. ShoGun.se
    Member
    Posted 1 year ago #

    @kmb@deam.org

    Sorry but didn´t work, neither with or without the "tag" in the shortcode...

    But thanks for trying!

    I could think of the possibility that one grabs the largest image, stores/ caches it and process it locally to a customizeable size.

    ^^ Sounds GREAT! =)

    One questions though... Are these pictures in "high" resolution or are they just scaled versions of the small pictures?

  6. lakshmananphp
    Member
    Plugin Author

    Posted 1 year ago #

    @kmb@deam.org

    Yes I want to proceed based on this hack.

    As you rightly said we need to cache images and display in desired size.

    This feature will be added in the next version which will be released soon.

    Thanks
    Lakshmanan

  7. kmb@deam.org
    Member
    Posted 1 year ago #

    @lakshmananphp:
    Nice. If you need an beta-tester, then you can send me your pre-release.

    @ShoGun.se:
    Strange. I've tested it and it is working for me. You should see it because the css-class "replaced" is added to the img-tag.
    Can you provide the facebook-page-id to verify this?

  8. ShoGun.se
    Member
    Posted 1 year ago #

    @kmb@deam.org

    Shall I use the tag in the shortcode or not?

    [fbf_page_feed pageID="115742141848150" num="10" show_description="true" update="true" show_avatar="" avatar_size="square" link_target_blank="true" feed_title = "true" replace_img_urls="true" like_button="true" like_button_position="bottom"]

  9. kmb@deam.org
    Member
    Posted 1 year ago #

    @ShoGun.se:

    The problem are the img-references - it's like this one:
    http://platform.ak.fbcdn.net/www/app_full_proxy.php?app=45439413586&v=1&size=z&cksum=5324ce7d4f39ce6e5ec1b6dde2498547&src=http%3A%2F%2Ft3sjalvskydd.se%2Fwp-content%2Fuploads%2Fphoto.JPG1_.jpg

    My regex only calls for URLs like this:
    http://photos-a.ak.fbcdn.net/hphotos-ak-ash3/5484_572126456138317_1135476019_s.jpg

    I haven't seen such image-refs yet. Seems that one might be able to extract the last portion of the URL and urldecode() it -- in this example the http://t3sjalvskydd.se/wp-content/uploads/photo.JPG1_.jpg ...

    Maybe Lakshmanan can incorporate this too?

  10. ShoGun.se
    Member
    Posted 1 year ago #

    @kmb@deam.org

    I use RSSGraffiti which gets feed from News & Events on the T3Sjalvskydd-site.

    So it gets like a loop at some feeds but that is an ok "trade" for having Facebook on the site and the news on Facebook automatically
    =)

    If you could get it to link to pictures I already have ( http://t3sjalvskydd.se/wp-content/uploads/photo.JPG1_.jpg ...) and to be able to set a standard size for the pics then it would be awesome. Is that possible and if so, is that a feature that may come in this great plugin?

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.