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

No comments:

Post a Comment