Monthly Archives: February 2013

You are browsing the site archives by month.

How to deal with translated nodes programmatically

I had to import four different languages nodes into my Drupal 7 installation programmatically. It’s easy when you know where to begin with.

First, you have to enable different languages you will use into your Drupal administration. For example, I used

How to update to last kernel your debian 6 OVH box ?

I have a kimsufi Debian server on OVH.com and I want to update its Linux Debian kernel. As said on http://help.ovh.co.uk/KernelInstall, it is very easy.

You need to retrieve with a wget command the two last bzImage and System.map files from ftp://ftp.ovh.net/made-in-ovh/bzImage/latest-production specially adapted for OVH servers. You should use production releases as they are more stable that test releases, usually … Read More →

Compatibility problem between gems, RubyGems or Bundler ?

I tried a prerelease of ruby and I had a nice compatibility problem when gem update command

It seems bundler is not compatible with the new Rubygem version.

Read More →

How to install your Ruby Rails environment

Before playing with rails, you have some prerequisites. You need the ruby engine, a DevKit to let you compile native extension and the rails gem.

I will show you how to install all of them on windows. It’s a lot easier on Linux ! (apt-get install ruby && gem install rails)

  • Grab the latest installer 32 or 64 bit, install it on C:\Ruby
  • Download the DevKit too, if you don’t have MinGW installed on your computer, take the MinGW included auto extractor 32 or 64 bit. Extract it on C:\DevKit Read More →

How to create a user programmatically in Drupal ?

Why would you need to load or create a Drupal user from your PHP script ? Because you can associate processes and node importations with a user to identify them quickly into the Drupal content administration ! Then, it’s faster to create it programmatically if it doesn’t exist.

If you want to create or retrieve a Drupal user from your PHP Script, pretty simple: Read More →

How to make a favicon quickly ?

You know this little image you have in top left of each website, yes you can make one easily for your website ! Careful to chose the right website, there are so many ! Lots of them will let you create a favicon quickly but they’re not all good. The ones I chose deal correctly with transparency and have a pretty result. Some other tools gave me crap result. Read More →

How to use Drupal into a custom PHP Script ?

I had to make a Drupal data importation script in PHP to be processed every day. You have to follow a few steps to succeed.

First I had to remove PHP time out and memory limits to avoid failures. Drupal script can take a long time to execute, so many tables, queries, caches and joins every where… Read More →

How to deal with your custom module updates ?

At first, it can be hard to maintain and update your custom module but when you understand how it works, it’s pretty easy.

In your module.install file you will create a function for each update you want to make, for example, you forgot to add an agenda field in your content type : Read More →

Remove all nodes for a content type

If you want to clean your Drupal installation and remove everything that belongs to a content type, it is better to use a Drupal query. You shouldn’t try to remove them directly from a custom SQL Query. Here is how you can use Drupal db_query function: Read More →

Double blog title problem on WordPress

I had a conflict between the All in One SEO plugin and my theme. The blog title appeared two times like this: MyTitleBLOGNAME | BLOGNAME

I wanted to keep the plugin title rewriting so I had to remove the tweak from template functions. Read More →