New Wordpress Plugin: Twitter Status

November 16th, 2008

ScreenshotTwitter Status is a very simple no-fuzz plugin that gets the current Twitter message from the Twitter ID specified, when someone visits your website there will be an ajax script running in the background doing a GET request every 30 seconds.
This request will trigger the Plugin to get all Author profiles with a twitter ID, and update their Twitter status, given that they haven’t been updated in at least 30 minutes and with a limit of 5 twitter profiles per request.

You can change these settings by editing the plugin file (before activating it).. the settings are easily accessible, no knowledge of PHP required.. I will incorporate a configuration page in future versions, for now I wanted to make an initial release that’s down to the complete basics.

I am also working on a couple more usefull plugins which should be coming along soon..

  • Post Filters
    Gives you the ability to have posts .. 

    • Skip the Frontpage
    • Act as a sticky on Category pages (and -only- on Category pages)
  • Raw Posts
    Will process posts EXACTLY the way you edit them in the wysiwyg editor, it bypasses the wordpress filters completely.
    This will quite definitely create conflict with plugins that rely on Wordpress’ filtering.
  • Raw Syntaxhighlighter
    Source code highlighter that works with the Raw Posts plugin

I’m also working on a PDO wrapper to make it’s functionality more accessible, though this is of course not related to Wordpress in any way.

Multiple spaces in Wordpress posts

November 12th, 2008

nbspIf you’ve ever tried posting source code on your blog you probably have noticed that Wordpress has the annoying habbit of stripping out multiple spaces out of your post, god knows why.

Anyway, I was not the only one getting annoyed by this and so a plugin already exists to fix this behaviour, only this plugin will make ugly nbsp’s appear in your post when editing it, to fix this, simply replace line 39 with the following

$text = str_replace(' ',' ',$text); // Allow NBSP's

That’s it, you should now be able to use multiple spaces in your posts.

Adding Smilies to your Wordpress Plugins

November 11th, 2008

wordpress-logoWhilst monitoring the #wordpress irc channel on irc.freenode.net I came across a question by “erchik” asking how to add smilies to his widgets.

After some researching I found this to be quite simple, of course there is unfortunately no global way of doing this for all your widgets at once, since every widget has it’s own backend, but it’s quite easy to achieve and is not limited to widgets, you can use it in plugins and templates all the same.

Simply add the following lines to your code right before you are outputting the string that you want to contain smilies


global $wp_smiliessearch, $wp_smiliesreplace;
$content = preg_replace($wp_smiliessearch, $wp_smiliesreplace, $content);

Replace $content with the name of your string containing the content.
Read the rest of this entry »