Blog

Posted by: 
Dominique De Cooman

You have a node type containing an image field. You want to construct a feed containing the image (and node title) but the image needs to be resized to a format you don't use on the site.
I'll explain how to do it.

Posted by: 
Dominique De Cooman

Use this function if you want to pass extra variables to a tpl.php file.

Posted by: 
Dominique De Cooman

Given a page with multiple instances of the same form (which use the same form id), your form submit() function may not receive the anticipated set of form values for the form the user has submitted. The values you get may not be from the form attached to the submit button the user clicked, but values from a different form with different values which is using the same form id.

Posted by: 
Dominique De Cooman

This module turns dominique@dominiquedecooman.com into

<a href="mailto:&#100&#111&#109&#105&#110&#105&#113&#117&#101&#64&#100&#111&#109&#105&#110&#105&#113&#117&#101&#100&#101&#99&#111&#111&#109&#97&#110&#46&#99&#111&#109">

in the html code. Preventing your email being harvested by spammers.

The code in the module can be found on http://drupal.org/node/151638
I just put it in a little module ready to be downloaded and installed.

Posted by: 
Dominique De Cooman

Create a file containing the piece of javascript detailed in this post.

Posted by: 
Dominique De Cooman
Posted by: 
Dominique De Cooman

his happens when you add a lot of cck fields to a content type

Put 'max_allowed_packet =64M' (or more) in your my.ini file

Restart your server and the problem should be fixed.

Posted by: 
Dominique De Cooman

In this function you can alter existing or give new variables to every theme function.
In this example the theme_page variables are altered. Here we have a product page and this page needs another template file to be loaded. We alter $vars['template_file'] and if the test is true the page-product.tpl.php file will be loaded.
We also create new variables $vars['serviceMenu' and $vars['mainMenu'] which can be used in the page.tpl.php files as $mainMenu and serviceMenu.

<?php
function  _phptemplate_variables($hook, $vars) {
  switch($hook) {
    case 'page' :

Posted by: 
Dominique De Cooman

From drupal.org :
If the site is experiencing problems with permissions to content, you may have to rebuild the permissions cache. Possible causes for permission problems are disabling modules or configuration changes to permissions. Rebuilding will remove all privileges to posts, and replace them with permissions based on the current modules and settings.

Rebuilding may take some time if there is a lot of content or complex permission settings. After rebuilding has completed posts will automatically use the new permissions.

Posted by: 
Dominique De Cooman

I have a Mysql table with 2 rows. Total which is the score and uid which is the user id. I want to know which user has what rank. What's the fastest? Let Mysql do the whole sorting job or let Php do it. So I did an experiment. And the results are:

Php did the job in : 0.00024099999999994s
Mysql did the job in : 0.00073499999999993s

Php wins significant!

Pages

Subscribe to Blog