Hi, Guys
I have build a test Site for Themes --> Drupal Themes Developing
I have installed all Drupal's recommended Themes for D6 and I want give Users the opportunity to see how
each Theme looks like.

To do:

#1 Getting the active Theme info printed on a front page.
#2 Adapt "Switch_Module" to be used by anonymous Users
---> I did --> Switch Module --> Permission for Anonymous User, but not working yet!

Help is very much appreciate!

Comments

Wolfflow’s picture

Relative to point (1.

Have add following code to frontpage content "Pictures say more then 1000 Words" :

<p>First place now:</p>

<?php
global $theme_key;
print $theme_key;
?>

note: at first page call it shows the used Theme-Name, after more recalls the print disappeared!!!

Relative to point (2.

After looking the Switchtheme Module i found out
that I have to change something here:

/**
 * Process a block switchtheme form submission.
 */
function switchtheme_switch_form_submit($form, &$form_state) {
  global $user;

  // save the setting in the db for logged in users
  // save the setting in the session for all others
  if ($user->uid > 0) {
    variable_set('theme_default', $form_values['custom_theme']);
    if (user_save($user, array('theme' => $form_state['values']['custom_theme']))) {
      $user->theme = $form_state['values']['custom_theme'];
    }
  }
}

Any help?

Contact me for drupal projects in English, German, Italian, Drupal Hosting Support.

dvessel’s picture

I don't want to get into all the details of what you're trying to do (don't have the time) but one source of information has lots of data.

  global $theme;
  $themes = list_themes();
  print var_dump($themes[$theme]);

list_themes will show all installed themes. It's basically all the data defined inside the .info file and the internal defaults. You can use the global $theme var to narrow it down by keying into it and get the path to the screen shot, name, description, etc..

joon park
www.dvessel.com