User login

How to

Information on how to do something... anything.

Adding aliases and functions to your GNU-Linux shell

After making your changes, including linking to another file, you can run on the command line:

Include your supplementary file like this:

. ~/.baschrc-agaric

$ source ~/.bashrc



Show nodes that reference a node, in a block

News content type has a nodereference that references Industries, Services, Products, and Testimonials.

From the Product, Testimonials, Services, and Industries nodes we should be able to see what News nodes referenced them.

That is, when on the product Widget, we want it to see news items that reference Widget.

Here is the answer to showing in a block the nodes that nodereference the current node

Convert Workflow's radio buttons to submit buttons in Drupal 6


When really messing with how a node and all the modules acting on it submit data when saving a node, you need to tackle things from both the form_alter side and the nodeapi side (or otherwise mess with the node submission).

Workflow uses nodeapi, and the only thing it's really looking for when inserting or updating a node is $node->workflow. We can set this in hook_nodeapi, most sensibly in op presave, or we can do it the probably harder but more correct-seeming way of an extra submit function. Detailed eventually below.

Include .htaccess in VirtualHost Document for performance

<VirtualHost *:80>
DocumentRoot /www/docs/

<Directory "/www/docs/">
AllowOverride None
RewriteEngine On
# etc

The above is what you need to know before including this:

Example Clean URL configuration of httpd.conf for performance


Get rid of extra spaces using PHP's preg_replace

Right there in the examples for the php function preg_replace was how to strip whitespace from a string:

$str = preg_replace('/\s\s+/', ' ', $str);

Ereg replace looks prettier:

$string = trim(ereg_replace(' +', ' ', $string));

However, Agaric has read in several places that preg_replace tends to be faster.


Maintaining referential integrity with Drupal CCK nodereference

Problem: Drupal does not check to make sure a node isn't being used as a nodereference on another node before it is deleted.

Solution: Agaric's own Stefan Freudenberg has created a module to protect from this.


Both of these are about the opposite direction:

OpenOffice Spreadsheet fun

It's April 14, and that means it's time for Ben to start doing his taxes.

Working on a spreadsheet to put in major expenses for

This did not work for reasons unknown.

=SUMIF(D2:D6; 'Household'; C2:C6)

This says it should:

Get the complete base URL for a Drupal site

Certain things in the world of Drupal, such as the the shockwave function, swf(), expect a full, absolute URL path and not the relative path (such as just a slash).

Syndicate content