Forum Replies Created

Viewing 1 replies (of 1 total)
  • Thread Starter Cholo981

    (@cholo981)

    I think a found a partial solution, probably won’t work for everything but it works for me.

    The issue was in the default visualization, because you don’t strip the xhtml code in this situation, but if you do it, you will strip the image too.
    So I did basically what you do in the text only/image only situation, and I merged the results:

    default:
    	preg_match_all('@<img.*src="([^"]*)"[^>/]*/?>@Ui', $description, $img);
    	if(!empty($img)){
    
    		$img = end($img);
    
    		if(isset($img[0]) && $img[0]!=''){
    			$img = $img[0];
    
    			$img = current(explode('?', $img));
    			$html_arr[$unique_key][]= '<img src="'.$img.'" />' . $this->string_limit_words($this->clean_xhtml($description), $feed_words).' ...';
    
    		}else
    			$html_arr[$unique_key][]= $this->string_limit_words($this->clean_xhtml($description), $feed_words).' ...';
    	}
    break;

    And then moved the following “if block” inside the “image_only” case.

    One feed (the second) doesn’t show the picture, just the text. But at least, the page is ok. Good enough. 😛

    Aside this, can I ask you something about the graph API? I can’t find the answer anywhere. Do you think is possible to read the ‘url’ attribute from the ‘enclosure’ tag in the RSS? I would love to show an html5 audio player if the feed has an audio attachment.

    Thanks for your effort.
    cheers

Viewing 1 replies (of 1 total)