Showing posts with label blackbird pie. Show all posts
Showing posts with label blackbird pie. Show all posts

Monday, December 13, 2010

How to Embed Tweets In Your Posts

embed-tweet-blackbirdBlog posts,Twitter, Facebook and many other social networks often go hand in hand. When you publish a blog post, you will often tweet the link to your Twitter account. Sometime when you send a tweet, you will also embed it in your blog post. The problem is, embedding a tweet in your post is not as easy as it should be. It often involves taking screenshot of the tweet, crop/edit it before you upload it to your post. With the introduction of Blackbird Pie, the whole process just become much easier.

Blackbird Pie is a method created by Twitter Media to easily embed a tweet on your site. Feed it with the tweet's URL and it will generate the necessary code for you to copy/paste to your site.

Sunday, December 12, 2010

Fixing the Blackbird Pie Plugin - undefined function mb_strlen

If you are using the Blackbird Pie plugin to embed tweets to your posts, you might see an error message Call to undefined function mb_strlen(). The reason for this error is because the plugin is using the mb_strlen function that is not activated by default.

To fix this, go to the Blackbird Pie plugin folder and open unicode.php in your text-editor. At line 18, replace the line:

[php firstline="17"]return mb_convert_encoding($swap,"UTF-8"); //not really necessary, but why not.[/php]

with

[php firstline="17"]if ( function_exists('mb_convert_encoding') )
return mb_convert_encoding($swap,"UTF-8"); //not really necessary, but why not.
else
return $swap;[/php]

At line 21 and 25, replace the line:

[php]$strlen = mb_strlen($string);[/php]

with

[php]if(function_exists('mb_strlen'))
$strlen = mb_strlen($string);
else
$strlen = strlen($string);[/php]

Save and upload the file to your server. It should work now.

via WordPress Support