Easier TopicExchange Trackbacks for WordPress [en]

A WordPress hack which makes it quicker to add TopicExchange channels to trackback, and makes them visible (like categories) in the weblog. (Sorry for the duplicate postings, trying to fix it.)

[fr] Ce 'hack' pour WordPress permet d'ajouter facilement des trackbacks vers les canaux de TopicExchange, et liste sur le weblog les canaux concernés pour chaque billet.

Here is a solution to make it a little quicker to trackback TopicExchange channels with WordPress, and make those channels visible in your weblog.

I love TopicExchange. When I asked Suw what they had talked about during BlogWalk, she mentioned trackbacks. I asked if anything had been discussed about trackback etiquette. For example, I’m often tempted to trackback people who have written posts related to mine, but which I haven’t linked to. Well, the consensus is that this is not what trackback is for. Trackback is really for making a “backlink”. TopicExchange is the answer to the “related posts” issue.

I’ve been using TopicExchange a lot during the last weeks, but nobody has noticed it, apart from those people who already use TopicExchange as a source of information. As Seb Paquet notes, TopicExchange needs to be made more viral. It needs visibility. What follows is my interpretation of “making ITE easier to use, and more visible.”

This WordPress hack creates an extra field in the posting form where ITE channel ID’s (e.g. “wordpress”, “multilingual_blogging”) can be entered (I was tired of typing the whole trackback URL’s all the time). It then stores these channel ID’s as post meta data (in the postmeta table), so that it can retrieve them and display links to the corresponding channels along with the post, just as is usually done with categories.

First of all, add the following code to my-hacks.php. Then, edit post.php (in your wp-admin directory) and add this code where indicated (the comment at the top of the file explains where to insert the code).

Also in post.php, after the line add_meta($post_ID);, insert the following code:

// add topic exchange channels
	if(isset($_POST['ite-topic']))
	{
		$_POST['metakeyselect'] = 'ite_topic';
		foreach($topics as $topic)
		{
    		$_POST['metavalue'] = $topic;
    		add_meta($post_ID);
    	}
    }

In edit-form.php, add this code to create an extra input field for ITE trackbacks:

$form_ite = '<p><label for="ite-topic"><strong>Trackback</strong> TopicExchange:</label>
(Separate multiple channel ID's with spaces.)<br />
<input type="text" name="ite-topic" style="width: 360px" id="ite-topic"
tabindex="8" /></p>';
	$form_trackback.=$form_ite;

It goes near the top of the file, after the line which defines $form_trackback (do a search for that and you’ll find it).

Finally, in your index.php template, you can use <?php the_ite_channels(); ?> to display a paragraph containing a comma-separated list of channels trackbacked for each post. If you want to change the formatting, play around with the function definition in my-hacks.php.

If, like me, you have old posts with trackbacks to TopicExchange, and you would also like these to appear on your posts, use this patch from inside wp-admin. The patch will tell you what meta data it is adding — just load it once in your browser and check the result in your weblog. (Don’t load it twice — it’s supposed to be able to check the existing channels in the database to avoid duplicate entries, but I haven’t got it to work. Read instructions and debug notes at the top of the patch file.)

In future, it will also be possible to use the TopicExchange API to return the “nice title” for the channels listed — so we sould have “Multilingual blogging” instead of “multilingual_blogging”. (I’ve asked, it will behas been added to the API.)

Good luck with this if you try it, and as always, comments most welcome!

Note: as far as I have tested, the code seems to work now.

Converting MySQL Database Contents to UTF-8 [en]

I finally managed to convert my WordPress database content to UTF-8. It’s easy to do, but it wasn’t easy to figure out.

[fr] Voici comment j'ai converti le contenu de ma base de données WordPress en UTF-8. C'est assez simple en soi, mais ça m'a pris longtemps pour comprendre comment le faire!

A few weeks ago, I discovered (to my horror) that my site was not UTF-8, as I thought it was. Checking my pages in the validator produced this error:

The character encoding specified in the HTTP header (iso-8859-1) is different from the value in the XML declaration (utf-8). I will use the value from the HTTP header (iso-8859-1).

In all likeliness, my server adds a default header (iso-8859-1) to the pages it serves. When I switched to WordPress, I was careful to save all my import files as UTF-8, and I honestly thought that everything I had imported into the database was UTF-8. Somewhere in the process, it got switched back to iso-8859-1 (latin-1).

The solution to make sure the pages served are indeed UTF-8, as specified in the meta tags of my HTML pages, is to add the following line to .htaccess:

AddDefaultCharset OFF

(If one wanted to force UTF-8, AddDefaultCharset UTF-8 would do it, but actually, it’s better to leave the possibility to serve pages with different encodings, isn’t it?)

Now, when I did that, of course, all the accented characters in my site went beserk — proof if it was needed that my database content was not UTF-8. Here is the story of what I went through (and it took many days to find the solution, believe me, although it takes only 2 minutes to do once everything is ready) to convert my database content from ISO-8859-1 to UTF-8. Thanks a lot to all those who helped me through this — and they are many!

First thing, dump the database. I always forget the command for dumps, so here it is:

mysqldump --opt -u root -p wordpress > wordpress.sql

As we’re going to be doing stuff, it might be wise to make a copy of the working wordpress database. I did that by creating a new database in PhpMyAdmin, and importing my freshly dumped database into it:

mysql -u root -p wordpress-backup < wordpress.sql

Then, conversion. I tried a PHP script, I tried BBEdit, and they seemed to mess up. (Though as I had other issues elsewhere, they may well have worked but I mistakenly thought the problem was coming from there.) Anyway, command-line conversion with iconv is much easier to do:

iconv -f iso-8859-15 -t utf8 wordpress.sql > wordpress-iconv.sql

Then, import into the database. I first imported it into another database, edited wp-config.php to point to the new database, and checked that everything was ok:

mysql -u root -p wordpress-utf8 < wordpress-iconv.sql

Once I was happy that it was working, I imported my converted dump into the WordPress production database:

mysql -u root -p wordpress < wordpress-iconv.sql

On the way there, I had some trouble with MySQL. The MySQL dump more or less put the content of all my weblog posts on one line. For some reason, it didn’t cause any problems when importing the dump before conversion, to create the backup database, but it didn’t play nice after conversion.

I got this error when trying to import:

ERROR 1153 at line 378: Got a packet bigger than 'max_allowed_packet'

Line 378 contained half my weblog posts… and was obviously bigger than the 1Mb limit for max_allowed_packet (the whole dump is around 2Mb).

I had to edit my.cnf (/etc/mysql/my.cnf on my system) and change the value for max_allowed_packet in the section titled [mysqld]. I set it to 8Mb. Then, I had to stop mysql and restart it: mysqladmin -u root -p shutdown to stop it, and mysqld_safe & to start it again (as root).

This is not necessarily the best way to do it, and it might not work like that on your system, but it’s what I did and the site is now back up again. Comments welcome, and hope this can be useful to others!

Paléo Festival Nyon [fr]

Je serai à  Nyon mardi, mercredi, jeudi et dimanche. Faites signe si vous avez envie qu’on s’y retrouve!

[en] I'll be at Paléo Festival (Nyon) on Tuesday, Wednesday, Thursday, and Sunday. Let me know if you would like to meet up there!

Juste un mot pour dire que je serai au Paléo mardi, mercredi, jeudi, et dimanche. Je ne sais pas trop dans quelle mesure je serai joignable par sms les premiers jours vu que je loge au camping. Si jamais vous y allez et que ça vous dit qu’on s’y voie, faites-moi signe déjà  maintenant!

Six Apart rachète U-blog [fr]

Six Apart achète la société Ublog. Dommage que Ublog n’ait pas fait part de l’annonce directement à  ses utilisateurs.

[en] Six Apart bought Ublog, as you know. I think it's really a pity that no official announcement was made to the users of the U-blog platform. Loïc Le Meur even refrained from blogging the announcement before the press had published it, which I find pretty poor practice for a weblog evangelist, even if he is a businessman. If I were a U-blogger, other than wonder what the future of the weblogging platform U-blog will be, now that the company belongs to the owners of TypePad, I would have the impression the company doesn't really give a damn about its end-users.

Je voulais faire un long billet, classe, fouillé, pertinent, journalistique et complet. Après des heures de remuage de boue, de lecture de billets et de commentaires présents ou passés qui n’ont fait qu’accroitre mon agacement, je renonce à  mon projet initial pour tenter de faire quelque chose d’un peu plus sobre. J’ai une longue liste de liens que je pourrais un jour utiliser pour un billet d’historienne-commentatrice de la blogosphère, mais ce n’est pas pour aujourd’hui.

Bon, Ublog SA devient Six Apart Europe. Loïc est un bon businessman, je n’ai aucun doute là -dessus. Il sait utiliser les médias, il a des connexions, et il semble enthousiaste au sujet du weblogging. Il est maintenant Executive Vice-President de Six Apart.

Chez U-blog, soit on proteste, avec un peu trop de virulence à  mon goût, soit on se tait — peut-être parce que (comme Stéphane, créateur de la plateforme U-blog, à  qui j’ai parlé cet après-midi) ils ignorent tout de la transaction?

Ailleurs, de façon très générale, le message est “félicitations à  Loïc et Six Apart.” (Quant à  Laurent, je n’arrive pas trop à  savoir ce qu’il en pense, mais c’est peut-être voulu…)

Moi, je voudrais plutôt déplorer le fait que Loïc, apôtre du weblogging, semble faire preuve de plus de respect pour les médias que pour ses propres utilisateurs: à  ce jour, aucune annonce officielle sur le portail U-blog, ni sur le blog officiel, délaissé d’ailleurs depuis le 7 mai. Chez Six Apart, la nouvelle est bien annoncée et se trouve reprise sur le blog officiel de la société.

Personnellement, je trouve que ça fait un peu chenit. Si j’étais une utilisatrice U-blog, j’aurais l’impression de ne pas compter pour grand-chose.

Si vous désirez explorer, l’article sur iFeedYou vous donne quelques bons points de départ.

Ces blogueurs qui arrêtent… [fr]

Pourquoi les weblogueurs cessent-ils de bloguer? Par manque de lectorat, certes, mais je me demande si une attitude de l’ordre de “que vais-je donc écrire sur mon blog aujourd’hui” ne joue également un rôle dans le risque d’abandon de weblog.

[en] Why do bloggers stop blogging? As Stefan mentioned at BlogTalk, lack of readership and feedback is certainly a factor in weblog abandonment. Remembering a question I answered the day before the conference on a weblog survey, I wonder if a "what am I going to blog today" attitude doesn't increase the risk of weblog abandonment (as opposed to bloggers who just have stuff in their head that needs to get out.) What do you think?

Ça revient régulièrement sur le devant de la scène: le blog-blues. Tel ou tel ferme son weblog, arrête de bloguer, quitte la blogosphère à  grands fracas (pour parfois revenir ensuite) ou s’en va à  pas de souris. Pourquoi les blogueurs arrêtent-ils?

Lors de BlogTalk, Stefan Glänzer s’est posé la question: Does Blogging Suck?

Sur 20six.de, il semblerait que 82% des bloguers abandonnent leur weblog au bout de quelques mois.

Sans lecteurs, on ferme. Epitaphes-type:

  • Y’a quelqu’un?
  • test test test
  • J’ai besoin d’une pause… je reviendrai… à  un moment ou un autre

Je vois cependant souvent des weblogs “bien lus” fermer. C’est en général de ceux-là  qu’on entend parler, inévitablement — les lecteurs se plaignent! La grandeur du lectorat n’est certainement pas le seul facteur, et j’ai ma petite hypothèse sur la question.

En écoutant la conférence de Stefan, j’ai repensé au questionnaire sur les weblogs que j’avais rempli le soir précédant. Une des questions m’a frappée — elle disait à  peu près ceci: “Lesquelles des sources suivantes consultez-vous régulièrement afin d’y trouver des choses à  bloguer?” (suivait une liste de genre de sites susceptibles de servir d’inspiration au bloguer qui en manquerait).

Et là , je me suis retrouvée perplexe. Je ne vais jamais à  la recherche de matière à  bloguer! Je ne me demande jamais de quoi je pourrais bien parler aujourd’hui. Soit il y a quelque chose qui me trotte dans la tête et je l’écris (ou pas), soit il n’y a rien et je n’écris rien. Jamais je ne vais activement chercher un sujet de billet.

Je me demande donc s’il y aurait pas une corrélation entre cette attitude (“chercher quoi bloguer”) et le risque d’abandon du weblog.

Qu’en pensez-vous? En ce qui vous concerne, est-ce que vous cherchez des sujets de billet, ou bien est-ce qu’ils “viennent à  vous”? Vous demandez-vous ce que vous allez bien pouvoir écrire aujourd’hui? Ce que vous avez à  dire à  ce sujet m’intéresse grandement.

The Lee Bryant Experiment [en]

An account of the “Lee Bryant Experiment”, where I posted his write-up of his talk into SubEthaEdit bit by bit as he was talking. Some ideas about note-taking, talking, presentations, and write-ups.

[fr] Lorsque Lee Bryant a donné sa conférence à  BlogTalk, j'ai collé la version écrite de ce qu'il disait dans SubEthaEdit, à  mesure qu'il parlait. Cela paraissait une idée intéressante à  expérimenter quand j'ai offert de le faire, mais l'expérience n'était pas concluante. Cela m'a cependant amené à  m'interroger sur les rôles respectifs du discours proprement dit, du support visuel (dias, présentation), de la prise de notes, et de la publication par écrit du contenu d'une conférence.

So, what was this “Lee Bryant Experiment” I was talking about? No, we did not replace Mr. Bryant by a cyborg-lee during the conference so that he could go and have coffee during his own talk. We simply pushed the whole collaborative note-taking experience one step futher.

Lee mentioned during the first afternoon or BlogTalk that his talk was a bit long, and that he was debating whether to rush thr0ugh it or cut stuff out. I of course suggested cutting things out, but then, that meant that some of the things he wanted to say would not reach the audience. Then we had this idea: paste a written, more detailed, version of his talk into SubEthaEdit while he was talking. I offered to do it. We would annotate his notes, and then stick it all up on the wiki. It sounded like a great idea, and a fun thing to do.

I had a few doubts about it in the morning (so had Lee), worried that it would divert the “note-taker’s” attention from what he was actually saying. However, we decided to go ahead and do it, to see what happened.

I didn’t have much trouble keeping up with Lee’s talk and slides and pasting chunks of his text into the common document as he talked. However, I quickly noticed that this completely killed the note-taking. And it got me thinking.

Was that a problem? Is note-taking important, if you get a transcript or detailed paper of the talk afterwards? I think it is. I think that note-taking as a process is important. I know I listen differently whether I am taking notes or not. There is something to be said for reformulating what you’re listening to on the fly. To me, it clearly aids the integration of what is being said. Now, to what extent does collaborative note-taking defeat that? Open question.

Notes are also more succint than the presentation. One interest of note-taking for me is that I summarize in quickly-readable form what I got out of the presentation. Great for refreshing memories.

So yes, I think that was a problem. I don’t think it’s a good idea to give the audience too much text to read during a talk. That goes for slides too. For me, slides should give visual cues to help the audience keep track of where we are in the talk, and what is being said. They shouldn’t contain “stuff to read while you listen” — you can’t read and listen at the same time. If slides are content-heavy, then the talk should be a comment of the slides, and not something done “in parallel with the slides in the background.”

I think a written version of a talk, especially if it is more detailed than the talk itself, should never be made available before or during a talk. I was told that, by the way, in the 3-day project management course I followed while I was at Orange: when presenting something, don’t hand anything out to people unless you want them to stop listening to you.

What would have made more sense, in hindsight, would have been to put up the written version of Lee’s talk on the wiki in parallel with the notes we would have taken, and allow people to comment the paper. Another thing to try, maybe, would be to put only the outline in the SubEthaEdit document — but then, I noticed that when people are writing they rarely scroll down to see what is written below in the document. Note-taking in a text editor does tend to remain a pretty linear operation.

To summarize, I would say that for me, this experiment was a failure. It was not a failure in the sense that we managed to do what had planned to do, and that it worked, but it was a failure in the sense that what we did failed to give any added value to Lee’s talk.

Think otherwise? Open to discussion.

Batch Categories 0.9 [en]

Batch Categories for WordPress has been fixed and enhanced. If you have major category jobs to do, it can probably help you. Feedback and testers welcome.

[fr] Batch Categories pour WordPress a été corrigé et fonctionne à  présent. Le compagnon idéal si vous desirez changer les catégories de nombreux billets en même temps.

Batch Categories 0.9 is out! It’s the ideal companion for large-scale post-import messy category work. List all posts belonging to a category or matching a keyword, and edit their categories, easily visible at a glace with a collection of sexy drop-down lists. What’s new since the the first draft?

  • It now works, and does not “eat” categories without a warning. (Pretty nice of it, huh?)
  • It tells you what it did — which categories it added to which posts, and which ones it removed.
  • Add a whole bunch of posts to a category with one click.
  • Remove a whole bunch of posts from a category with one click.
  • Ensures that all the categories for a post are always listed, whatever the setting for the limit number of drop-down lists.
  • This is what it can look like.

You can still access it as a plugin or edit the Edit navigation menu, as described in my post introducing Batch Categories. If you’re in a hurry, just drop the PHP file into your wp-admin directory and send your browser straight on it.

Next steps?

  • Gather feedback from courageous testers (please don’t blame me if you haven’t backed up your post2cat table and things go wrong) for chasing the last bugs, improving interface and functionality.
  • Redo the code which generates the drop-down lists to take advantage of the category cache, and avoid flooding the database with useless queries.
  • Allow more subtle selection of posts: combinations of categories (AND/OR/NOT), categories without their subcategories…
  • Anything else you would want…?

Update 24.07.04: BB made me notice that “All” and “None” didn’t make much sense in the drop-down which allows one to select the categories to display. Replaced them in v. 0.91 by “Any category”.

Cours de maths-base [fr]

Avec la suppression des “sections” en VSB, l’enseignant en maths se retrouve à  devoir gérer jusqu’à  la fin de la scolarité obligatoire des classes passablement hétérogènes quant à  leur facilité dans cette branche. Un commentaire sur mon expérience.

[en] In canton Vaud, the school organisation has changed a lot during these last years, resulting in more heterogenous classes. I talk about my experience teaching maths in classes where you have "maths-specialists" and "language-specialists" (who are often less at ease with maths) in the same classes.

Mon premier “challenge” d’enseignante, lors de mes remplacements, cela a été les cours de “maths-base” — à  savoir les cours de maths donnés à  la classe entière, sans faire intervenir les différents choix d’options spécifiques qu’ont fait les élèves. En effet, on trouve maintenant dans une même classe de VSB aussi bien des latinistes, des scientifiques, que des élèves ayant choisi comme option spécifique l’italien (“langues modernes”) ou l’économie.

Ces élèves suivent en commun les cours d’allemand, d’anglais, de français, de maths, d’histoire (etc.) et se séparent pour suivre les quatre (cinq) heures de cours hebdomadaires consacrées à  leur option spécifique: l’italien, le latin, l’économie, ou des maths supplémentaires. Les cours “maths-option” couvrent des domaines qui ne sont pas abordés par le cours maths-base. Ainsi, les élèves de maths-option ne se trouvent pas favorisés lors de ceux-ci.

Mais, il y a un mais. Nous ne sommes pas tous égaux devant les maths. Si je crois fermement que chacun est capable de comprendre et maitriser les mathématiques enseignés au collège (si on fait preuve de patience et de compétence pédagogique, et qu’il y a assez de temps à  disposition — ce qui n’est en général pas le cas), il me parait cependant évident que certaines personnes comprennent plus vite que d’autres. Au risque de tomber dans le cliché (mais en étant consciente que ceci est une généralisation, à  manier donc avec des pincettes), il y a fort à  parier que l’on trouve chez les élèves ayant choisi les maths en option spécifique une forte proportion de personnes ayant de la “facilité”, comme on dit, et dans les options plus littéraires, un plus grand nombre d’élèves ayant besoin d’un peu plus de soutien pour appréhender les mathématiques.

Lorsque l’école secondaire était divisée en sections bien distinctes, on attendait clairement plus des scientifiques durant les cours de maths, quel que soit le sujet abordé, que des modernes (pour rester dans les gros clichés). Les latines étaient considérées comme des littéraires, certes, mais puisque c’étaient des latines (traditionnellement la section pour les “meilleurs” élèves, à  tort ou à  raison), certains enseignants avaient tout de même des exigences un peu plus élevées que pour des élèves en section moderne.

On va tenter de s’arrêter là  avec les clichés, espérant tout de même que mon argumentation aura été claire: certains comprennent plus vite les maths que d’autres. (Et ne nous limitons pas aux maths, les problèmes que je soulève ici se retrouvent dans l’enseignement des langues et probablement d’autres branches encore.)

Prenez donc une classe de 7VSB. A force d’exercices et de persuasion, on leur présente l’addition et la multiplication des fractions. Quelques élèves auront compris dès la première explication ou le premier exercices. D’autres auront besoin encore de longues heures d’explications bien plus détaillées, accompagnées de force schémas et analogies, mettant à  l’épreuve la créativité de l’enseignant et dans bien des cas, sa patience. (Et très personellement, c’est là  un des aspects de l’enseignement que je trouve le plus stimulant.)

Reste la question: que faire avec ceux qui ont compris, qui ont fini en cinq minutes l’exercice que vous avez donné à  faire, et qui s’ennuient durant les explications que vous donnez à  ceux qui ont encore du chemin devant eux? Si vous leur faites prendre de l’avance dans les exercices à  faire pour les occuper, cela ne fait que repousser le problème. Leur donner à  faire des exercices supplémentaires, que ne feront pas les autres élèves? Cela me paraît la moins mauvaise solution. Elle demande bien entendu préparation, organisation, et travail supplémentaire de la part de l’enseignant.