[Drupal] Programtically add custom meta tags to pages.

Assuming that we need to add custom meta tags by page url or node type, drupal hook_preprocess_page() is the last function called before displaying the page, so it's the right place for doing that :

[Mac] Ignoring Mac Os hidden files in SVN

working with a Mac with SVN can be fastidious especially when you have dozen of .DS_Store ..
So you have to look for the subversion config file on the server at the section global-ignores and add this pattern :
global-ignores = *.o *.lo *.la #*# .*.rej *.rej .*~ *~ .#* .DS_Store .AppleDouble ._*
Or if you don't have enough permission to do this use the svn propedit svn:ignore command
svn propedit svn:ignore files

[NipponMania] Learn Japanese : Baka ! (Jerk!)

First Japanse lesson 1 : How to tell someone that he is a Jerk

  • The Complete Form : あなたわ ばか です! (Anatawa baka desu !).
  • The Short Form : ばか!(baka !)

How to say that you are a Jerk :

Tags:

[Mac] That's why i love my mac [^_^]

Tags:

[Photoshop] Drawing a cutie japanese girl

Searching for funny sticker in internet i've found this one, So ask my self why don't try to draw it on photoshop ans see the result.
For the resources i've used patterns from http://www.brusheezy.com/patterns, this site is great ! and you can found amazing ressources.
After a few hours of drawing and try of patterns here is the result. If any one is ineterested i can publish the psd.

Tags:

Drupal 6 : An illegal choice has been detected.

Drupal form control can be tiresome some times, especially when developping custom modules .. In my case it was the integration of country and region select boxes from the ubercart module.

In my implementation of hook_form_alter we are adding these two elements in code :

Truncated result with MySQL GROUP_CONCAT function

MySQL function group_concat is a powerful tool to concat strings using a custom sperator  :

GROUP_CONCAT([DISTINCT] expr [,expr ...]
[ORDER BY {unsigned_integer | col_name | formula} [ASC | DESC] [,col ...]]
[SEPARATOR str_val])

But sometimes the execution result may be truncated because of mysql default setting, so in this case "group_concat_max_len" haveto be changed to a bigger value

SET [GLOBAL | SESSION] group_concat_max_len = val;

Database table history using Schemas and mysql triggers

Assuming that we have to trace every intervention on a database called « stats»

As result we wil have a new database with the "history_" prefix which will contain all the same tables of our source database "stats" but with different column definition. We have to add 3 new colums.

  • Operation.
  • Time.
  • Operation made.

Creating the histroy database.

To continue we assume that the mysql user is having all the correct privilieges for creating databases and Triggers.

Screen capture on MacOSX

Making screen capture is pretty easy on mac Os and you don't have to install anything ..

Shortcuts :