• Hi,

    When I try to connect to ‘Facebook Images’ when creating a new post I get the following error:

    Warning: Invalid argument supplied for foreach() in [hidden]/wp-content/plugins/simple-facebook-connect/sfc-photos.php on line 132

    Interestingly, the ‘Connect with Facebook’ button is still there and does work, I get the little facebook pop-up window. After I grant authorization, I am returned to the starting window, but no images appear, and that error remains there (as does the connect button).

    If I dig out the foreach loop referenced in the error it is:

    foreach ($albums as $album) {
    	echo '<td>';
    
    	$link = admin_url("media-upload.php?post_id=$post_id&type=$type&tab=$redir_tab&album={$album['id']}");
    	// retrieve the cover image for the album
    	if (false !== ($photo = sfc_photo_get_photo($album['cover_photo'], $user['access_token']) ) ) {
    		echo "<p><a href='$link'><img src='{$photo['images'][1]['source']}' /></a></p>";
    	} else {
    		// TODO cover not available
    	}   
    
    	echo "<p><a href='$link'>{$album['name']}</a></p>";
    	echo '</td>';
    
    	if ($i%3 == 0) echo '</tr><tr>';
    	$i++;
    }

    https://www.ads-software.com/extend/plugins/simple-facebook-connect/

Viewing 15 replies - 1 through 15 (of 15 total)
  • Plugin Author Samuel Wood (Otto)

    (@otto42)

    www.ads-software.com Admin

    Yes, it just started doing this to me too. I think Facebook changed something. I’ll investigate it, but I likely won’t be able to get a fix out until Monday.

    Any news?

    Plugin Author Samuel Wood (Otto)

    (@otto42)

    www.ads-software.com Admin

    The OAuth2 broke this. I have a patch in trunk now if you want to try it.

    You’ll need the newer sfc-base.php and sfc-photos.php files:

    https://plugins.svn.www.ads-software.com/simple-facebook-connect/trunk/

    I got the newer sfc-base.php and sfc-photos.php and I still get this error:

    Warning: Invalid argument supplied for foreach() in /homepages/9/d245243236/htdocs/wp-content/plugins/simple-facebook-connect/sfc-photos.php on line 133

    And one question, with this working I can get an album from a facebook page, or just from my profile?

    Plugin Author Samuel Wood (Otto)

    (@otto42)

    www.ads-software.com Admin

    Regarding the error: You may have to wait about 6 hours for the old transients to expire before it will try to get the photo albums again.

    And it only works with your profile at the moment.

    I think I misunderstood that… I want to fetch a whole photo album from a fanpage and publish it on a wordpress page.

    Is it posible with this plugin? Maybe I can use the core code of the plugin to make the page-facebook connections and add some code just to get the album?

    Thanks again!

    Plugin Author Samuel Wood (Otto)

    (@otto42)

    www.ads-software.com Admin

    No, that module doesn’t put whole albums on there as galleries at this time. It just lets you add photos from your FB account to the page content, similar to adding a normal photo.

    It also doesn’t do albums from Pages, just your user’s albums and photos.

    Same error to me.

    Warning: Invalid argument supplied for foreach() in /home/.../wp-content/plugins/simple-facebook-connect/sfc-photos.php on line 132

    I Love SFC. [:D]

    I just updated from 0.X to 1.1 |

    wordpress version is 3.3

    and i’m getting
    Warning: Invalid argument supplied for foreach() in /usr/home/vftp/****************/***********/wp-content/plugins/simple-facebook-connect/sfc-photos.php on line 132

    any fix yet?

    Plugin Author Samuel Wood (Otto)

    (@otto42)

    www.ads-software.com Admin

    Does the development version of the plugin work for you? It seems to work okay for me on my site with WP 3.3. The FB images area is ugly, but functional.

    You can find the dev version of the plugin here:
    https://www.ads-software.com/extend/plugins/simple-facebook-connect/download/

    that one is working ??

    thanks !!!

    takes a while to load ( seems normal to me as it needs to download it from facebook)

    1 thing when you didn’t approve facebook yet you will get the following
    Warning: Invalid argument supplied for foreach() in /usr/home/vftp/*****/********/wp-content/plugins/simple-facebook-connect/sfc-photos.php on line 133

    if you then click connect facebook there is no problem…

    Founded this one on my girlfriends account.

    Plugin Author Samuel Wood (Otto)

    (@otto42)

    www.ads-software.com Admin

    Fixed warning in dev. version.

    Speed is slow first time as it loads data, but it caches the result using transients. So speed after that will be faster but it may take a few hours for new photos on FB to appear there.

    Experienced a similar issue but resolved it thanks to this thread. Any possibility that adding photos from a page will be coming in future updates? ??

Viewing 15 replies - 1 through 15 (of 15 total)
  • The topic ‘[Plugin: Simple Facebook Connect] Photo Browsing gets PHP Error when I try to connect’ is closed to new replies.