Rendering External URL Aliases as External Links

Drupal 6 doesn't seem to mind if you save an external URL as a node's path alias. Rendering it, however, throws the full, escaped URL as a path within the site. For some reason (I'm guessing .htaccess), those links still end up going to the external URL, but they look most ugly, and don't trigger External Links processing.

So, the key is the custom_url_rewrite_outbound function. This weird, quasi-hook of a function can be placed in settings.php to affect the behavior of links generated by url(). As noted in that documentation, url() may be called dozens of times in a single page request, so performance is extremely crucial here.

migrating from D5 upload module to D6 cck filefields

I'm working to update a Drupal 5 site that uses the core upload module to a Drupal 6 site that uses CCK Filefields. I found some work on handling this by drewish, but it needed adapting for my uses.

Programmatic Carts and Orders in Ubercart

Here is a (somewhat raw) function that will place an order in ubercart on behalf of a given, fully-loaded account. It all happens in code, bypassing the multiple-screen checkout process of UC.

This means you have to have all the info you need for the order already stored somewhere, of course. In the use case that spawned this code, it is being gathered through a series of custom forms.

Blocked Note

Attached is a little module that allows users with the 'administer users' permission, which gives them the right to block a user, the ability to add a note to the blocking action. When the blocked user tries to log in, if they provide valid credentials, they see the note as an error.

Now when you drop the banhammer, they know why they're hurting.

This has to mess with the validation functions of user login, so it may have conflicts with other modules that do the same thing, like logintoboggan. Reordering module weights may help; I haven't tried.

Slouching towards PCI Compliance

I'm starting work to bring a drupal site towards PCI compliance and I thought it might prove handy to document it.

Sadly, I must work towards Self-Assessment Questionnaire D, which is not short. This post is going to focus on Requirement 8: Assign a unique ID to each person with computer access.

Syndicate content