{"id":227,"date":"2010-09-03T23:32:54","date_gmt":"2010-09-04T03:32:54","guid":{"rendered":"http:\/\/www.alquier.org\/linfa\/work\/?p=227"},"modified":"2010-09-03T23:32:54","modified_gmt":"2010-09-04T03:32:54","slug":"fixing-lifestreams-broken-icons","status":"publish","type":"post","link":"http:\/\/www.alquier.org\/laurent\/sites\/2010\/09\/03\/fixing-lifestreams-broken-icons\/","title":{"rendered":"Fixing Lifestream&#039;s broken icons"},"content":{"rendered":"<p>After a failed attempt at using action streams with Movable Type, I was very pleased to discover the <a href=\"http:\/\/www.enthropia.com\/labs\/wp-lifestream\/\" class=\"broken_link\">Lifestream<\/a> plugin for WordPress.<\/p>\n<p>I set up my <a href=\"http:\/\/www.alquier.org\/home\/\" class=\"broken_link\">Family site<\/a> to use Lifestream with various feeds from family members. Along with the P2 theme, it has been working great as a shared hub for family members&#8230;. except for some issues with the way Lifestream displays icons.<\/p>\n<p>For some reason, the URL to icons (and thumbnails when available) includes the full base path of the icon file.<\/p>\n<p>One solution ? Track down where path names are set and remove the base file path &#8211; until the real issue is resolved in a future version of this great plugin.<\/p>\n<p>The piece of code to update is in the &#8216;lifestream\/inc\/core.php&#8217; file, at line 2336.<\/p>\n[code]\n\t\t$file_path= $this-&gt;lifestream-&gt;get_absolute_media_url($path);<br \/>\n\t\t$file_path= str_replace(str_replace(&#8216;\\\\&#8217;,&#8217;\/&#8217;,WP_CONTENT_DIR),&#8221;&#8221;,$file_path);<br \/>\n\t\treturn $file_path;<br \/>\n\t}<\/p>\n<p>\tfunction get_public_url()<br \/>\n\t{<br \/>\n\t\treturn $this-&gt;get_constant(&#8216;URL&#8217;);<br \/>\n\t}<\/p>\n<p>\tfunction get_image_url($row, $item)<br \/>\n\t{<br \/>\n\t\t$file_path= is_array($item[&#8216;image&#8217;]) ? $item[&#8216;image&#8217;][&#8216;url&#8217;] : $item[&#8216;image&#8217;];<br \/>\n\t\t$file_path= str_replace(str_replace(&#8216;\\\\&#8217;,&#8217;\/&#8217;,WP_CONTENT_DIR),&#8221;&#8221;,$file_path);<br \/>\n\t\treturn $file_path;<br \/>\n\t}<\/p>\n<p>\tfunction get_thumbnail_url($row, $item)<br \/>\n\t{<br \/>\n\t\t\/\/ Array checks are for backwards compatbility<br \/>\n\t\t$file_path= is_array(@$item[&#8216;thumbnail&#8217;]) ? $item[&#8216;thumbnail&#8217;][&#8216;url&#8217;] : @$item[&#8216;thumbnail&#8217;];<br \/>\n\t\t$file_path= str_replace(str_replace(&#8216;\\\\&#8217;,&#8217;\/&#8217;,WP_CONTENT_DIR),&#8221;&#8221;,$file_path);<br \/>\n\t\treturn $file_path;<br \/>\n\t}<br \/>\n[\/code]\n<p>I had to resort to some contortions because, since my server is running on Windows, WP_CONTENT_DIR looked something like : &#8220;C:\\inetpub\\wordpress\\home\/wp-content&#8221;.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>After a failed attempt at using action streams with Movable Type, I was very pleased to discover the Lifestream plugin for WordPress. I set up my Family site to use Lifestream with various feeds from family members. Along with the P2 theme, it has been working great as a shared hub for family members&#8230;. except for some issues with the&hellip; <\/p>\n<p><a class=\"more-link\" href=\"http:\/\/www.alquier.org\/laurent\/sites\/2010\/09\/03\/fixing-lifestreams-broken-icons\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[122,1],"tags":[133,157,17],"class_list":["post-227","post","type-post","status-publish","format-standard","hentry","category-patches","category-uncategorized","tag-customization","tag-plugin","tag-wordpress","xfolkentry","clearfix"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p8frwa-3F","jetpack_likes_enabled":true,"jetpack-related-posts":[],"_links":{"self":[{"href":"http:\/\/www.alquier.org\/laurent\/sites\/wp-json\/wp\/v2\/posts\/227","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.alquier.org\/laurent\/sites\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.alquier.org\/laurent\/sites\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.alquier.org\/laurent\/sites\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.alquier.org\/laurent\/sites\/wp-json\/wp\/v2\/comments?post=227"}],"version-history":[{"count":0,"href":"http:\/\/www.alquier.org\/laurent\/sites\/wp-json\/wp\/v2\/posts\/227\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.alquier.org\/laurent\/sites\/wp-json\/wp\/v2\/media?parent=227"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.alquier.org\/laurent\/sites\/wp-json\/wp\/v2\/categories?post=227"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.alquier.org\/laurent\/sites\/wp-json\/wp\/v2\/tags?post=227"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}