boz's blog
Generate Word Documents With PHP
boz — Sun, 01/29/2012 - 16:45
Delete CCK Inactive Fields
boz — Sat, 01/28/2012 - 07:08
$fieldname = "";
db_query('DELETE FROM {content_node_field} WHERE field_name = "%s"', $fieldname);
db_query('DELETE FROM {content_node_field_instance} WHERE field_name = "%s"', $fieldname);
Delete Nodes From A Certain Date in Drupal
boz — Thu, 11/24/2011 - 20:07
I wrote this snippet to clear out some nodes that I had imported that ended up being duplicates. I thought I would share.
$time = mktime(0,0,0,11,23,2011);
$result = db_query('SELECT * FROM node WHERE created > %d', $time);
while ($item = db_fetch_object($result)) {
node_delete($item->nid);
}
Automated Node Titles Without Auto Node Title
boz — Thu, 10/06/2011 - 14:04
I am a features user and if you are too then you will share my frustration when you find aspects of other modules that are not exportable, i.e. not capable of being packaged in your feature. Such is the case with the Auto Node Title module. However, this is to be expected right? Ctools module provides the api for making things exportable and we should know not every developer will go ahead and implement this in their module. So back to our discovery of the non-exportable. When we get to this point there are several options.
Drupal Camp Iowa Ajax Example
boz — Sat, 09/17/2011 - 10:37
Get Paid To Learn Drupal!
boz — Fri, 08/05/2011 - 07:50
Balanced Scale Media, LLC is beginning the search for a qualified PHP developer to learn Drupal and take part in the deveopment of Drupal projects.
Job Description:
Learn Drupal by doing! Be able to develop custom modules and custom themes for Drupal 6 and 7 based on requirements documentation and design mockups. Work hours are open. Work is part time as needed.
Requirements:
Presenting "JavaScript Guidelines : When and When Not to Script"
boz — Wed, 07/20/2011 - 12:27
Drupal Form Alter on a Node Reference Widget
boz — Mon, 07/18/2011 - 14:53
My latest battle with Drupal was overriding a select box that was a node reference. Intuitively I tried to simply update $form['#options'] with my array of custom data. No deal. After experimenting with about five ways to implement #after_build on both the form and the field, I realized that the type of a widget is something like 'nodereference_select' instead of just select. Switching the type back to 'select' allowed me to make the change. Wow. Lost a day to that one.
The Paradox Of Drupal
boz — Fri, 07/08/2011 - 09:24
What is the paradox of Drupal? That often, the complex tasks are simple and yet the trivial tasks are difficult.
Programmatically Creating Users in Drupal with Profile Fields
boz — Fri, 06/10/2011 - 10:16
I learned from this comment on the api that user_save() will not save data to your profile_values table unless your profile field has the "Visible in user registration form" checkbox checked. Save yourself some pain.
