One function that I had always seen and never found a good use for is array_walk().
Basically array_walk() will iterate over an array and execute a function for each item in the array. you can do some things with this, and I found a use for this combined with closures and DBTNG.
One of the many good things with DBTNG is that it is very easy to do a multi row insert, and if you are writing an array of values you can do the following
I just recently finished a project where they were using the abbrfilter. When I set up my local copy I found that it just wouldn't work at all.
After some investigation I found that the problem was since I was running on PHP 5.2 and abbrfilter was using PHP closures. Like most people we have all used closures in javascript, and they create small one off function much easier and much more elegant to code.
When working with a friend of mine, he kept asking me the arguments for functions, and when I told him to try api.drupal.org or my favorite drupalfunctions.com he told me that sometimes it is not the case and what he wanted to know was what was really being past to the function.
Well I told him that was quite, simple just dpm() the arguments of the function. Looking at me bewilder, I showed him the function func_get_args() and how when it is combines with dpm() it will show you exactly what is called.
A couple of days ago I started my first Drupal 7 site for a client, and while I was doing that I was listening to the latest Lullabot podcast and Angie was talking a little about the Drupal 8 (very briefly) and about what Larry Garfield was planning for blocks, in that their will be a completely new model which will be more of a pull model instead of the current push model which is currently in Drupal <= 7. This took me back to Drupalcon SF at the Core Developers Summit and other breakout sessions where we started talking about this.
Working on an import of some content for a client I have found that some things were not working such as auto node title.
After spending about 30 minutes banging my head to work out what the problem was. If was a problem that I had forgotten about, as I needed to get around this in the past.
Basically the problem is that when you do an update of your system hook_init() is not called. Normally this is not a problem but what happens in that modules like cck use hook_init() to include the token implementation, or even in the case of strongarm all the $conf is updated during hook_init().
I did some work today and cleaned up my website so it is not a spam sink and updated all the modules to the latest version of Drupal 5.x. Next is to upgrade it to Drupal 6 ready for Drupal 7. Also I got rid of CAPTCHA and I am now using Mollom which should stop the spam.
I have a number of articles I want to publish and now I have a place to publish these again, and will start publishing again.
Just after the Apple TV was released I purchased one.
I am really happy with it. But being here in Australia and iTunes doesn't have TV shows available which is disappointing since the Free to air channels are **CRAP** and just screw with all the descent shows and really make it frustrating to watch. (Well back on track) So I have hacked my AppleTV so that I can get my content from my computer in the office.
Since I have upgraded my site to Drupal 5 I have added to Captcha to get rid of the bloody spam comments. Originally I was going to just use the math or other basic captcha's to implement a very clean captcha.
But I was listening to Security Now, Leo and Steve were talking about reCaptcha which not only a allows the use of captcha, but also helps with other projects. Here is a quick snippet of what these projects are
To archive human knowledge and to make information more accessible to
the world, multiple projects are currently digitizing physical books
that
were written before the computer age. The book pages are being
photographically scanned, and then, to make them searchable,
transformed into text
using "Optical Character Recognition" (OCR). The transformation into
text is useful because scanning a book produces images, which are
difficult to
store on small devices, expensive to download, and cannot be searched.
The problem is that OCR is not perfect.
So what they do is take these mis-converted words and use them as the captcha image and people responses are passed back to the projects to allow the projects to quickly fix up all the missing words that the OCR's couldn't get.
So if you do need to have captcha on your site, you might as well make it help other projects at the same time. So far for me it is working great. If you want to use recaptcha then you will find it at http://drupal.org/project/recaptcha
After many months of resistance I finally upgraded my site to Drupal 5.
OK, it was not resistance, I just didn't have time to do it. So now I have done it and I am managed to log into my site after Dreamhost upgraded to PHP 5.2 and I then couldn't log in with 4.7+
Oh well it is done now, so I can move forward and do some cool stuff.