Error message
Deprecated function: implode(): Passing glue string after array is deprecated. Swap the parameters in drupal_get_feeds() (line 394 of /home1/tylerfra/public_html/includes/common.inc).
drupal 6.x
Here is how to send an e-mail with some custom code in your module and by utilizing hook_mail.
Add this example code snippet to your custom module where you would like to have an e-mail sent. For example, maybe you want to send an e-mail about a node when one of your module's forms are submitted.
Do you need to execute some custom code when a node's workflow state changes in Drupal? Yes? Ok.
In your custom module, implement hook_workflow provided by the Workflow module and try something like this:
To setup custom access control in Drupal 6, try something like this...
This example restricts access to everyone on a particular node type, unless the user belongs to a certain role or is the node author. Here is how I did it using hook_node_access_records and hook_node_grants in Drupal 6:
UPDATE: Thanks to user comments, it turns out the easiest way to do this is with this command:
git add -u
Otherwise, feel free to read the example below for an alternative approach...
===============================
So today I was updating the filefield module in Drupal 6 with Drush (drush up webform), this worked great, as usual. However, my Drupal site is under source control with GIT. So after updating the module and running 'git status' I was presented with a whole bunch of changes. Something like this:
git status
Here are a few helpful MySQL queries to retrieve file usage in Drupal (perhaps via IMCE or other file management module).
Total File Space Used by a Particular User
select SUM(filesize) as total_space from {files} where uid = 123;
Total File Space Used by a Particular Directory
select sum(filesize) as total_size from {files} where filepath like '%files\/my_sub_dir\/my_other_sub_dir%';
Here is how you can make a backup copy of your Drupal's MySQL database from a terminal:
mysqldump -u my_drupal_mysql_uer_name -p my_drupal_mysql_database_name > ~/my_drupal_sql_dump.sql
I like to clear all of Drupal's caches before running the dump so there isn't a bunch of cache data in the export.
If you'd prefer to use Drush, check out this article instead: Use Drush to Export/Import a Drupal MySQL Database Dump File
If you need a custom time field select list with 15 minute interval options in Drupal 7, try this out when adding a new field to your content type (this will work in Drupal 6 as well):
Field: List (text)
Widget: Select list
Allowed values list:
Alas, I came across a better way to take a bunch of rows from views, group them by a particular field, and provide a count for each.
Here is a basic example for Drupal 6 (probably very similar for Drupal 7).
Basic Settings
Style: HTML List
Fields
Node id (exclude from display)
Node title
Arguments
Node title
Do you need to add a unique CSS ID or Class Name to a Drupal menu item link? Then you've come to the right place. Check out this example below...
Menu item link before:
<a href="/my_node_url_path">My Node</a>
Menu item link after:
<a href="/my_node_url_path" id="my_css_id" class="my_css_class">My Node</a>
How to do it...
Pages