Category: Drupal

Drupal 7 Bootstrap : Load Drupal from an external PHP script

Naveen Nayak February 11, 2014 1 Comment Drupal

This is how to load or bootstrap Drupal 7 into an external script. We are doing a full Drupal bootstrap here. There are many phases which you can bootstrap, for eg bootstrap only the database layer. You can read about them on the Drupal site // display all errors error_reporting(E_ALL); ini_set(“display_errors”, 1); // drupal root […]

Drupal 6 theming a fieldset

Naveen Nayak June 12, 2013 No Comments Drupal

Drupal 6 fieldsets can be themed by supplying the #theme attribute for the fieldset #theme = your custom fieldset theming function you need to declare this theme function in the modules hook_theme function drupal will automatically look for theme_your_fieldset_theme_function() see the complete working example below /** * hook_menu * @return array */ function test_menu() { […]

Drupal 6 Bootstrap : Load Drupal from an external PHP script

Naveen Nayak September 23, 2012 No Comments Drupal

You can load drupal into an external PHP script. The external PHP script looks like this //change working directory to Drupal root directory chdir(‘/var/www/drupal/’); //include bootstrap file require_once ‘includes/bootstrap.inc’; // bootstrap drupal drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);  /* you can then call drupal functions etc like * db_query() * noad_load() */ $global $user; /* remember if you want have […]

Upgrading Drupal

Naveen Nayak September 28, 2010 No Comments Drupal

Follow the below Steps to upgrade drupal – this is up till drupal v 6.19 Most Important Steps Backup the Drupal Database Backup any external database that Drupal is referencing ( not required but a good practice ) Backup the entire Drupal installation directory (mine is in /usr/share/drupal6) Backup the “sites” folder – very important […]

Drupal 6: Passing Arguments to a Form

Naveen Nayak March 16, 2010 2 Comments Drupal

This is the form to which we are passing arguments to. Remember that the first parameter that is received in the form is the $form_state /* * My Form function * First parameter is &$form_state */ function my_form(&$form_state, $param1,$param2) { $form[‘heading’] = array ( ‘#type’ => ‘markup’, ‘#value’ => $param1, ); $form[‘submit’] = array ( […]

Page 1 of 2