xurizaemon

xurizaemon's picture

drupal_render clearing default_value ... huh?

  1. function augforms_wall_invite_email_form($form_id, &$form_state = NULL) {
  2.   $num_invites = 5 ;
  3.   for ( $i = 0 ; $i < $num_invites ; $i++ ) {
  4.     $row = array() ;
  5.     $form['invite_name_'.$i] = arr
xurizaemon's picture

Creating an Ubercart node (while cross-grading from another DB, using Batch API)

  1. // used from Drupal's Batch API to generate a bunch of UC nodes
  2. function mymodule_import_create_review_node( &$vehicle ) {
  3.   global $user ;
  4.   $node              = new stdClass() ;
  5.   $node->title  
xurizaemon's picture

Dr Favourite 1.0

  1. Code to create a list of most-used modules on a single server -
  2.  
  3. for ii in $( mysql -s -e 'show databases' ) ; do mysql -ss -e "select name from system where filename like '%sites%modules%' and stat
xurizaemon's picture

storing CCK data via node save when creating a node

  1. <?php
  2.   $node->title = 'Hello' ;
  3.   $node->field_year_from[0]['value'] = '1001' ;
  4.   $node->body = "This review is " . $vehicle['filename'] ;
  5.   node_save($node);
  6.  ?>
xurizaemon's picture

get civicrm custom field id and field details

  1.         /**
  2.          *
  3.          * @TODO make this more restrictive - could return wrong result if there are
  4.          * more than one custom field with the same label
  5.          */
  6.         function _green_civicrm_get_custom_field( $label )
xurizaemon's picture

Fix for accessing profile info on current user

  1. /**
  2.  * detect whether the user has download credits.
xurizaemon's picture

accessing profile info on current user

  1. /**
  2.  * detect whether the user has download credits.
Syndicate content