chirale

IT and beyond

I maintain a news website written in Drupal since 2007. It is a Drupal 6, before was a 5. I made many Drupal 7 installations in these years and I went to three Drupal local conventions. This is a guide on how to abandon Drupal if you already knows some basics of Django and Python. Drupal on LAMP: …

Continue reading

I’m installing a Pressflow 6 on a new machine running CentOS 6. I’m using Apache MPM Worker with FastCGI. Then I get the classical e-mail error: Unable to send e-mail. Please contact the site administrator if the problem persists. Then I try to use sendmail: Where testmail is a file containing these lines: And i …

Continue reading

Following code is useful when installing a module that create a new content type programmatically on Drupal 6.x. Basically, it adds two variables setting default values for comments (core Comment module) and attachments (core Upload module). Code to write on my_funny_module/my_funny_module.install. function my_funny_module_install() { // Disable attachments // Read http://api.drupal.org/api/function/upload_nodeapi/6 on “load” variable_set(“upload_my_content_type”, 0); // …

Continue reading

This simple code can be pasted into a PHP filtered block (or into a block declared by a module) to set some style from a block into the block container itself. <?php echo ‘My block content’; /** Put styles inline on html head**/ drupal_set_html_head(‘<style type=”text/css”> #my-block-id { /* my style*/ } </style> ‘); ?> This …

Continue reading

Sometimes you want to redirect a page to another on drupal. You can do this using a simple function called drupal_goto(). On few sites I’ve enabled the PHP filter module and then created a new page with PHP code input format with drupal_goto(‘node/2’) to redirect the current page to a specified node. Bad idea. I’ve …

Continue reading