My Head Radio

A colleague of mine is the founding member of the My Head Radio band and last September 11th, on his birthday, My Head Radio has released both their new website – myheadradio.com – and their debut album: On Air. Great music, great lyrics and an awesome designed logo!

Oh, btw, just keep an open mind towards the music because it’s something totally different then you are probably used to but it’s a completely wicked sound!!

WP Fix: what to do when visual text editor jams

In order to get the code in the previous post I installed WP-Syntax and learned pretty quickly that the plugin ruins the visual text editor functionality… arrggg!

Simply uninstalling the plugin wasn’t good enough so after some research on the WordPress Support Forum I came across the following procedure to fix the issue:

  1. Disable (and if needed remove) the plugin which causes the visual text editor of functioning normally.
  2. Clear the browsers cache (in Firefox, use the Clear Private Data menu) and restart the browser.
  3. Go to /wp-includes/js/tinymce/tiny_mce_config.php and find the following line:
    'compress' => true,

    and change the true value into false.

  4. Log on to your WordPress admin area and now the visual text editor should be functional again.
  5. If everything is working you can now undo the code change of step 3.

As you can see, the WP-Syntax plugin is still running and I can still use the visual text editor but that will take some modifications of the WP-Syntax code. I will post those changes later this week.

WP Fix: automatic update open_basedir error

In WordPress 2.7 there is a nice feature to automatically update plugins or the core via one simple click on a link. For quite a while I couldn’t get it to work as it was producing errors like:

Warning: file_exists() [function.file-exists]: open_basedir restriction in effect. File(/var/tmp//1220989448) is not within the allowed path(s): (/home/usr123/:/tmp:/usr/local/lib/php/) in /usr/home/usr123/../wp-includes/functions.php on line 1960

Warning: touch() [function.touch]: open_basedir restriction in effect. File(/var/tmp/1220989448) is not within the allowed path(s): (/home/usr123/:/tmp:/usr/local/lib/php/) in /usr/home/usr123/../wp-admin/includes/file.php on line 122

Warning: fileowner() [function.fileowner]: open_basedir restriction in effect. File(/var/tmp/1220989448) is not within the allowed path(s): (/home/usr123/:/tmp:/usr/local/lib/php/) in /usr/home/usr123/../wp-admin/includes/file.php on line 487

Warning: unlink() [function.unlink]: open_basedir restriction in effect. File(/var/tmp/1220989448) is not within the allowed path(s): (/home/usr123/:/tmp:/usr/local/lib/php/) in /usr/home/usr123/../wp-admin/includes/file.php on line 489

This morning I finally found THE hint that has lead me to the solution to fix it and to be honest it was amazingly simple!!

WordPress is trying to use the wrong path, duhh, but the correct path is also provided in the error message. In my case I have to point WordPress to the /tmp path instead of the found /var/tmp path!!

When you follow the error messages you finally end up in the get_temp_dir function (/wp-admin/includes/file.php:97) which basically provides the answer straight away after you run a full source code search on WP_TEMP_DIR…

function get_temp_dir() {
 if ( defined('WP_TEMP_DIR') )
 return trailingslashit(WP_TEMP_DIR);

So the solution is to define WP_TEMP_DIR in the wp-config.php file:

define('WP_TEMP_DIR','/tmp');

Happy auto updating!

WP Plugin: Agenda

Today I came across a new events plugin called Agenda. Looks very promising even without a prepacked widget. So after playing around with it for a short while I started to write a plugin for it (source here) and hopefully it will be adopted by the plugin author, DGMike.

While writing the widget I also noticed some bugs and the need for some extra features.

Features:

  1. Ship a widget with it – you can use my Agenda Widget for this, see source.
  2. Show today’s and all day event’s until their end time.
  3. Remove time notification when it’s a all day event.
  4. Change $title_tag into to the $before and $after model for more template flexibility.
  5. Localization by translation domain. Change:
    __('text')

    into:

    __('text', 'agenda')

    Have also used that in the plugin I have created.

  6. Ship a .pot with it for translators. I will translate into Dutch when available.

Bugs:

  1. When repeating on a daily basis the start time changes (looks like the function add (for example) 24 hours to the end time instead of the start time). )
  2. Visual editor isn’t working.
  3. Time droplists are out of sync with the input boxes (further to the right).
  4. When using agenda_compromissos() the <a href> isn’t populated.
  5. Add ‘no events’ message when there are no events to show, I’m now getting an error message.
  6. Styling doesn’t fit in the (smaller) crazyhorse design of 2.7 and perhaps it’s an idea to keep in line with the default WP colors for the background.

Remarks:

  1. The ‘Event’ page should not be registered as a menu item when you use 2.7 as the structure of the menu’s has changed. The Add New link on the Events page will follow the style WP is using on the Posts and Pages pages.

Questions:

  1. How can you get the location and date(s)/time(s) visible in the post?

I will put some effort in this plugin as well as I really like it so I will start cracking the extra features and bugs as well and will make suggestions to DGMike.

Need 7 people to say NO

On my ongoing quest to get myself a (rental) house I had a group sighting on Monday for a really nice rental house in Oude Wetering. Oke, there is a lot of work to do when it’s assigned to me as the interior needs a need paint job and it needs a new floor as well. The rental company will replace the kitchen and most of the bathroom and the garden is quite a disaster but what the heck, I don’t care to turn it into something nice over time. The only catch is that the first 17 (!!) people on the list didn’t want the house so they invited the next 10 on the list of which I’m number 8… So, basically, all I need is that the 7 in front of me say no thanks to the rental company. So wish me luck and hopefully I have myself a rental house by this time next week ;)