Posted by: Paul on: November 10, 2009
Drupal’s module installation system makes it very easy to extend and customise Drupal sites and to disable and re-enable modules quickly and non-destructively. However, the default way Drupal’s treats modules can get in the way during development.
When building your own modules, it’s common for database table structure to change as project needs become clearer, or [...]
Posted by: Paul on: May 28, 2009
It has somewhat of a steep learning curve, but Drupal is amazing for allowing you to build flexible, complex websites with lots of functionality in very little time.
For a site I’m working on, we had several custom content types coming through the default node template (node.tpl.php) in our customised theme.
This was fine and dandy for [...]
Posted by: Paul on: October 8, 2008
One of my most used bookmarks is this wee gem:
http://nz.php.net/manual-lookup.php?pattern=%s
In Firefox, it set up this bookmark with the keyword ‘php’*.
This lets me type ‘php function name‘ into the address bar and takes me straight to the manual page for that function.
For example, for the date() function, I can just type
php date
and go straight to [...]
Posted by: Paul on: August 27, 2008
Being frustrated with the tinymce plugin for Expression Engine, I decided to create a rich text editor plugin for Expression Engine using the YUI library simple editor.
Due to a magic combination of:
the awesomeness of the YUI library
the thoroughness of the YUI documentation
the simplicity of creating extensions for Expression Engine
it was surprisingly straightforward.
If you’re using Expression [...]
Posted by: Paul on: June 6, 2008
Consider the following:
myscript.php
<?php
require_once(‘my-connection-settings.php’);
// do some stuff
?
my-connection-settings.php
<?php
$settings = array(’server’ => ‘locahost’, ‘user’ => ‘paul’, ‘password’ => ’secret’, ‘database’ => ’stuff’);
require_once(‘connection.php’);
?>
connection.php
<?php
$linkId = mysql_connect(/* db settings go here */);
?>
Seems perfectly reasonable. myscript pulls in the settings, which then pull in the database connection functions.
On Solaris, however, the first file is included fine, but the second fails. Silently.
As you [...]
Posted by: Paul on: June 7, 2007
I used to think this was hard. Turns out it’s pretty easy.
Posted by: Paul on: May 30, 2007
If you’re using the cron process to automate parts of your site / application, ensure you aren’t relying on superglobal variables like $_SERVER.
Apache provides information for the $_SERVER array (‘SERVER_NAME‘, ‘DOCUMENT_ROOT‘ etc), and as cron doesn’t run underApache, it has no access to information inside the $_SERVER array.
Posted by: Paul on: May 10, 2007
wrong: write 100 lines of code, test, spend an hour undoing your typo’s and logic bugs
right: write 5-10 lines of code, test, make easy fixes, repeat as often as needed until component is complete.
Posted by: Paul on: February 19, 2007
print_r is a great function. No matter how deeply nested your arrays are, print_r() will dump all the contents out into a neatly indented textual ouput for you to look at.
But what if you need to use the output of print_r() in a variable? Simply set the return flag like so:
$myVar = print_r($bigArray, true);
$myVar now [...]
recent comments