Support » Plugins and Hacks » avatar with combined page-feeds does not work

avatar with combined page-feeds does not work

  • When creating a widget (or post, does not matter) based on multiple feeds (which is a GREAT feature btw) the avatar is not displayed.

    The generated html will look something like this:
    <img src=”http://graph.facebook.com/213782675400785,355978507813883/picture?type=square” alt=”/”>

    As you can see the pageId’s are combined. Am i doing something wrong or does this need a fix?


Viewing 1 replies (of 1 total)
  • ok… I did some hacking…
    I am not a PHP developer whatsoever, so if anyone writes some prettier code I will definitely use it, but for now this will work just fine 🙂

    I made two edits:
    edit 1:
    drop events (does not show anything AND I’m not able to determine from which stream they are from)

    foreach ($blocks as $block) {
    		if($pos = strpos($block->get_link(), "facebook.com/events/") > 0){

    The second edit does the real work:

    # Shows avatar of Facebook page
    			if ($options['show_avatar'] != '') {
    				//SM20130403 - show correct avatar when dealing with multiple streams
    				//get PageId from <link> (which is quite different everytime, but one thing is consistent: somewhere in it, there is the pageID OR the name
    				//except for events (but those should be skipped anyway, because they always have an empty description
    				$currentPageID = $options['pageID'];
    				$link = $block->get_link();
    				if($pos = strpos($link, "/posts/") > 0){
    					$querystring_array = explode('/',$link);
    					$currentPageID = $querystring_array[3]; //actually, it is the name, but we will live with that :)
    					 foreach($rss_array as $feed_link_id){
    						if($pos = strpos($link, $feed_link_id) > 0){
    							$currentPageID = $feed_link_id;
    				//SM20130403 $returnMarkup .="<div class=\"facebook_page-avatar\"><img src=\"http://graph.facebook.com/".$options['pageID']."/picture?type=".$avatar_size."\"  alt=".$block->author." /></div>";
    				$returnMarkup .="<div class=\"facebook_page-avatar\"><img src=\"http://graph.facebook.com/".$currentPageID."/picture?type=".$avatar_size."\"  alt=".$block->author." /></div>";

    Dropping of the events does have one side-effect: the number of posts to show does not work correct anymore. Since I can live with that I did not create a counter or something like that. Maybe for the next developer 🙂

Viewing 1 replies (of 1 total)
  • The topic ‘avatar with combined page-feeds does not work’ is closed to new replies.