Archive for the 'wordpress' Category

User-Relevant Timezones 0.1

Thursday, August 16th, 2007

My friend Stephen and I have just written a WordPress plugin to show the times on your blog in the user’s timezones. Check it out!

New Wordpress Plugin: Per-Post CSS

Friday, May 4th, 2007

So, I’ve just created a new plugin, Per-Post CSS, which allows you to specify some CSS which will only show up when it’s particular post is being displayed. You can find out more, and download it here: Per-Post CSS.

Wordpress Plugin Template

Sunday, March 18th, 2007

Fellow Wordpress enthusiasts,
I have written several Wordpress plugins for a client over the last few weeks. Through these, I have gained some techniques for creating widgets which work as non-widgets, and also have their own options pages. With this newfound knowledge, I have created a generic plugin template. It includes all the framework necessary for a displayable plugin (Something which will show up in a sidebar, template, or anywhere in a post using a token such as <!-- someplugin -->). The template is full of comments, so you shouldn’t have trouble figuring it out. You can download it here: Wordpress Plugin Template

Translate Widget 2.0

Saturday, February 17th, 2007

Translate WidgetI have just finished a major update to my Translate Widget. This widget plops into you sidebar, using the Wordpress Widgets plugin. To quote my younger self:

it adds little flags to your sidebar, which will take you to a translation of the current blog page. It uses Google Translate, but removes the frame, so it looks quite nice! Once you’re in one language, you can browse around the blog, and everything stays translated. You can just click on the English flag to get back to the original language. You should see it on my sidebar now, and you can give it a trial run.

Here’s the download: Translate Widget 2.0

The zip includes a /flags/ folder, and a translate.php file. Both need to be placed in the /wordpress/wp-content/plugins/widgets/ folder.

Donations

If you appreciate my plugins, and feel compelled to spread some love, I would certainly appreciate it. No obligation though, of course.


Improvements in Version 2.0:

  1. Multiple starting languages are now supported. So, if your blog is in a foreign language, this widget will now translate it to English and any other supported languages. This is a big deal, since it opens the widget up to the international community. One guy got this working for French, but now all supported (by Google) languages are available.
  2. Russian is added to the list of languages
  3. A control interface was added:
    Translate Widget 2.0 Control Interface

People using the Plugin

I’ve just started to compile a list of those who use this plugin on their websites. You can view the list here.

Word Fix Plugin

Friday, January 26th, 2007

I am proud to announce the arrival of my second wordpress plugin! My first was a translate widget, which was very popular, but this one is of a different family. As users of Wordpress may know, a nice WYSIWYG (What You See Is What You Get) editor is now included for writing posts. A frustration I ran into when working on a project was that when pasting text from Microsoft Word, or an email, junky formatting from there often carried over, sometimes surprising readers with out-of-place fonts and colours. I personally write all my posts in the editor, but in this case, the users of Wordpress needed to be copying out of Word and emails. The solution? Write a plugin to clean up the mess, of course.

Word Fix will remove all the peculiar fonts, colours and other styles which may appear after copying text from other applications. It saves you the hassle of cleaning up the direct HTML code, which is especially handy if you or your users dont’ have the knowledge or time to dive into the code.

Installation: This is a bit tricky, because the plugin is actually for TinyMCE, the visual editor software, not Wordpress itself.

  1. Download the plugin for your version of Wordpress (2.0, or 2.1).
  2. Unzip it, and upload the “wordfix” folder into your “wp-includes/js/tinymce/plugins/” directory.
  3. Now, you need to modify a file. For Wordpress 2.0, switch your “wp-includes/js/tinymce/tiny_mce_gzip.php” file with this one. For Wordpress 2.1, switch your “/wp-includes/js/tinymce/tiny_mce_config.php” file with this one. All I’ve modified is adding the wordfix plugin to the list of loaded plugins, and the visible buttons on the editor.

Now when you go to write or edit a post, you should see the Word Fix button at the end of your toolbar: Word Fix. Simply click it, and the text in your editor pane will be cleaned up! It’ll take just a second, and you’ll see the text flash a bit when it’s complete. If for some reason it messed something up, just hit Control-Z to undo it. Save your post when the changes are finished, and your formatting should look the way it was meant to! I recommend you run this as soon as you copy in the text, and then proceed to make any other formatting changes after.

To uninstall the plugin, remove the two instances to ‘wordfix’ in either the tiny_mce_gzip.php (2.0) or tiny_mce_config.php (2.1) file. Then you can remove the wordfix folder in “wp-includes/js/tinymce/plugins/”.

If you want the details of what this plugin does exactly to your text, read on. Otherwise, go enjoy your nice clean formatting! First, all the html tags except for these are removed: (<a><img><p><u><b><i><strong><em><ul><li><ol><br><strike><code><abbr><!–more–>). Then, all class, id, and style attributes are removed from all tags. Then, all <b> and <i> tags are changed to <strong> and <em>, to match Wordpress standards. Combined, these steps eliminate all the formatting headaches I have encountered.

Icon based on the Silk Icons.