Author Archives: Admin

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 →

How quickly send a mail with a Drupal module ?

You made a PHP script associated to a Drupal module and you want to be alerted of custom special events or big fails

In your module file, just implement the hook_mail() like this : Read More →

Create a node content type programmatically

If you’re a new Drupal user, you may have already created a fresh content type manually to organize your site correctly. But what happens if you want to create this content type with your module installation and don’t want to do it manually each type you install it on a new website ?. Here is how to create a content type programmatically with Drupal 7.  Read More →