Drupal
Code Newbie vBulletin 4 / Drupal 6 Integration Project
Mike Milano — June 2, 2010 - 7:58am
This past week I've been porting a custom article system I wrote for Code Newbie to Drupal. The forums remain in vBulletin and that is the master user system.
The tricky part here is that the Code Newbie user base is in vBulletin. Surprisingly enough it wasn't that difficult utilize Drupal's user_external_login_register(). function.
Drupal 6 to 7, a first glimpse
Mike Milano — May 9, 2010 - 11:05pm
Today I finally started porting a module over to Drupal 7. I didn't read up in depth on the changes and just dove in and started learning based on the PHP errors and features that were not working.
I'm not going to go into anything too in depth here as there is good information out there already, but I took some notes and will point out some changes I had to make with the module I was working on.
Admin settings path
Adding IDs to all Fieldsets
Mike Milano — February 5, 2010 - 11:42am
A themer on a project I was recently working on needed a lot of CSS IDs added to fieldsets throughout the site.
Fortunately, there's a theme_fieldset() function in includes/forms.inc
I was able to copy that function into the phptemplate.php file, obviously change theme_ to phptempalte_ in the function name, and then add logic that adds an ID based on the fieldset name if an id does not already exist.
Here's the code:
/** * Format a group of form items. * * @param $element * An associative array containing the properties of the element.
Q-Views
Mike Milano — November 11, 2009 - 10:58pm
Q-Views is a module I came across while browsing through new modules on drupalmodules.com.
It's been a while since I've been so impressed with a module. This allows you to create views based of SQL. You allow it to analyze your SQL and it will populate a list of options for each field your query returns.
You can write module hooks to handle the query output on a per-field basis, or you can write the handler directly in the configuration.
Subscribe All Users to a Simplenews Newsletter
Mike Milano — April 29, 2009 - 10:51am
There's been a couple times where I've had to subscribe all users to a new newsletter.
I started out with a snippet I found which cleans up the subscriptions, but I lost the link or I would have referenced it here.
Here's the code that will subscribe all users to newsletter node id 16. Note I'm using mysql_insert_id() as a quick fix so you will need to use another method if you're not using mysql.
$result = db_query("SELECT uid, mail FROM {users} WHERE uid>0"); while ($row = db_fetch_object($result)) {
Disable TinyMCE in Node Body Based on Node Type
Mike Milano — December 5, 2008 - 12:11pm
There's been a few sites I've used WYSIWYG editors on recently where I've run into the issue of needing to disable it on certain text areas. TinyMCE supports this with a theme override just fine, however, it's not so simple when you have multiple text areas with the same name.
Take the node edit form. For every node type, the body uses the same name.
A practical example of when you would need to disable a WYSIWYG editor would be when filling a node body with previously designed HTML like when you design an HTML Newsletter.
Drupal Search : Index All Fields of a CCK Node
Mike Milano — October 1, 2008 - 3:04am
The Drupal Search API is powerful and pretty intuitive, but finding details on how to do something as simple as enabling searching on fields other than title and body could be a little daunting.
It's actually quite a simple concept. Anything exposed to your node view will be indexed. You can easily accomplish this by editing your content type and setting the Display Fields setting to Plain Text.
Drupal ParaChat Module
Mike Milano — September 9, 2008 - 4:04pm
:: 2008-09-25 update: i've fixed a lot of things since the .0 releases, so make sure you're using the nightly snapshots for the latest code ::
The ParaChat Drupal module embeds a ParaChat applet in your site and automatically logs in users with their Drupal username. There is access control so you can setup which roles you would like to be able to join the chat room. For added security, you can configure ParaChat to validate users from the ParaChat server before allowing them to join.
Pro Drupal Development for Drupal 6 is Released
Mike Milano — August 30, 2008 - 12:09am
Pro Drupal Development, Second Edition has been released for Drupal 6!
While I haven't gone through the second edition yet, this book written for Drupal has been an incredible resource. It is very well organized, easy to follow along with, and has plenty of code samples to help you on your way.
An alternative to Pathauto
Mike Milano — June 24, 2008 - 10:24pm
[img_assist|nid=11|title=|desc=|link=none|align=right|width=87|height=100]Pathauto is an awesome module, but there may be a time when, for one reason or another, don't want or don't need to use it.
custom_url_rewrite is a function (not a hook) available in Drupal which gives you an alternative to configuring custom paths and storing them in the database.
Since this is not a hook, it is suggested you put this in settings.php. You can convert the alias into the source, and vice versa.
