You are here

function page_theme_init in Page Theme 6

Implementation of hook_init().

File

./page_theme.module, line 120
This module allows to use different themes than the site default on specific pages.

Code

function page_theme_init() {
  $path = drupal_get_path_alias($_GET['q']);
  $result = db_query('SELECT theme, pages FROM {page_theme} WHERE status = 1 ORDER BY weight, theme');
  while ($page_theme = db_fetch_object($result)) {
    $page_match = drupal_match_path($path, $page_theme->pages);
    if ($path != $_GET['q']) {
      $page_match = $page_match || drupal_match_path($_GET['q'], $page_theme->pages);
    }
    if ($page_match) {
      global $custom_theme;
      $custom_theme = $page_theme->theme;
      return;
    }
  }
}