Tag Archives: Drupal

Drupal – Maximum execution time of 30 seconds exceeded

If you encounter this error in Drupal

  • Fatal error: Maximum execution time of 30 seconds exceeded …

 

It is caused by PHP settings, you can either modify the max_execution_time in php.ini or add the following lines in the Drupal settings.php. Continue reading Drupal – Maximum execution time of 30 seconds exceeded

Drupal – Load External Javascript using drupal_add_js() @ 2

Here is another way to add the external .js file.

$external_js = 'http://www.example.com/a.js';
drupal_add_js('document.write(unescape("%3Cscript src=\''. $external_js . '\' type=\'text/javascript\'%3E%3C/script%3E"));', 'inline');

 

Done =)

Previous Post: Drupal – Load External Javascript using drupal_add_js() @ 1

Reference: Web Design by Tim Wooten – Load external js file in Drupal 6

Drupal – Load External Javascript using drupal_add_js() @ 1

If you want to include external .js file in your custom module, create the following file.
external.js

(function ($) {
  Drupal.behaviors.myModule = function(context) {
    var externalScript = $('<script></script>').attr('type','text/javascript').attr('src', 'http://example.org/example.js');
    $('body').append(externalScript);
  }
}(jQuery));

Continue reading Drupal – Load External Javascript using drupal_add_js() @ 1

Drupal – Get the Number of nodes under a Parent Term

Previously, we talked about how to get the number of nodes of a specific term.
Drupal – Get Number of node of Taxonomy Term by Term ID

How about if i want to get the number of nodes under a specific parent term? Unfortunately, there is no such function. so i try to get that number by SQL. Here is the PHP code.
Continue reading Drupal – Get the Number of nodes under a Parent Term