drupal

Fix for Create User and insert custom field data D7

  1. // Code to actually create the user object and create the new user
  2.         $account = new StdClass();
  3.         $account->is_new = TRUE;
  4.         $account->status = TRUE;
  5.         $account->name = $username;
  6.         $account->pass = '

Create User and insert custom field data D7

  1. // Code to actually create the user object and create the new user
  2.         $account = new StdClass();
  3.         $account->is_new = TRUE;
  4.         $account->status = TRUE;
  5.         $account->name = $username;
  6.         $account->pass = '

Fix for Allow HTML in "node" titles for Drupal 6.x

  1. <?php
  2. /*
  3.  * Created 20 Apr 2009 12:07:47 by Greg Harvey
  4.  * http://www.drupaler.co.uk
  5.  */
  6. function html_titles_preprocess_page(&$vars) {
  7.   if (arg(0) == 'node' && is_numeric(arg(1))) {
  8.     $node

Ignition proof-of-concept

  1. /*
  2.  * TODO:
  3.  *
  4.  * Review this section - this is a proof-of-concept JSON managed config
  5.  * exporter.

CTools Error with Drupal 7

  1. CTools CSS Cache        Unable to create
  2. The CTools CSS cache directory, ctools/css could not be created due to a misconfigured files directory.

LT initial functionality test

  1. <?php
  2. // $Id$
  3.  
  4. class LoginTobogganMiscTest extends DrupalWebTestCase {
  5.   /**
  6.    * Implementation of getInfo().
  7.    */
  8.   public static function getInfo() {
  9.     return array(
  10.       'name' => t('

Broken Panels hook

  1. function ignition_default_page_manager_pages() {
  2.   $pages = array();
  3.   dpm('here');
  4.   watchdog('debug', t('In page manager hook'));
  5.   // Check the include directory.
  6.   $path = drupal_get_path('mo

Ctools hook

  1. /**
  2.  * Implementation of hook_ctools_plugin_api().
  3.  *
  4.  * If you do this, CTools will pick up default panels pages in
  5.  * <modulename>.pages_default.inc
  6.  */
  7. function ignition_ctools_plugin_api($mo

Batch API on installation

  1. // IN THE .install FILE:
  2.  
  3. /**
  4.  * Implementation of hook_install().
  5.  */
  6. function node_to_word_stats_install() {
  7.   // Create tables.
  8.   drupal_install_schema('node_to_word_stats');
  9.   // Populate

Checkmember_user

  1. <?php
  2. function checkmember_user ($op, &$edit, &$user, $category=null)
  3. {
  4.   if ($op == "insert" || $op == "update")
  5.   {
  6.     // clear first
  7.     db_query( 'DELETE FROM {users_roles} WHERE uid = %d',
Syndicate content