Quoting Daniel Carrera <daniel.carrera@zmsl.com>:
Earnie Boyd wrote:
3) If I want to make a custom script that uses the Drupal API, which file do I need to include? I can't just include "user.module", clearly that file depends on others.
You need to include "./includes/bootstrap.inc" and then execute drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL). The Drupal root directory must be your working directory before doing this.
Ok, thanks. Can I put the program in a different directory and chdir() to the Drupal root?
Yes. I created a function for this I called drupalize that checks for the includes/bootstrap.php file else backs up another directory. I then know I'm in the root directory. -- Earnie http://r-feed.com Make a Drupal difference and review core patches. -- http://for-my-kids.com/ -- http://give-me-an-offer.com/