Cours d'initiation aux blogs le 26 février [fr]

[en] On February 26th I will be holding my first public blogging class (beginners) at the ISL.

The workshop I am holding tomorrow morning at LIFT covers the same material, but in English.

Mise à jour, 13.02.2008: ce cours est repoussé car la préparation de Going Solo ne me permet pas d’en faire la promotion correctement. Si vous êtes intéressé par ce genre de séminaire, contactez-moi et je vous ferai signe dès qu’un nouveau séminaire sera mis sur pied. Des cours pour particuliers sont également possibles.

J’organise un cours d’initiation aux blogs mardi 26 février 2008 dans les locaux de l’ISL à Lausanne.

  • Quand: mardi 26.02.08, 18h30-21h30 (3h avec une petite pause)
  • Où: ISL, Chemin de la Grangette 2 – 1052 Le Mont-sur-Lausanne (Clochatte)
  • Accès: en bus, prendre le 16 jusqu’au terminus, et c’est en face; en voiture, sortir à Epalinges ou à la Blécherette si vous venez par l’autoroute — il y a des places de parc à disposition devant l’école.
  • Qui: non-blogueurs (si vous avez déjà un blog, vous allez vous ennuyer ferme), pas de prérequis technique autre qu’être capable d’aller vérifier son e-mail via le web.
  • Combien: 150 CHF pour les 3 heures de cours, à payer une fois le nombre de préinscriptions suffisantes (5 personnes)
  • Comment: préinscription en envoyant un e-mail à Stephanie Booth, précisant nom, adresse, et nombre de personnes s’intéressant au cours.

Ce cours s’adresse à toute personne désireuse de découvrir ce qu’est un blog, pour son usage personnel. Pour plus d’informations, voir directement la page dédiée à ces ateliers pratiques.

Comme les lecteurs de ce blog ne sont a priori pas les personnes qui seront intéressées par ce genre de cours, je vous remercie infiniment de faire passer le mot auprès de votre entourage!

Blog Host Ugliness [en]

[fr] Une amie Serbe s'est vu poser un ultimatum par son hébergeur de blogs: 24 heures pour supprimer commentaires d'un autre blogueur et liens vers ses sites, ou voir son blog disparaître.

L'hébergeur en question (qui utilise WordPress multi-utilisateurs, comme WordPress.com) avait en outre désactivé la fonction d'exportation de blog.

On s'en est sortis comme on a pu (voir ici).

Mis à part le côté technique de l'affaire, il est absolument scandaleux qu'un hébergeur de blogs se permette d'agir ainsi. Certes, tout hébergeur est libre de "virer" des clients -- mais déactiver au préalable la fonction d'exportation des blogs, cela atteint des sommets de mesquinerie. A bon entendeur.

Edit: sur Seesmic, l'histoire en français et en vidéo.

Note: I’ve updated this post as I gathered information allowing me to see more clearly in this whole mess. Please read the comment if you’re going to jump in the conversation or blog about this.

Wednesday night, my friend Sanja from BlogOpen (she was my very kind and competent hostess) pinged me on IM. She had less than 24 hours to export her blog before her blog host shut it down.

It was a blog hosted by WordPress multi-user [Edit: not WPMU]. Easy enough, I thought. There is an export function. Unfortunately, when I logged in (the interface was in Serbian, but I can find my way through WordPress with my eyes closed), this is what I found:

WordPress (MU?) with no Export

Even if you don’t understand Serbian, you can see there is a missing tab. I tried calling /wp-admin/export.php directly, but the file had been removed.

Well, after a bit of poking, prodding and thinking, this is what I came up with (reminder: WPMU means that you can’t there was no possibility to install plugins and no direct access to the server):

Last Hope Export of WordPress MU Blog

I went into Options > Reading. I set the feeds to “entire post”. As there were 110 posts in this blog, I set the home page to display all of them, with a little margin for error. There were more than 1400 comments, so I set the maximum number of items in a feed to 1500.

Then I did three things:

  • saved /feed (an RSS dump of the blog posts)
  • saved /comments/feed (an RSS dump of the comments)
  • scraped the blog (with single blog post pages) as an extra backup by running wget -r -l1 -w1 BLOGURL (thanks, John) from my server (also to save the images).

The blog was saved. I couldn’t import the RSS dump of blog posts into WordPress.com, where I told Sanja to open a new blog account, so I quickly set up a regular WordPress install on my server, imported it there, and exported it in WXR format. Great.

Comments, however, are another story. If you’re in a hackish mood, any help would be appreciated.

We’ll probably have to deal with the images too once the blog has been completely wiped off the 381.com server — for the moment it seems like it was disabled, but the images are still there (see this one for example).

There, that was for the technical part.

Now for a personal comment. I find it utterly disgusting and shocking that a blog host owner would give people an ultimatum to leave and disable the export function in the blogging software. Sanja tells me that they had the export function until a few days before the ultimatum.

Of course, a blog host can choose not to host certain people. But trying to lock people in by disabling export of their own data is simply evil. If you’re kicking people off your system, you damn well better make sure they can take their data with them.

Edit, 27.01, 12:00: I’m happy to learn that it seems the disabling of the export function was not related to the ultimatum, and that the blog381 people were not actually trying to actively lock people in. However, it remains that it’s pretty delicate in a conflictual situation to tell people to “submit or leave” when they don’t have a way to export their data on their own.

So, people, please. If you need a blog host, choose a serious one. WordPress.com for example. Or Blogger. Or Typepad. Putting your precious blog between the hands of an individual is risky (weblogs.com, anybody? and if you remember, people on weblogs.com at least had the guarantee they could export their data…)

How did this happen?

I got some details about the situation, but a word of warning about that, first. The source material to this Serbian blogosphere drama is all in… Serbian. I’m relying here on what my friend Sanja told me about the situation, and I do not doubt her good faith. I know, though, that stories do have multiple sides, and that there might be more to the background than what I’m telling you here — but whatever the background story, it cannot justify the behaviour of this blog host.

From what I gathered, what brought about this crisis is a quarrel between two bloggers: Tatjana aka Venus aka Lang (Update: Tatjana is not happy that I’m linking to her and has redirected visitors to this site elsewhere; to see her blog, copy-paste the link http://www.laluve.com/ in your browser), the owner of the Serbian blogging platform blog381.com (not the Tatjana who organized BlogOpen!), and another pretty popular blogger. At some point, Tatjana decided to forbid the people using her platform from linking to this other blogger or harbouring his comments.

Here is the warning she posted on the community forums:

Vlasnik blogova

http://bruh.org/ludizmaj/,

http://www.blogoye.org/pecina/,

http://www.blogoye.org/Mudrosti/,

http://www.blogoye.org/sujeta/

(ima verovatno jos ali ne mogu da trazim)

je ovom blog sistemu naneo stetu laziranjem glasova oko izbora za najblogera (na kom je on bio ‘pobednik’), ‘miniranjem’ sledeceg izbora, sirenjem neistina, traceva, vrbovanjem novih blogera sa tri osam jedan sistema, a sve u cilju da se naskodi ovom sistemu a poveca sopstveni traffic i “ugled”.

Za one koji nisu dovoljno informisani i sve ostale koji su slusali ili nisu, samo jednu stranu price od gore pomenutog, necu dodatno iznositi nikakve detalje, niti vise imam nameru da se borim sa provincijalizmima pojedinih ljudi koji su bili ili jesu na neki nacin u komunikaciji sa blogom381 i njegovim korisnicima.

Slobodna volja svakog od nas da pise kako i gde hoce, ali oni koji se odluce da i dalje pisu ovde nece moci da imaju linkove ka ovim blogovima niti komentare vlasnika istih.

Ukoliko imate zelju,nameru ili potrebu da ostanete na ovom blog sitemu, obrisite linkove i komentare gore pomenutog blogera u roku od 24h.

Translation (Sanja was a bit tired, so forgive the wobbliness):

The owner of these blogs
http://bruh.org/ludizmaj/,
http://www.blogoye.org/pecina/,
http://www.blogoye.org/Mudrosti/,
http://www.blogoye.org/sujeta/

has caused damage to this blog system by faking votes for the election of “The best blogger” (where he was “the winner”), and was undermining the next election by spreading gossip, lies, and recruiting new 381 bloggers, with only one aim: to damage this community and increase his own blog traffic and “reputation”.

For those who are not informed well enough, and all others who were listening or didn’t, only one side of the story of the person mentioned above, I will not give any additional details, nor do I have the intention to fight with provincialism of some people who were or in some way are connected to blog381 communication and their users.

It is the free will of each of us to write how and where we want to, but those who decide to keep writing here, will not be able to have links to these blogs or comments by their owner.

Those of you who have the wish, intention or need to stay on this blog system, should delete links and comments of the blogger (mentioned above) within 24 hours.

Sanja learnt about this because the owner of the blogging platform left a comment on one of her posts (not the most recent) to let her know about it. Given that the “other blogger” in question is a friend of Sanja’s, she wasn’t going to comply.

Other bloggers have also seen their blogs deleted, or at least de-activated (actually, before the 24-hour limit was up). A dozen or so, says Sanja.

If you want to chime in on the “political” side of this story (particularly if you’re involved in this story or a direct witness), you’re welcome to use my comments. However, I ask (as always) that everybody remain civil and refrain from personal attacks (commonsense blogging etiquette, y’know).

Update: It seems that since Sanja’s blog was deactivated, the whole blogging platform has been shut down, with a message that people can e-mail the administrator to get an export of their blog. This message was not there during the ultimatum period.

In a comment to this post, Tatjana aka Lang asked me to remove the link to her blog, http://www.laluve.com/ , which I had placed upon her name. As I have refused to remove it (linking to the people involved in this story is perfectly relevant, and on the web, you can link to who you want, anyway), she has set up a redirection which sends visitors from this site straight off to CNN. So, I’ve left the link in, of course, but provided you with a handy copy-paste if you want to go and visit her all the same.

Bunny's Print CSS Plugin Upgrade [en]

[fr] Deuxième version de mon plugin pour insérer automatiquement une feuille de style impression dans n'importe quel thème WordPress. Il y a maintenant un panneau d'administration qui permet d'éditer le CSS directement depuis WordPress -- et le CSS en question a été enrichi.

The little print CSS plugin I threw together the other day has had a little upgrade already, and is also now available in the WordPress plugin directory.

First, Kjell Knudsen was kind enough to add to the very basic CSS file I provided with the plugin. It’s now a little richer and should support K2, for example. It’s still open to improvement, so don’t hesitate to link to your propositions in the comments! Maybe at some point I’ll be able to offer more than one stylesheet with the option to choose between them.

Option? Oh yes, option. Because, you see, Print CSS now has an option panel. I’m pretty happy, because it’s my first plugin with an options panel, and I’ve been thinking I should learn how to do that for some time now. The options panel doesn’t do much, however: it simply allows you to edit the print CSS file through the WordPress admin area (if the file permissions are right — chmod 777 or something).

I’d like to extend all my thanks to Yaosan Yeo, who wrote the MyCSS plugin. I heavily lifted the code for the admin panel from it, as it does essentially the same thing: allow the user to edit a CSS file. I’m really loving MyCSS by the way, even if there is a little capitalization glitch in it, because I’m always adding CSS to my themes and it’s a real pain to copy-paste it all over the place each time I switch themes (or from one blog to another).

Off you go now, check out Bunny’s Print CSS in the WordPress plugin repository!

Print CSS Plugin (WordPress) Needs CSS Guru [en]

[fr] Un nouveau plugin, qui permet d'insérer automatiquement une feuille de style pour l'impression dans son blog WordPress.

La feuille de style que j'ai pondue étant bien pauvre, incomplète, et franchement pas terrible, l'aide d'un gourou CSS serait fort appréciée pour mettre à disposition une feuille de style pour impression qui soit jolie, conforme, et à un peu près universelle. Crédit sera donné, bien entendu. (C'est un anglicisme, ça?)

Right, here we go — another plugin. I noticed some time back that many WordPress themes were provided without a print stylesheet.

In my attempt to stop fiddling with my theme files, I dreamed up a simple little plugin that would add a link to a print stylesheet in the page header, and provide a simple, universal, print stylesheet that people could use.

Well, I’ve got half the work done, and it’s my new plugin Bunny’s Print CSS (zip, .phps. “Half the work” because it includes a sample stylesheet and links to it automatically in the theme header when activated, but the stylesheet is nowhere near “complete”, “universal”, “pretty”, or any other nice adjectives you’d like to find associated with a print stylesheet bundled in a plugin.

So, call to all you CSS gurus out there. Can you improve on my print.css? It would be nice if it were at least somewhat sandbox/kubrick compatible. Credit will be (loudly) given.

Now, aren’t there other plugins out there doing similar things? Not that many, at least in the plugin repository. MyCSS allows you to add custom theme-independant CSS to your blog. WP-Print creates a “printable version” of your blog (if I understood correctly, by creating a set of print-friendly pages).

Two Plugin Updates: Basic Bilingual 0.32 and Language Linker 0.2 [en]

[fr] Je me suis levée à l'aube pour aller faire la nouille sur RSR1 et prendre un p'tit déj improvisé chez une ancienne copine d'uni. Ensuite, j'ai passé la journée les mains dans le PHP, ce qui veut dire que je n'ai beaucoup blogué, mais que j'ai mis à jour deux plugins: Basic Bilingual, qui permet de tenir sans peine un blog "bilingue" comme celui-ci (c'est ce qui me permet de rédiger et d'afficher ce petit extrait en français) et Bunny's Language Linker, très utile pour afficher des liens entre pages correspondantes des différentes traductions d'un site.

After waking up at an ungodly hour this New Year’s Day (for a live radio appearance and impromptu breakfast at a uni friend’s home nearby) I spent the rest of my day elbows deep in PHP code. As a result, I haven’t written the half-dozen of posts that have been sitting in my drafts list over Christmas, but I have updated two plugins — an old one, and a new-born.

Basic Bilingual 0.32

Download | zip | .phps

This release fixes the disappearing excerpts problem (was fixed in 0.31 actually, but I never announced it) and replaces the ugly “language box” floating somewhere near the top of the post admin page by a pretty DBX (let me know what it stands for) box in the sidebar:

Basic Bilingual got a dbx box for the new year!

Bunny’s Language Linker 0.2

Download | zip | .phps

(I always want to call it “Language Links”, which was the initial name I chose — still not sure I was right to change.) Anyway, this version is pretty exciting, as it does something I’ve been thinking of for a while: it puts the link to the other localized versions of the page you’re viewing in the menu bar if you’re using a Sandbox-based theme:

Language Linker link in the menu bar!

Otherwise, it puts it at the end of the page in its own div (you can style it the way you wish). I’m not saying this is the best, final solution, but I think it’s headed in the right direction.

Bunny's Language Linker: New WordPress Plugin [en]

[fr] Un nouveau plugin WordPress que je viens d'écrire. Celui-ci vous permet de gérer les liens entre pages équivalentes de deux versions linguistiques d'un site. Par exemple, si vous avez http://stephanie-booth.com/en et http://stephanie-booth.com/fr (deux installations WordPress séparées!), le plugin vous aidera à faire en sorte qu'il y ait des liens entre http://stephanie-booth.com/en/about et http://stephanie-booth.com/fr/a-propos.

Ladies and Gentlemen, I’m proud to announce the WordPress plugin Bunny’s Language Linker (zip, phps).

I’ve been wanting to write this plugin for ages, and I’ve finally done it this evening. This is a plugin for people who have a WordPress site with content duplicated in more than one language, like I’m going to have with stephanie-booth.com. For example, you have an “about” page in English, and another “about” page in German. This plugin helps you create and manage links between such “sister” pages. (“Pages”, not “posts”. It doesn’t work with posts at all.)

The plugin adds an extra field to the page editing form, inviting you to input the page slug of the sister page:

Bunny's Language Linker - Admin view

The screenshot is a bit small, but there on the right, there is a little box with “a-propos” — the slug of the French sister page. It works with more than one other language, too. You just need to edit the settings in the plugin file to specify which languages you’re playing with (instructions are in the plugin file). If I had sites in 3 other languages, say French, Spanish, and German, my settings line in the plugin file would look like this:

$bll_other_languages=array('fr', 'es', 'de');

And the little box would provide three different fields for the page slugs of the different localized sites. (OK, I’m making this sound complicated, sorry.)

The plugin then automatically adds links to the sister pages you’ve indicated. Here’s what it could look like:

Bunny's Language Linker - Page view

There’s a readme file with the plugin which will give you some more details. I’ll soon have a client site in production using that plugin, so if these explanations weren’t very clear, hopefully the demonstration will help.

Browser Language Detection and Redirection [en]

[fr] Une explication de la méthode que j'ai suivie pour que http://stephanie-booth.com redirige le visiteur soit vers la version anglaise du site, soit la française, en fonction des préférences linguistiques définies dans son navigateur.

Update, 29.12.2007: scroll to the bottom of this post for a more straightforward solution, using Multiviews.

I’ve been working on stephanie-booth.com today. One of my objectives is the add an English version to the previously French-only site.

I’m doing this by using two separate installations of WordPress. The content in both languages should be roughly equivalent, and I’ll write a WordPress plugin which allows to “automate” the process of linking back and forth from equivalent content in different languages.

What I did today is solve a problem I’ve been wanting to attack for some time now: use people’s browser settings to direct them to the “correct” language for the site. Here is what I learnt in the process, and how I did it. It’s certainly not the most elegant way to do things, so let me know if you have a better solution by using the comments below.

First, what I needed to know was that the browser language preferences are sent in the HTTP_ACCEPT_LANGUAGE header (HTTP header). First, I thought of capturing the information through PHP, but I discovered that Apache (logical, if you think of it) could handle it directly.

This tutorial was useful in getting me started, though I think it references an older version of Apache. Out of the horses mouth, Apache content negotiation had the final information I needed.

I’ll first explain the brief attempt I did with Multiviews (because it can come in handy) before going through the setup I currently have.

Multiviews

In this example, you request a file, e.g. test.html which doesn’t physically exist, and Apache uses either test.html.en or test.html.fr depending on your language preferences. You’ll still see test.html in your browser bar, though.

To do this, add the line:

Options +Multiviews

to your .htaccess file. Create the files test.html.en and test.html.fr with sample text (“English” and “French” will do if you’re just trying it out).

Then, request the file test.html in your browser. You should see the test content of the file corresponding to your language settings appear. Change your browser language prefs and reload to see what happens.

This is pretty neat, but it forces you to open a file — and I wanted / to redirect either to /en/ or to /fr/.

It’s explained pretty well in this tutorial I already linked to, and this page has some useful information too.

Type maps

I used a type map and some PHP redirection magic to achieve my aim. A type map is not limited to languages, but this is what we’re going to use it for here. It’s a text file which you can name menu.var for example. In that case, you need to add the following line to your .htaccess so that the file is dealth with as a type map:

AddHandler type-map .var

Here is the content of my type-map, which I named menu.var:

URI: en.php
Content-Type: text/html
Content-Language: en, en-us, en-gb

URI: fr.php
Content-Type: text/html
Content-Language: fr, fr-ch, fr-qc

Based on my tests, I concluded that the value for URI in the type map cannot be a directory, so I used a little workaround. This means that if you load menu.var in the browser, Apache will serve either en.php or fr.php depending on the content-language the browser accepts, and these two PHP files redirect to the correct URL of the localized sites. Here is what en.php looks like:

And fr.php, logically:

Just in case somebody came by with a browser providing neither English nor French in the HTTP_ACCEPT_LANGUAGE header, I added this line to my .htaccess to catch any 406 errors (“not acceptable”):

ErrorDocument 406 /en.php

So, if something goes wrong, we’re redirected to the English version of the site.

The last thing that needs to be done is to have menu.var (the type map) load automatically when we go to stephanie-booth.com. I first tried by adding a DirectoryIndex directive to .htaccess, but that messed up the use of index.php as the normal index file. Here’s the line for safe-keeping, if you ever need it in other circumstances, or if you want to try:

DirectoryIndex menu.var

Anyway, I used another PHP workaround. I created an index.php file with the following content:

And there we are!

Accepted language priority and regional flavours

In my browser settings, I’ve used en-GB and fr-CH to indicate that I prefer British English and Swiss French. Unfortunately, the header matching is strict. So if the order of your languages is “en-GB, fr-CH, fr, en” you will be shown the French page (en-GB and fr-CH are ignored, and fr comes before en). It’s all explained in the Apache documentation:

The server will also attempt to match language-subsets when no other match can be found. For example, if a client requests documents with the language en-GB for British English, the server is not normally allowed by the HTTP/1.1 standard to match that against a document that is marked as simply en. (Note that it is almost surely a configuration error to include en-GB and not en in the Accept-Language header, since it is very unlikely that a reader understands British English, but doesn’t understand English in general. Unfortunately, many current clients have default configurations that resemble this.) However, if no other language match is possible and the server is about to return a “No Acceptable Variants” error or fallback to the LanguagePriority, the server will ignore the subset specification and match en-GB against en documents. Implicitly, Apache will add the parent language to the client’s acceptable language list with a very low quality value. But note that if the client requests “en-GB; q=0.9, fr; q=0.8”, and the server has documents designated “en” and “fr”, then the “fr” document will be returned. This is necessary to maintain compliance with the HTTP/1.1 specification and to work effectively with properly configured clients.

Apache, Content Negotiation

This means that I added regional language codes to the type map (“fr, fr-ch, fr-qc”) and also that I changed the order of my language preferences in Firefox, making sure that all variations of one language were grouped together, in the order in which I prefer them:

Language Prefs in Firefox

Catching old (now invalid) URLs

There are lots of incoming links to pages of the French site, where it used to live — at the web root. For example, the contact page address used to be http://stephanie-booth.com/contact, but it is now http://stephanie-booth.com/fr/contact. I could write a whole list of permanent redirects in my .htaccess file, but this is simpler. I just copied and modified the rewrite rules that WordPress provides, to make sure that the correct blog installation does something useful with those old URLs (bold is my modification):

# BEGIN WordPress

RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . **/fr**/index.php [L]


# END WordPress

In this way, as you can check, http://stephanie-booth.com/contact is not broken.

Next steps

My next mission is to write a small plugin which I will install on both WordPress sites (I’ve got to write it for a client too, so double benefit). This plugin will do the following:

  • add a field to the write/edit post field in which to type the post slug of the correponding page/post in the other language *(e.g. “particuliers” in French will be “individuals” in English)
  • add a link to each post pointing to the equivalent page in the other language

It’s pretty basic, but it beats manual links, and remains very simple. (I like simple.)

As I said, if you have a better (simpler!) way of doing all this, please send it my way.

A simpler solution [Added 29.12.2007]

For each language, create a file named index.php.lg where “lg” is the language code. For French, you would create index.php.fr with the following content:

Repeat for each language available.

Do not put an index.php file in your root directory, just the index.php.lg files.

Add the two following lines to your .htaccess:

Options +Multiviews
ErrorDocument 406 /fr/

…assuming French is the default language you want your site to show up in if your visitor’s browser doesn’t accept any of the languages you provide your site in.

You’re done!

WordPress Deaf to Pings [en]

[fr] Mon installation WordPress semble refuser les pings depuis deux semaines environ. Aucune idée ce qui peut causer ça.

While I’m at it in the “technical annoyances instead of getting work done” department, with the misbehaving plugin and the Sandbox trouble, my WordPress installation has obviously become deaf to pings/trackbacks over the last two weeks.

I can send trackbacks fine, but not receive them. Even from my own blog. I don’t know where to start searching for the problem.

Oh, and I’ve lost the French excerpt to my post Advisors, Boards, Companies, Partners, Oh My! so if you happen to have a cached copy, would you check it out for me, please?

Damn. This morning is not turning out the way I hoped.

Update, 17:30: the pings from my most recent post just came through! I’m only running Spam Karma 2 now, deactivated both Akismet and Bad Behavior. Hope to identify the culprit soon.

Update, 17:53: now, when I save a post, it sends one ping. If there is more than one pingable URL in the post, I need to save it multiple times. Got bug?