Programatically enabling a theme in Drupal 6

Unfortunately, there is no API way to programatically enable a theme in Drupal 6, therefore you have to use a direct query:


db_query("UPDATE {system} SET status = 1 WHERE type = 'theme' and name = '%s'", $theme);

Jakub Suchý

Jakub is owner and founder of Dynamite Heads. Jakub is a member of Drupal Security Team and supports Czech Drupal community at Drupal.cz

Post new comment

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

More information about formatting options

CAPTCHA
Are you a robot?
Image CAPTCHA
Enter the characters shown in the image.