Archive for the ‘open-source’ Category

Released Wordpress plugin bbRedirector

Tuesday, November 24th, 2009

I’ve just released another Wordpress plugin. This one is called bbRedirector:

bbRedirector makes it easy to redirect a page to another location using absolute urls from within Wordpress. No mod_rewrite nor .htaccess is needed. You just create a page, add a specific customfield and choose the redirect template included with this plugin. It even allows you to set the required http status code (302 or 301). You can also set a default sitewide redirection or setup your own custom redirection.

The included templates should give you an easy start using this plugin.

Download the plugin from http://wordpress.org/extend/plugins/bbredirector/

First commit of a theme for all Creative Commons chapters around the globe?

Wednesday, November 11th, 2009

Today, I finally added my first commit of the Creative Commons Netherlands(CC NL) wordpress theme (see also ‘New Creative Commons Netherlands site launched’) to the Creative Commons.org git repository. This means that other local CC chapters only need to install Wordpress and install this theme to have their own Creative Commons website. For example, Creative Commons France could now easily update their website and have a look and feel similar to Creative Commons Netherlands (and thus Creative Commons.org), without having to develop a theme on their own. By using this template, local Creative Commons organizations show more cohesion between the different CC chapters and allow them to be identifiable as part of the global Creative Commons movement.

I’m very interested in the response on this theme, although it’s still kinda rough around the edges. I still need to find some time to replace the Dutch names for English, write something down on how to use the theme  and there’s probably tons of stuff that might need some tweaking, but at least it’s in the repository.

If you’re interested in using it yet something is keeping you from doing this feel free to contact me and I’ll see what I can do to help you.

Last but certainly not least, I would like to thank:

- Paul Keller (Creative Commons Netherlands) for recognizing the potential use of this theme for other local CC chapters around the world.
- Mike Linksvayer and Nathan Yergler from Creative Commons.org for their enthusiasm, help and infrastructure.

Wordpress Mu pages overriden by new blogs

Friday, November 6th, 2009

When using WordPress Mu (WP MU) 2.8.4 or 2.8.5.2 (not tested on older versions) with sub directories it seems one can override the main blog’s pages by creating a blog with the exactly the same name without any warning. Causing visitors to be redirected to the newly created blog instead of the page with the same name. I presume most people would not expect this and in fact it can become quite nasty. So I filled a bug report.

Assume this situation:
You have a WPMU site set using sub directories available at http://mywebsite.dev/. You’re using the primary blog as your website with mostly pages. One of those pages is called “Donation”. You allow other people to register and create a blog. Someone creates a blog called “Donation” and without warning the previous existing page “Donation” has been redirected to the blog “Donation”.

Obliviously, this should not happen.

As I understood from Donncha (lead-developer of WP MU), in earlier version there was a check to prevent this from happening. I haven’t tested older versions so I cannot confirm nor deny this. However in the current and previous stable version of Wordpress Mu this unexpected behavior does happen. There are some solutions in order to prevent this from happening:

  • Use sub-domains instead of sub-directories. Since each blog will become a sub-domain instead of a sub-directory it will not clash with any pages created in the
    main blog.
  • Prevent any blogs from being created with the same slug (path) as a page in the primary blog. This fixes the issue with WP MU and sub-directories

I created a plugin called “bbMuAutoBanPage” for the latter, which uses the “Banned Names” option in the site admin. Basically it keeps track of the pages created in the primary blog and adds the slugs to the illegal_names options which is used for the “Banned Names” functionality. This is a temporarily fix until this issue is properly fixed in the core WP MU code. Until then you can use my plugin, which I highly recommend if you allow people to register their own blog on your WP MU install. DOWNLOAD IT HERE

In my humble opinion this would be a great moment to have a closer look at the way Wordpress Mu deals with routing, since I would like to see it allow for more fine-grained control.

Wordpress simple redirect

Tuesday, September 1st, 2009

Recently I needed an easy way for a client to create a link in a Wordpress powered website that would automagically redirect a visitor to a certain location upon visiting. Part of the requirement was that this link could be easily remembered and used in printed material such as leaflets and magazines. As an extra option it should be easy to change the location towards the redirection would point. I couldn’t find anything like this so I created a very simple little page template.

How it works:
Copy the template page Page Redirect code below to a file and save it as page-redirect.php in your own template’s directory. Create a Page in Wordpress and set the Page’s template to Page Redirect. Add a custom field to this page with the name redirect_url and the full url of the url you want to redirect to.
For instance: http://www.redirected-location.com. Now save the page and you should now test it by visiting the page you created.

For example (I assume you are using nice urls):

http://www.your-website.com/the-page-title-of-the-page-with-the-redirect-template

If all went well you should be instantaneously be redirected (using a standard php redirect with a 302 HTTP redirect) ) to the url you entered in the custom field. You can easily change the redirect location by changing the value of the custom field.

Code:


< ?php
/*
 * Template Name: Page Redirect
 *
 * Makes it easy to redirect a page to another url, using the parameter redirect_url
 */
$redirect_url = get_post_meta($post->ID, "redirect_url", true); 

// Defaults if no options we're given
if( ! empty($redirect_url) ) {  header("Location: $redirect_url"); } else { echo ""; }
/* Make sure that code below does not get executed when we redirect. */

exit;
?>

As I said it uses the standard PHP redirect, but you could easily change or extend it with more specific http headers if needs arise. Feel free to use the above snippet as you see fit, as far as I’m concerned it’s in the public domain. I hope this might be useful to you. If you have any questions, feel free to leave a comment.

Nerdy way to display a clock

Friday, July 24th, 2009

Clock in terminal

If you want the above clock in your linux terminal then run this command:

watch -t -n1 "date +%T|figlet"

Source: http://podcast.ubuntu-uk.org/2009/07/23/s02e09-the-dimensions-of-time/

Creative Commons tech summit

Tuesday, July 14th, 2009

I wrote this summary of the first Creative Commons tech summit in 2008 at the Googleplex, however somehow it ended up in being a draft in Wordpress for more than a year. I decided to add links and publish it although in the meantime two follow up conferences have already been held. Maybe it still holds some value. Enjoy my rather lengthy ’summary’.

Thanks to Creative Commons.org and The institute of Sound and Images I was able to join the first Creative Commons Tech Summit in San Francisco. Since the amount of participants was limited to 100 people I decided to write a summary for those not able to attend on this blog. There have been more people writing about the summit and the whole thing is made available on Youtube as well. I hope this summary will be of use to you. Feel free to comment. More after the jump.. (more…)

Mapping firefox keyboard shortcut with vimperator to select a tab

Friday, May 1st, 2009

I’ve started to use the Firefox add-on Vimperator. It enables Firefox to behave more like Vim. I installed this add-on, not because I know Vim so well, but because I really like the ability to use my browser with a keyboard.

One of the things I really missed after installing Vimperator was the ability to select an open tab directly by a keyboard shortcut. I’ve used the following mapping (a well known method to vim users) to fix this and now I can select an open tab directly.

:map <C-1> :tabn1<CR>

In the snippet above I created the shortcut CONTROL-1 which selects tab number 1 following with ENTER. I would like to use a variable in the mapping but I have not been able to find out how to achieve this, so for now just add more mappings with following numbers, e.g. replace 1 for 2 etc. If you know how to add variables in vimperator let me know!

If you don’t see the numbers in your tabs or don’t see tabs at all you’ll need to enable the gui, you can use the following snippet:

:set go+=mTBn<CR>

This shows the following gui parts:

  • m Menubar
  • T Toolbar
  • B Bookmark bar
  • n Tab number

Now you should see the gui including the numbers in the opened tabs.

NB: Don’t forget to save the settings with the following:

:mkv<CR>

if you’re already have a saved configuration then you need to add a exclamation mark to the above.

:mkv!<CR>

In reactie op Jan Stedehouder

Monday, April 27th, 2009

Onderstaande is een reactie op Jan Stedehouder naar aanleiding van mijn commentaar op Livre bij de aankondinging van zijn boek ‘Open Source en Open Standaarden. Voor niets gaat de zon op?’ en zijn reactie daarop. Livre laat helaas niet zulke lange reacties toe vandaar dat ik het hier plaats.

(more…)

Commandline bookmarker

Wednesday, March 4th, 2009

When you use the commandline a lot like I do, you sometimes wonder about the amount of typing involved. Even if you use tabs like a maniac, you’ll probably end up typing certain paths a gazillions times a day. Not anymore…

I stumbled upon a great little time saver called bm (bookmark). It allows you to bookmark (as if you’re in a web browser) certain paths and create a cdbm command which allows you to quickly change directory to the bookmarked path.

1) To create a bookmark type:

bm -a /path/you/want/to/bookmark name_of_your_bookmark

2) To use a bookmark type:

cdbm name_of_your_bookmark

I highly recommend this nifty little timesaver. You only have to compile it (it’s really easy, just follow the two instructions in the README.txt) and I can confirm it works without a hitch on Ubuntu 8.04, but my guess is that it would probably could work on other POSIX systems as well (like OS X).

Thanks to Bart from Onderstekop.nl for creating it!

UPDATE
Download the bm_1.0-1_i386 package I created for Ubuntu. Tested on Ubuntu (9.04) Jaunty on 32-bit architecture and it works for me. Your mileage may vary!

Beeld en Geluid wiki

Wednesday, March 4th, 2009

Sorry Dutch text ahead:

Een van de projecten waar ik de afgelopen tijd (inmiddels al ruim een jaar) mee bezig ben geweest is de Beeld en Geluid wiki:

De wiki beoogt kennis over de collectie van Beeld en Geluid te ontsluiten. Centraal staan films, radioprogramma’s en televisieproducties die in het kader van Beelden voor de toekomst gedigitaliseerd worden.

Op deze wiki staan biografieën van personen. Naast allerlei gegevens over de persoon is er een overzicht van het oeuvre én een beschrijving van programma’s waarin een persoon te gast was of onderwerp van gesprek. Op de wiki staan ook producties beschreven, zoveel mogelijk de makers genoemd en zijn producties ingedeeld in genre en op decennium. Aan de hand van veel verschillende onderwerpen wordt de context van film, radio en televisie beschreven.

Mijn werkzaamheden in dit project varieren van het aanpassen of ontwikkelen van de vormgeving en extensies tot het updaten en ondersteunen van het redactie team. Inmiddels zijn er meer dan 2500 (dit is uitgezonderd overleg pagina’s pagina’s, doorverwijzingen etc) aangemaakt en hebben bijna 650 mensen zich als gebruiker aangemeld. Heel netjes voor een website die pas zeer recent onder de aandacht wordt gebracht.

Persoonlijk vind ik het daarnaast fantastisch dat de inhoud van deze wiki is gelicenseerd onder de Creative Commons Naamsvermelding-GelijkDelen licentie, waardoor ook anderen gebruik kunnen gaan maken van de informatie van deze wiki.

Zie ook de promo op YouTube hieronder: