Random Code!

A repository of random code and some explanations behind it all. Non-drupal related code is licensed under Creative Commons (see the footer for more specific licensing details), so feel free to use and abuse as you see fit. Drupal modules are GPLv3.

Testable code can be found here. Tests are created in Simple Test.

Pagination Node (Drupal Module)

This module allows you to paginate selected node types seamlessly (ie, offer pagination on a "page" type node).

Guidebook (Drupal Module)

This module is a climbing/buildering guidebook for use in Drupal based installations. It integrates with google maps to provide mapping data for routes.

The guidebook is in use at buildering.net.

I wouldn't suggest using this module on a production site at the moment, as it's pretty tailored specifically for buildering.net. If you need similar sort of map style functionality that this module provides, let me know, and I'll clean up the code and make a public release.

Template Engine

This template engine was developed as a drop in replacement for CodeIgniter's default views. The goals of the project were:

  • Allow templates with valid XHTML markup
  • Allow for simple view logic (conditionals)
  • Allow for template caching to help undo the evils of building a template language in what began as a template language
  • Allow for lazy loading of data

There are a number of template engines available, however the majority of them do not fit the above goals in one way or another. This engine should work in PHP4, but right now should be considered beta quality code.

DB Abstraction + SQL Generation

This is a generic, simple, database abstraction layer and SQL generator. It's largely based on WACT which sadly doesn't look like it's being developed actively at the moment.

Given the number of database abstraction layers out these days, I wouldn't suggest using this for anything more than understanding basic concepts.