User login

Drupal date handling has critical issues with page arguments

So there seems to be some serious issues handling dates from your content types with views+cck+date module.

if you have a page argument like "year/%" for example -> "year/2010" then you should really consider if date module has resolved these issues.

however, if you store the year as an integer, there is no problem, and it's only when dealing with the date module

What's more annoying is that the views preview button does not reflect any errors in the query, a nice little time waster till you figure out theres something low level going on.


Google pagespeed test

A nice handy link , Google pagespeed report engine

Ooops, Need to make sure I'm sending the right expiration headers for imagecache generated content!


Very rapid Drupal theming from an existing web template

I love this wget command (available under windows, linux and mac), sometime's you want to try out a template that you have seen or you want to rapidly implement an existing site from an external source to a local Drupal installation without breaking down the template into a zen (or other framework) template system.

Note: I don't really suggest this for building a good theme in Drupal, but it's just an idea for experimentation anyhow

Local dev - forcing email from PHP to a local file

Sometimes when working on site's for clients, you need to take a very close look at the mail output from PHP, some webapps like civicrm let you specifiy a different output, but in general, you can just edit your php.ini and set

sendmail_path = /usr/bin/pretend-sendmail

and then your /usr/bin/pretend-sendmail

cat > /tmp/mail.out.$$

Don't forget to chmod +x /usr/bin/pretend-sendmail

in your /tmp you should have

-rw-r--r--  1 www-data www-data     1808 2011-04-21 14:25 mail.out.23829

"I don't want to say right now" Said the robot...

Seems to be some kind of robot joining drupal sites and entering in "I don't want to say right now" into any user registration profile fields

Try with this google search to illustrate


Another nice job, add USA catalogue to The Chia Company website

Had another great small job courtesy of Hard Hat Melbourne. Basically just took the existing Drupal (ubercart) based site and added a new United States section to the products, so it appears the site carries two catalogues of products for their respective markets.

If you add a comment with a HREF, and its one of your first, I will delete your account!

Simple but brutal antispam solution

function MYMODULE_comment(&$a1, $op) {

  global $user;
  // if you add a comment, and its your first comment, and it has a HREF, im a gunna delete your account
  if ($op == 'insert') {
    $result = db_query("SELECT count(*) as c from comments where uid=%d", $user->uid);
    $row = db_fetch_array($result);
    if(preg_match('/href/i',$a1['comment']) && $row['c'] <2 ) {
      user_delete(array(), $user->uid);


Subscribe to Front page feed