The style switcher
Style switcher buttonsAt ZwahlenDesign.ch you can find a module called style switcher.
It's a very useful module because allows your users to choose from different styles.
Unfortunately this module is affected by some bugs and furthermore the module is for Drupal 4.6 while I'am using Drupal 4.7.2. In this article I want to show you how I modified the code in order to get rid of theese bugs. Keep in mind that maybe this is not the best way to do it, but it works. If you think there is a better way please post a comment.
After you install the module and enabled the block it places some buttons like those you can see in figure.
the firts problem is that it loads the stylesheet in the body tag making your xhtml not valid. to solve this problem I cut this code from the function style_switcher_block,
'<link href="themes/bluemarine/'. $_SESSION['style']. '.css" type="text/css" rel="stylesheet" />
modifying instead the code in themes/bluemarine/page.tpl.php in this way
<?php //print $styles ?>
<?php
$stylesheets = theme_add_style();
foreach ($stylesheets as $stylesheet) {
if ($stylesheet->path == base_path() . path_to_theme() . '/style.css') continue;
print theme('stylesheet_import', $stylesheet->path, $stylesheet->media);
} ?>
<?php print theme('stylesheet_import', base_path() . path_to_theme() . '/'. $_SESSION['style']. '.css', 'screen'); ?>
Another problem depends on a bug in module which gives you a lot of errors in the log when you click configure in administer/blocks.
Error in log
To avoid this error I modified the function style_switcher_block at line 23 as reported below:
if ($op == 'list') {
$blocks[0]['info'] = t('Style Switcher');
return $blocks;
}
else if($op == 'view'){
that's all. If you know a better way please post a comment.

A GOOD TOPIC
No one is defined by their worst moments. To understand a person you have to walk with them for many years. Gayle Haggard knew the gates real Ted before she knew about the fomenting torment of his soul. She just did not know his darkest parts. We are all adept at hiding those bits of ourselves which are least appealing. The truth door handles about Ted Haggard was seen in his day to day pastoring and leading of a congregation that grew to some 14,000 people. When I think of Ted I remember the guy who had time for a fellow pastor when he had thousands, literally thousands of people who could have said patio doors they needed him. So to me he is my friend, even though he may not even remember meeting with my wife and I in May of 2000 to counsel us about our future in ministry.