Skip to main content

Home/ Drupal for Developers/ Contents contributed and discussions participated by Daniel Gregoire

Contents contributed and discussions participated by Daniel Gregoire

Daniel Gregoire

Create your own API Site in Drupal 6 | drupal.org - 2 views

  •  
    Method for setting up a local/mirror copy of api.drupal.org. Core and contrib explained (though see comments for more details).
Daniel Gregoire

AJAX-ifying Drupal Node Forms | Stella's Website - 8 views

  •  
    Another tutorial on adding AJAX to Drupal 6 forms with FAPI. Based on poll.module like others. This process is not as straightforward as some, which is why it has been improved upon in D7.
Daniel Gregoire

Wrapper ID (form-item) not displayed for Checkboxes / Radio Buttons CCK Fields | drupal... - 1 views

  •   if (!empty($element['#id'])) {    $output .= ' id="'. $element['#id'] .'-wrapper"';  }  else { // if we can't get the #id from $element['#id'] just build it from $element['#name']    $id=explode("[value]", $element['#name']);    $output .= ' id="'. $id[0] .'-wrapper"';  }
  •  
    Small fix for giving radio/checkbox form elements a proper ID on their wrapper. By default in 6.16 and CCK, no proper CSS ID is given to the wrappers of radio buttons and checkboxes, making it impossible to theme the layout of those elements in the form (specifically for me, the node edit forms).
Daniel Gregoire

Multi-step Forms in Drupal 6 using variable functions | pingVision - 1 views

  •  
    Unique method for handling multistep forms in Drupal.
Daniel Gregoire

node_example.module | Drupal API - 0 views

  •  
    Basic creation of programmatic custom content type
Daniel Gregoire

How To Create Users Programmatically In Drupal 6.x - 1 views

  • <?php $newUser = array( 'name' => 'username', 'pass' => 'password', // note: do not md5 the password 'mail' => 'email address', 'status' => 1, 'init' => 'email address' ); user_save(null, $newUser); ?>
  •  
    Create users programmatically. A bit less involved than creating nodes; you just need to populate an array with values, don't need to cast it into an object.
Daniel Gregoire

Batch API | drupal.org - 0 views

  •  
    Another Batch API example, handbook
Daniel Gregoire

Batch operations | Drupal API - 0 views

  •  
    Basic Batch API explanation
Daniel Gregoire

file_save_upload problem saving into destination folder | drupal.org - 0 views

  •  
    Simple, clean example of adding a file field and saving the file permanently.
Daniel Gregoire

Programmatically Create, Insert, and Update CCK Nodes | doug | CivicActions - 2 views

  • Always use content_database_info to get the database info. For example:   $field1 = content_database_info(content_fields('yourfield1', 'yourtable'));  $table1 = $field1['table'];  $column1 = $field1['columns']['value']['column'];  $field2 = content_database_info(content_fields('yourfield2', 'yourtable'));  $table2 = $field2['table'];  $column2 = $field2['columns']['value']['column'];  if ($table1 == $table2) {    $sql = "SELECT n.*, t1.$column1, t1.$column2 FROM {node} n ";    $sql .= " INNER JOIN {$table1} t1 ON t1.nid = n.nid AND t1.vid = n.vid";  }  else {    $sql = "SELECT n.*, t1.$column1, t2.$column2 FROM {node} n ";    $sql .= " INNER JOIN {$table1} t1 ON t1.nid = n.nid AND t1.vid = n.vid";    $sql .= " INNER JOIN {$table2} t2 ON t2.nid = n.nid AND t2.vid = n.vid";  }  $sql .= " WHERE n.nid = %d";
  •  
    Important point: Using special functions to let CCK get the proper name of the field (allowing users to make CCK changes in the UI and let your code continue to work).
Daniel Gregoire

drupal_execute | DrupalContrib - 0 views

  •  
    Actual documentation for drupal_execute
Daniel Gregoire

Configuring settings using drupal_execute | drupal.org - 0 views

  •  
    Tagged for D5, but has D6 examples. Using drupal_execute (to be called drupal_form_submit in D7) to set site settings programmatically.
Daniel Gregoire

Programatically creating a CCK field in Drupal 6 | drewish.com - 5 views

  •  
    Quick 'n' easy, create CCK fields programmatically
Daniel Gregoire

Programatic CCK Now Possible! | groups.drupal.org - 2 views

  • <?phpfunction mymodule_enable() {     // Get the files content   $filename = drupal_get_path('module','mymodule') . "/mymodule.cck";  $content = implode ('', file ($filename));      // Build form state    $form_state = array(       'values' => array(            'type_name' => '<create>',            'macro' => $content,      ),     );    // Put it in there     drupal_execute("content_copy_import_form", $form_state);}?>
  •  
    Start with comment 54181 - "This works for me in Drupal 6" and read along.
Daniel Gregoire

Wiki Pages - drupal-chart-api - Project Hosting on Google Code - 2 views

  •  
    Chart API module documentation
Daniel Gregoire

Load Testing Tools and Tips | Tag1 Consulting, Inc. - 1 views

  • ApacheBench (ab)
  • $ ab -n1000 -c10 http://localhost/
  • Links: Project's web page: http://httpd.apache.org/docs/trunk/programs/ab.html Benchmarking Drupal code with ab: http://drupal.org/node/79237
  • ...5 more annotations...
  • Siege
  • siege -c 10 -i -t 5m -d 3 -f url_list.txt
  • Links: Project's web page: http://www.joedog.org/JoeDog/Siege Sproxy project page: http://www.joedog.org/JoeDog/Sproxy
  • Apache JMeter
  • Links: Project's web page: http://jakarta.apache.org/jmeter/ Load testing Drupal with JMuery, part 1: http://www.johnandcailin.com/blog/john/load-test-your-drupal-application... Load testing Drupal with JMuery, part 2: http://www.johnandcailin.com/blog/john/load-test-your-drupal-application...
  •  
    Load testing tools. ab and siege are command-line, JMeter is graphical (and written in Java).
Daniel Gregoire

Tips & Tricks | Drupal + FCKeditor - 5 views

  •  
    Instructions for enabling spell checking in FCKEditor (using Aspell and Spellchecker, the latter leaving ads unless a license/hosted version is purchased)
‹ Previous 21 - 40 of 70 Next › Last »
Showing 20 items per page