By Phil Frilling, 31 January, 2012
Today I needed to create a view the filtered items by a range of prices. The prices for these nodes were stored in a CCK number field. After searching for an easy 'plug and play' method of doing this I quickly began writing my own code to accomplish this task. To summarize, I accomplished this by using the following functions:
  • hook_form_alter()
  • hook_views_query_alter()

Step 1.

Begin by creating your view and adding your CCK number field as an exposed filter. You'll want to be sure that you use the 'is between' operator.
By Phil Frilling, 26 January, 2012
Today I was working on a mobile theme for a client of ours and I needed to remove the printer friendly link from every page. The first thing I did was create a hook_link_alter() function in my custom module and quickly realized this would alter every theme. I came across this article (http://drupal.org/node/46961) that lead me to the $theme_key variable. Using this I quickly limited my hook_link_alter function to the proper theme.
By Phil Frilling, 21 December, 2011
Today I was researching some modules for a large project that I am working on and I came across the Context module. This module allows you to setup different conditions and add/remove content from the theme. For example, if I wanted an entire block region removed from a members only region of my site, I would setup my condition to be 'intranet*'. Then, I would set my 'Reactions' to remove the proper template regions from the theme. Pretty badass!.
By Phil Frilling, 14 December, 2011
In a related note to the backup restore that I performed yesterday, I decided to run the upgrade.sh script provided by community.aegir.com. First, I downloaded the script to my restored EC2 instance wget -O upgrade.sh 'http://drupalcode.org/project/provision.git/blob_plain/refs/tags/6.x-1.6:/upgrade.sh.txt' Next I logged in as the Aegir user and ran the uprade.sh script per the instructions: su -s /bin/sh aegir -c "sh upgrade.sh" The status message displayed ment
By Phil Frilling, 13 December, 2011
Today I had the unfortunate need to get a restored database from an Amazon EBS snapshot. To do this I logged into the Amazon AWS management console and determined which snapshot I needed to restore from. Once I highlighted the correct snapshot, I clicked the 'Create Volume' button. Next, I chose which availability zone the snapshot should reside in and click 'Create' Next, I spun up a new instance of the production server, using the same AMI (ami-294aa340).
By Phil Frilling, 22 November, 2011
I'm in the process of building a custom Ubercart module that allows users to dynamically enter sizes using Ubercart's uc_attributes module. The problem I ran into is that I needed to theme these custom attributes in the cart_view_form and cart_checkout_form to add a suffix behind value. Initially I overwrote the original theme file in my module using the phptemplate_ prefix. This worked great, however, after further consideration I realized the flaw in this logic. Overriding the theme like this would not allow other user's to override that theme file. So back to the drawing board I went.
By Phil Frilling, 3 November, 2011
Today I was working with an ExpressionEngine website (which I know nothing about) and I needed to get a modification date on the user profile fields. After searching the ExpressionEngines documentation, I realized that adding my own submit function wasn't going to be as easy as Drupal's hook_form_alter(). My next thought was to try MySQL.

Tags

By Phil Frilling, 1 November, 2011
Today I had the challenge of generating a view that needed to filter results based on the date/time a node was created. More specifically, I needed to filter bowling stats for a season. Easy, right? The problem I ran into is that the bowling season doesn't begin and end in the same year. So using an argument to only grab nodes created in 2011 didn't work. I needed the view to grab nodes between July, 2010 through July, 2011. Initially I experimented with Views Date Range.