Joomla, Mysql, Symfony, Drupal, Code Samples, PHP

Drupal preprocess functions by content type

I use this as a shorthand way to provide preprocess "hooks" for any content type.


This snippet can be placed in a template or your chosen module, I usually place this in both the node and page preprocess function eg




Drupal plugin - Font Resizer

drupallogo.thumbnail.jpgSynopsis

 A handy little Drupal plugin that let's users increase/decrease fonts with a single click

nb I tried  the official drupalfont  resizer, but could not get it working, on the off-chance that you have the same problem...

A Complete PHP REST solution

php.gifSynopsis

A client requested the construction of a limited set of web services. Simpler solutions created the foundations for these services via a set of generic classes and libraries.

Details on how to implement these are given below

Signature Verification

The signature verifier script provides a simple way to validate the arguments passed to a function. Most functions sanitize their arguments before proceeding. Often this is via a set of repeated checks ie checking that a required field is not null or that it is the correct data type (array or int for example). If a function requires many arguments then this can result in a lot of code before the function can start it's actual work. The aim of this class is to abstract out as much of this as possible to improve readability and cut down on code duplication.

Literal Handling

The literal handling script illustrates a simple way of providing multi lingual capabilities to a website. Instead of having hard coded string literals within scripts, a simple call can be made to the literals class which will look for a match for the requested literal and the particular language it was requested in. The base literals class is extensible so that each site script can abstract it's own literals away into a seperate literal handling class.

Installing symfony on Vista

Symfony logoSynopsis

Instructions for setting up Symfony on your local machine can at first seem  baffling.With the benefit of hindsight however, the install instructions are actually fairly straightforward.

Overriding module functionality in Drupal

drupallogo.thumbnail.jpg

Synopsis

Sometimes it is necessary to override the functionality of a particular module. You may wish to to customize some functionality but without hacking the core code of the module.

How do you do this ?

There are several ways, here is just one.....

Drupal navigation on error pages

drupallogo.thumbnail.jpg

Synopsis

As of drupal 5.x blocks are not processed on 403 and 404 error pages, instead the contents of the specified pages are used along with the site theme to create an error page (or simply the words 'page not found' if no error page has been specified).

This decision was a deliberate one....

Mysql - Accessing start up variables

Mysql

Synopsis

For a variery of reasons the startup variables may not be be accessible from the mysql administrator panel.

To get access to the startup variables try the following....

 

 

Adding and removing regions from a Drupal template

drupallogo.thumbnail.jpgSynopsis

This article discusses how to create and remove regions within a theme.