Call to WordPress Plugin Developers [en]

Call for help to WordPress plugin developers. I have a bunch of hacks and modifications I’d like to turn into plugins, but I am unfortunately as plugin-challenged as ever.

[fr] Un descriptif des plugins que j'écrirais pour WordPress si je ne faisais pas un vilain blocage sur le sujet. Ne vous gênez pas si vous voulez contribuer!

If I was fluent in WordPress plugin coding, here are the plugins I’d write. If you feel like coding one of them yourself, or helping me get it done, you’re most welcome. Carthik has already pointed me to Plunge into Plugins, which I will have a close look at once I’ve finished writing this post.

Of course, if you know of a plugin which does precisely what I’m describing here, leave a link to it in the comments!

Keywords plugin

This would be a pretty straightforward one:

  • add a “keywords” text input to post.php
  • save the value of that text input to a custom field called “keywords”
  • add those keywords as an HTML meta tag on the individual post pages.
Excerpt plugin

This one would also be pretty straightforward, as all it would do is add the “excerpt” field to the “simple” post.php layout.

Customize post.php plugin

This would be more complex, but allow for more flexibility than the previous plugin. I don’t yet have a clear idea of how to make it work, but the basic principle would be to allow the user to select which fields should appear on the post.php page. Instead of having “simple” and “advanced” controls, this would add the option to have “custom” controls and define them.

TopicExchange plugin

As far as functionality is concerned, this plugin would do what my TopicExchange hack did:

  • add a “trackback TopicExchange channels” text input to post.php
  • store the space-separated list of keywords in a meta value named (e.g.) ite_topic (one record for each value)
  • for each value, trackback the appropriate TopicExchange channel
  • display the trackbacked channels (with link) on each post.
Bilingual plugin

This would be a clean version of my language hacks:

  • add a small “language” text input to post.php (with a default value)
  • add an “other language excerpt” textarea, which posts to the corresponding custom value
  • display the “other language excerpt” at the top of each post
  • provide a function to return the post language, and the other-excerpt language (so it can be declared in a lang attribute, allowing the use of language-dependant CSS formatting, in addition to being semantically correct)
  • if this is not already possible with the date function in the WordPress core, provide an alternative date function which will format the date correctly corresponding on the language of the post
  • optional: figure out a way to adapt text like “comments”, “categories” etc. to the post language; make the plugin usable with more than two languages.
Smart Linkroll plugin

I love the way ViaBloga manages blogrolls and would love to see a plugin for WordPress that does the same thing. In ViaBloga, you simply enter the URL of the site you want to add to your links. ViaBloga then retrieves the title, description, RSS feed address, and even (yes!) a screenshot for the site. No need to fill in fields manually anymore…

Wiki-Keywords plugin

I haven’t through this through yet completely, but it seems to me that a plugin which would add wiki-like capability to WordPress, like ViaBloga does with keywords, could be an interesting idea to explore.

Technorati plugin

This is really a simple one: add a function which will allow easy display of the Technorati cosmos of each post, like I have done manually for this weblog.

On the subject of multilingual blogging, Kevin Marks has some interesting markup suggestions I need to look at more closely.

Similar Posts:

Hosted Blog Platform Test Write-Up [en]

I’ve tested 13 free platforms, and this is a write-up on the experiment. The ones I preferred were Blogsome, running Wordpress, and Mon-Blog (in French), running DotClear.

Edit 26.12.2006: For those of you trying to choose a free blogging platform, I’ve now been recommending WordPress.com without hesitation for some time now.

As the people I hang out with on Freenode are painfully aware of by now, I’ve been on a blog platform testing binge. In total, 13 free* platforms tested. Here is a quick list of my test blogs — you’ll find detailed comments about each platform on the test blogs themselves, and a general overview below. The ones I preferred were Blogsome and Mon-Blog.

The platforms were tested with FireFox 1.0 on OSX, Javascript enabled, set to block pop-ups and force links opening a new window to open in the initial tab/window (we’ll see this setting seems to have caused problems with many visual editors).

My main interest was to have a peek at what existed (personal curiosity) and see if it was possible to claim the blogs on Technorati. What follows is an account of my personal user experience on these different platforms. It is not the result of a battery of systematic “benchmarking tests”, though here are some of the points I paid attention to:

  1. was it easy to create an account, or did I have to fight?
  2. how easy was it for me to sign back in, afterwards?
  3. overall, did I find the features I expect from a weblog? (note how subjective that is)
  4. how did writing a post go?
  5. could I add images?
  6. could I change the template?
  7. could I add links to my other test blogs? (linkroll management)
  8. could I claim the blog as mine at Technorati?
  9. did I bump into availability problems?

Lets get the last point over with first. I succeeded in claiming blogs on all platforms except three: NRJ blogs, Skyblog, and LiveJournal. The reason for that is that the last two platforms limit links in the blogroll to weblogs using the same platform. This prevented me from using the blogroll to add the Technorati code necessary to claiming the weblog.

Note, by the way, that I am talking about the free version of LiveJournal, as the paid version does not have this limitation. NRJ blogs, by far the worst platform amongst those tested, does not permit linking at all (even in posts!) I’m not even sure if it deserves to be called a “blogging platform”.

As far as linkrolls or blogrolls are concerned, ViaBloga gets top marks for their “almost-automatic linkrolling”. You can simply type in the URL of the blog/site you want to add, and it retrieves title and rss feed, and also creates a screenshot and thumbnail of the site. It really makes you want to add links to your sidebar. One-click blogrolling, if you like. Otherwise, most link management systems are pretty standard.

Some, like MSN Spaces, make you click “Add Link” between each links, instead of systematically presenting you with a form allowing you to add a link each time you go in link management. This is one of the minor but irritating usability problem which plague MSN Spaces. There are major ones too, but I won’t list them too (no paragraph breaks for me, login problems, timeout problems, clunky interface, ugly permalinks, horrible markup) — they are detailed on my test MSN Space.

Visual editors are neat when they work, but they are a great pain when they do not work. Because of my browser settings, I failed adding links to my posts at ViaBloga, for example. I also failed to add photographs at CanalBlog, HautEtFort, and 20six because of this. BlogSpot is clear enough about the fact you need an external service like Flickr if you want photos on your blog, and both LiveJournal and U-blog seem to fail the photo test for various reasons.

Both Skyblog and NRJ blogs are very limited blogging services, the latter being a very pale imitation of the former. Skyblog focuses on making it easy for teens to put photos on the web with brief comments, and, despite many other shortcomings (no permalinks, interface issues, server overload at peak times), I’m forced to admit it does it pretty well — which partly explains its success (it’s the main French language blog platform in blog numbers). The other services passed the photo test with more or less ease (don’t forget I’m a geek, so uploading a photo first, copying the URL and inserting it into a post isn’t an issue for me — it could be for some).

At some point, I had trouble connecting to the following services (or timeouts): Skyblog, MSN Spaces, and 20six (I can’t remember any others, but my memory might be failing me. NRJ blogs distinguishes itself by refusing to publish certain posts, or waiting a day or two before being so.

Now, before I get lost in random comments, I’ll give you a quick low-down on each of the solutions tested, as well as links to other people who have recently reviewed some of them.

Blogsome
  • Pros: WordPress, very easy to sign up
  • Cons: might need to be a bit of a techie at times

Being an avid and enthusiastic WordPress user, the idea of a hosted WordPress-powered blogging platform was very exciting to me. No bad surprises as I already knew the interface (I’m biased, of course), and no major bugs that couldn’t be addressed after posting about them in the forum. I didn’t try the visual editor there, but I assume it will make it more newbie-friendly. Definitely the platform I recommend for the moment.

MSN Spaces
  • Pros: none
  • Cons: way too beta (buggy)

After Roland Tanglao, Robert Scoble, and a dirty word test at Boing Boing, let me add my two cents by saying I am unenthusiastic about MSN Spaces. It’s still way too rough around the edges. Not usable as far as I’m concerned.

LiveJournal
  • Pros: community, well-established
  • Cons: lots of settings, limitations of free accounts (no Technorati claim possible)

Well, LiveJournal is LiveJournal, and I know that to get a good idea of what it can do you need the paid version. My first impression was that it seemed to have lots of options in the admin part (a bit confusing), but other than that, it was pretty easy to get going and posting. Google will point out to you many more complete reviews of LiveJournal, so I’ll stop here. My main point was, however, to see if I could claim a free LiveJournal as my blog at Technorati, and that was not possible (short of adding the code via JavaScript in the head of the page, but honestly, I wouldn’t want to go that far for my test.)

BlogSpot
  • Pros: well-established, nice admin interface
  • Cons: lack of categories, trackbacks, and image hosting

No big surprise here. I used Blogger for years (though not BlogSpot), and I liked the interface I found during my test a lot. They should wake up and get categories and trackbacks though. We’ll be in 2005 in less than 3 weeks. A good, solid option for people who can live without categories, trackbacks, and hosted photographs.

ViaBloga*
  • Pros: great link management, wiki-like features, active development
  • Cons: some usability issues and minor bugs; not free

ViaBloga has many good features. The “configurable blocs” system (invented by Stéphane for Joueb.com), which allows you to easily move about elements of your page, is just great (once you’ve figured it out). The platform has real wiki-like capability via keywords, and “cross-links”, which work like a kind of automatic trackbacking system. On the shortcomings side, I would say that although the features are great, the usability and user-friendliness of the administration aspect, which is a little confusing, could still be improved. I’m not a beginner, and it took me quite some time to figure out a certain number of things (and I know Stéphane and Delphine, so it’s easy for me to get direct help). And no, it’s not just because I’m “used” to other systems — I should still be able to figure things out easily.

Joueb
  • Pros: well-established, community
  • Cons: community (!), some usability problems (cf. ViaBloga)

Joueb is ViaBloga’s community-oriented little sister. The first French language hosted blogging platform seemed to me a little more kludgy than ViaBloga, but there is a happy community there, and Stéphane is an active developper, always ready for feedback and making improvements to his babies. If you’re looking for a French weblogging platform with a strong community, I’d say this is a good choice.

Skyblog
  • Pros: great if all you want is upload your phone photos, spit out a comment, and allow people to comment (though Flickr does it better)
  • Cons: no permalinks or trackbacks, limited server availability, teen-sms-talk and link-whoring comments

I remember when Skyblog was launched, the francoblogosphere was boiling over in horror at this kind of bastardized blogging solution where teens posted pics of their friends and commented in sms-speak. (Sorry, can’t find any posts right now, will add links later if I do.) As I said, Skyblog does not do much, but it makes publishing photos and short texts easy, and it’s pretty successfully targeted at a certain audience. My pupils have Skyblogs and they are obviously all the rage. Lots of photos, hardly any text, and comments abound which either say “ur 2 kool”, “u suck”, or “com visit my sky http://somecoolnick.sykblog.com/”. Not very interesting as a blogging platform, as far as I’m concerned, but obviously successful.

NRJ blogs
Edit 18.12.04: it seems confirmed that NRJ blogs hasn’t launched yet, and Google caught them by surprise.

  • Pros: none
  • Cons: sucks (I mean, some posts don’t even get posted, and finding your blog URL demands a thorough investigation)

I’ll say it loud and clear, NRJ blogs suck, and as a pretty obvious consequence they aren’t taking off really well: less than 50 blogs created since they launched (and NRJ is a major popular radio!) However, I can’t find a link on their home page, so there is a possibility this was a preliminary soft launch. In any case, I’m getting my few days of fame as an NRJ blog star. Neuro, Mr_Peer, and Kwyxz also tried NRJ blogs and were all but impressed. See their posts or my test blog for detailed complaints.

CanalBlog
  • Pros: has the usual set of features you expect from a blog
  • Cons: admin interface can feel a little rude at times

CanalBlog was a pleasant surprise. The admin interface takes over your browser, but it works pretty well and it’s user friendly enough in a “MS-Office-lookalike” way. The layouts you can choose from are clean, and they have comments and trackbacks. They have ads, though. I’d say they are a viable platform (er… a viable choice of platform).

HautEtFort
  • Pros: nice admin interface
  • Cons: no trackbacks

Too bad they don’t have trackbacks! I like what I’ve seen of the admin interface, nice and clean and uncluttered. As many other platforms do, they force me to go through the home page to log in (which I dislike), but honestly, like CanalBlog (and maybe more, if it wasn’t for the lack of trackbacks), I’d say they are an honest French language blogging platform.

20six
  • Pros: has the set of features you expect from a blog
  • Cons: ugly, cluttered admin interface, server downtime

I really didn’t like 20six. I find their layouts ugly, the admin interface is hell, and their server was unavailable for hours at one point when I was about to do my photo upload test. Even though they know what trackbacks are, I wouldn’t recommend them (go CanalBlog instead).

U-blog
  • Pros: community, features more or less ok
  • Cons: probably doomed

Well, I’ve spoken a lot about U-blog already, but more in a blogo-political context. When there weren’t so many French language blogging platforms around, U-blog used to be my recommendation. On trying it now, I can’t help saying that it feels a little broken, or abandoned. I was faced with an error when trying to upload a picture, and some of the links in the admin section tell you that this or that feature is only available with the paid version. Given the platform doesn’t seem in active development anymore, I wouldn’t recommend it.

Mon-Blog
  • Pros: DotClear (clean, beautiful, all functionalities)
  • Cons: launched three days ago

Now this, ladies and gentlemen, was a last-minute and very pleasant surprise. Mon-Blog is based on the weblog engine DotClear, which I have long held in high regard. For the first time, I’ve had a chance to see the DotClear admin interface, and let me tell you, it’s as beautiful as the themes they provide to dress your weblog in. Nothing really missing feature-wise, though it seems templates won’t really be customisable at Mon-Blog for the moment. The service has just launched and some creases need ironing out, but the forums and the developer are reactive. Just go for it. This is clearly my first choice for a French blogging platform.

I hope this will have been of interest to some. Thanks for your attention, and I’m glad to be over with the testing!

Edit 16:20: I’ve just add quick pros/cons bullet points (thanks to acrobat for the suggestion and the proof-reading).

Edit 13.12.04: ViaBloga was included in this survey although it is not a free platform. It is free for non-profit organisations, however. The mistake is mine — being an early tester, I was offered six months free, and in my mind had not switched ViaBloga to the “paying platforms” category. See my comment and Stéphane’s on the subject.

Similar Posts:

MagpieRSS Caching Problem [en]

I have a caching problem using the PHP MagpieRSS library to parse feeds. Any help welcome.

[fr] J'ai un problème de cache utilisant la librarie PHP MagpieRSS. Toute aide bienvenue!

I’ve been stuck on a problem with MagpieRSS for weeks. This is a desperate call for help.

At the top of my sidebar, I have two lists of links which are generated by parsing RSS feeds: Delicious Linkball and Recently Playing. They don’t update.

If I delete the cache files, the script creates them all right. If I keep an eye on the cache files, I see their timestamp is updated every hour, but not the contents. I’ve uploaded the PHP code which parses the feeds.

Any suggestions welcome. I’m not far from giving up and setting cron jobs to regularly delete the cache files. Thanks in advance.

Update 13:00: The Recently Playing list updates once an hour (when the cache is “force-refreshed”), it seems — but not the Delicious Links one.

14:00: Some progress: http://del.icio.us/rss/steph/ doesn’t seem to update unless I clear the cache on my machine. (Huh?) http://ws.audioscrobbler.com/rdf/history/Steph-Tara, on the other hand, is — but why does the cache update only once an hour, and not each time the feed is modified?

15:00: crschmidt just pointed out that the last-modified date on my del.icio.us RSS feed was horribly wrong. Might be something that was done at the time when my caching problems were causing me to nastily abuse the poor del.icio.us server. I’ve sent a mail to Joshua to see if indeed this could be the problem.

15:50: Still thanks to the excellent crschmidt, I’ve finally understood how this caching is supposed to work. (Yes, I know, we’re starting to have lots of edits on this post.) There is a setting which determines how old the cache must be to become “stale”. As long as the cache is not stale, any requests made will use the cache directly, without pulling the feed in question. If the cache is stale, a request is sent to the server hosting the feed to check if it has changed since it was last accessed. If it has changed (i.e., if Last-Modified is more recent than the cache), it gets a fresh version of the feed. Otherwise, nothing happens (the cache age is just “reset”).

Now, for a LinkLog service like del.icio.us, setting the cache age to a couple of hours is more than enough as far as I’m concerned. However, for a list of recently played songs, every few minutes should be better. MagpieRSS seems to allow this to be set on a per-call basis by defining MAGPIE_CACHE_AGE, but it doesn’t seem to be working for me. Another variable is set on a per-installation basis: var $MAX_AGE = 1800; — but changing that won’t really help, as I want different values for Recently Playing and Delicious Links. Suggestions on this secondary problem welcome too!

16:40: After exchanging a few e-mails with Joshua, it seems that there was indeed a problem with the Last-Modified date on my feed. Not quite sure how it came about (somebody requesting the feed when I hadn’t posted in some time?), but it should be fixed now. I’ve cleared my cache files to see if my 30-minute “stale time” is working or not.

17:30: (See how I’m updating every 50 minutes? Freaky.) So, the not-so-nice things about PHP constants is that they are constant and (?) local to the function in which they are defined. (Not sure I go that bit right, but.) Important thing here is to note that MAGPIE_CACHE_AGE can’t be used to set different “stale cache” ages for different feeds. The stale cache age needs to be set at the bottom of rss_fetch.inc (the only place I hadn’t touched) — so my cache is now refreshing every half-hour. (Which is a bit too often for del.icio.us, and not often enough for Audioscrobblers.) oqp says he can write a wrapper to get around this limitation — I’m waiting impatiently for him to do it!

Similar Posts:

Life and Trials of a Multilingual Weblog [en]

Here is an explanation of how I set up WordPress to manage my bilingual weblog. I give all the code I used to do it, and announce some of the things I’d like to implement. A “Multilingual blogging” TopicExchange channel is now open.

[fr] J'explique ici quelles sont les modifications que j'ai faites à WordPress pour gérer le bilinguisme de mon weblog -- code php et css à l'appui. Je mentionne également quelques innovations que j'ai en tête pour rendre ce weblog plus sympathique à mes lecteurs monolingues (ce résumé en est une!) Un canal pour le weblogging multilingue a été ouvert sur TopicExchange, et vous y trouverez peut-être d'autres écrits sur le même sujet. Utilisez-le (en envoyant un trackback) si vous écrivez des billets sur le multinguisme dans les weblogs!

My weblog is bilingual, and has been since November 2000. Already then, I knew that I wouldn’t be capable of producing a site which duplicates every entry in two languages.

I think this would defeat the whole idea of weblogging: lowering the “publication barrier”. I feel like writing something, I quickly type it out, press “Publish”, and there we are. Imposing upon myself to translate everything just pushes it back up again. I have seen people try this, but I have never seen somebody keep it up for anything nearing four years (this weblog is turning four on July 13).

This weblog is therefore happily bilingual, as I am — sometimes in English, sometimes in French. This post is about how I have adapted the blogging tools I use to my bilingualism, and more importantly, how I can accommodate my monolingual readers so that they also feel comfortable here.

First thing to note: although weblogging tools are now ready to be used by people speaking a variety of languages (thanks to a process named “localization”), they remain monolingual. Language is determined at weblog-level.

With Movable Type, I used categories to emulate post-level language awareness. This wasn’t satisfying at all: I ended up with to monstrous categories, Français and English, which didn’t help keep rebuild times down.

With WordPress, the solution is far more satisfying: I store the language information as Post Meta, or “custom field”. No more category exploitation for something they shouldn’t be used for.

Before I really got started doing the exciting stuff, I made a quick change to the WordPress admin interface. If I was going to be adding a “language” custom field to each and every post of mine, I didn’t want to be doing it with the (imho) rather clumsy “Custom Fields” form.

In edit.php, just after the categorydiv fieldset, I inserted the following:

<fieldset id="languagediv">
      <legend>< ?php _e('Language') ?></legend>
	  <div><input type="text" name="language" size="7"
                     tabindex="2" value="en" id="language" /></div>
</fieldset>

(You’ll probably have to move around your tabindex values so that the tabbing order makes sense to you.)

I also tweaked the wp-admin.css file a bit to keep it looking reasonably pretty, adding the rule below:

#languagediv {
	height: 3.5em;
	width: 5em;
}

and adding #languagediv everywhere I could see #poststatusdiv, so that they obeyed the same rules.

In this way, I have a small text field to edit to set the language. I pre-set it to “en”, and have just to change it to “fr” if I am writing in French.

We just need to add a little piece of code in the form processing script, post.php, just after the line that says add_meta($post_ID):

 // add language
	if(isset($_POST['language']))
	{
	$_POST['metakeyselect'] = 'language';
        $_POST['metavalue'] = $_POST['language'];
        add_meta($post_ID);
        }

The first thing I do with this language information is styling posts differently depending on the language. I do this by adding a lang attribute to my post <div>:

<div class="post" lang="<?php $post_language=get_post_custom_values("language"); $the_language=$post_language['0']; print($the_language); ?>">

In the CSS, I add these rules:

div.post:lang(fr) h2.post-title:before {
  content: " [fr] ";
  font-weight: normal;
}
div.post:lang(en) h2.post-title:before {
  content: " [en] ";
  font-weight: normal;
}
div.post:lang(fr)
{
background-color: #FAECE7;
}

I also make sure the language of the date matches the language of the post. For this, I added a new function, the_time_lg(), to my-hacks.php. I then use the following code to print the date: <?php the_time_lg($the_language); ?>.

Can more be done? Yes! I know I have readers who are not bilingual in the two languages I use. I know that at times I write a lot in one language and less in another, and my “monolingual” readers can get frustrated about this. During a between-session conversation at BlogTalk, I suddenly had an idea: I would provide an “other language” excerpt for each of my posts.

I’ve been writing excerpts for each of my posts for the last six months now, and it’s not something that raises the publishing barrier for me. Quickly writing a sentence or two about my post in the “other language” is something I can easily do, and it will at least give my readers an indication about what is said in the posts they can’t understand. This is the first post I’m trying this with.

So, as I did for language above, I added another “custom field” to my admin interface (in edit-form.php). Actually, I didn’t stop there. I also added the field for the excerpt to the “simple controls” posting page that I use (set that in Options > Writing), and another field for keywords, which I also store for each post as meta data. Use at your convenience:

<!-- BEGIN BUNNY HACK -->
<fieldset style="clear:both">
<legend><a href="http://wordpress.org/docs/reference/post/#excerpt"
title="<?php _e('Help with excerpts') ?>"><?php _e('Excerpt') ?></a></legend>
<div><textarea rows="1" cols="40" name="excerpt" tabindex="5" id="excerpt">
<?php echo $excerpt ?></textarea></div>
</fieldset>
<fieldset style="clear:both">
<legend><?php _e('Other Language Excerpt') ?></legend>
<div><textarea rows="1" cols="40" name="other-excerpt"
tabindex="6" id="other-excerpt"></textarea></div>
</fieldset>
<fieldset style="clear:both">
<legend><?php _e('Keywords') ?></legend>
<div><textarea rows="1" cols="40" name="keywords" tabindex="7" id="keywords">
<?php echo $keywords ?></textarea></div>
</fieldset>
<!-- I moved around some tabindex values too -->
<!-- END BUNNY HACK -->

I inserted these fields just below the “content” fieldset, and styled the #keywords and #other-excerpt textarea fields in exactly the same way as #excerpt. Practical translation: open wp-admin.css, search for “excerpt”, and modify the rules so that they look like this:

#excerpt, #keywords, #other-excerpt {
	height: 1.8em;
	width: 98%;
}

instead of simply this:

#excerpt {
	height: 1.8em;
	width: 98%;
}

I’m sure by now you’re curious about what my posting screen looks like!

To make sure the data in these fields is processed, we need to add the following code to post.php (as we did for the “language” field above):

// add keywords
	if(isset($_POST['keywords']))
	{
	$_POST['metakeyselect'] = 'keywords';
        $_POST['metavalue'] = $_POST['keywords'];
        add_meta($post_ID);
        }
   // add other excerpt
	if(isset($_POST['other-excerpt']))
	{
	$_POST['metakeyselect'] = 'other-excerpt';
        $_POST['metavalue'] = $_POST['other-excerpt'];
        add_meta($post_ID);
        }

Displaying the “other language excerpt” is done in this simple-but-not-too-elegant way:

<?php
$post_other_excerpt=get_post_custom_values("other-excerpt");
$the_other_excerpt=$post_other_excerpt['0'];
if($the_other_excerpt!="")
{
	if($the_language=="fr")
	{
	$the_other_language="en";
	}

	if($the_language=="en")
	{
	$the_other_language="fr";
	}
?>
    <div class="other-excerpt" lang="<?php print($the_other_language); ?>">
    <?php print($the_other_excerpt); ?>
    </div>
  <?php
  }
  ?>

accompanied by the following CSS:

div.other-excerpt:lang(fr)
{
background-color: #FAECE7;
}
div.other-excerpt:lang(en)
{
background-color: #FFF;
}
div.other-excerpt:before {
  content: " [" attr(lang) "] ";
  font-weight: normal;
}

Now that we’ve got the basics covered, what else can be done? Well, I’ve got some ideas. Mainly, I’d like visitors to be able to add “en” or “fr” at the end of any url to my weblog, and that would automatically filter out all the content which is not in that language — maybe using the trick Daniel describes? In addition to that, it would also change the language of what I call the “page furniture” — titles, footer, and even (let’s by ambitious) category names. Adding language sensitivity to trackbacks and comments could also be interesting.

A last thing I’ll mention in the multilingual department for this weblog is my styling of outgoing links if they are written in a language which is not my post language, using the hreflang attribute. It’s easy, and you should do it too!

Suw (who has just resumed blogging in Welsh) and I have just set up a “Multilingual blogging” channel on TopicExchange — please trackback it if you write about blogging in more than one language!

Similar Posts:

Batch Category Editing For WordPress [en]

I put together an admin screen for WordPress today which allows changing multiple categories of multiple posts at the same time. Code available, no guarantees.

[fr] J'ai codé une extension à  WordPress qui permet d'éditer les catégories de nombreux billets en un coup. L'écran liste par exemple tous les billets d'une catégorie, accompagnés d'un certain nombre de selects. On effectue les modifications que l'on désire et on soumet le formulaire entier en une fois.

Update 13.07: A more recent version is out!

I had planned to give you a write-up of the beginning of my WordPress experience today. Unfortunately, I decided to clean up my categories somewhat before I did that, and I managed to badly mess things up.

The result is that I spent most of my day writing a Batch Categories admin screen to help me clean things up. It was something I had planned to do, and I suppose it will also be useful to other people.

If you want to play around: copy the code above into a file named batch-categories.php in your wp-admin directory. I highly recommend that you back up your wp_post2cat table before you get going. This script works for me, but hasn’t been tested much, and comes with no guarantees. It is not optimised either, so depending on how many posts and categories you list, the screen can very well take over half a minute to load!

There are still a few functionalities I want to add, in particular: assigning all listed posts to a category in one go (or removing them).

If you want pretty integration with the other screens of the Edit menu, you’ll have to tweak the navigation bar in edit.php, edit-comments.php, and moderation.php.

Update 24.06.04: I’ve uploaded a screenshot of the admin screen so you can see what it could look like.

Update II 24.06.04: Instead of hacking the Edit menu bars, you can also access the Batch Categories screen from the Plugins page: create a file called batch-access.php (e.g.) in your plugins directory. (Beware not to leave any whitespace after the ?>, though, or you’ll get errors. Promised, zips and more detailed documentation will follow.

Update 04.07.04: I tried using the script this morning, and it seems nastily broken (removed all categories for some posts). Use with caution, and get back to me if ever you hack it or modify it, I’m interested! I’ll look into this once I get back home from Vienna.

Update 12.07.04: The script now works as it should! Thanks to Ben and MooKitty for helping me nail the big nasty bug which was driving me bonkers! Two improvements I’m working on right now: making the code more efficient by using the category cache, and adding a “add all listed posts to category X” option.

Similar Posts: