[dev] fun with themes (OT?)

Ben Chavet ben at chavet.net
Fri Jan 9 16:01:36 PST 2004


Not sure if this is on-topic or not, but I was having fun with it & wanted to
share (in other words, I'm not looking to have it commited):

I was messing with trying to pick a default theme for my horde installation &
couldn't make up my mind, so I wrote a quick hack to pick a random theme each
time you visit the site.  Not exactly useful, but I like it & my users seem to
think it's pretty neat, too.

Enjoy!

--Ben


in config/prefs.php:

// UI theme
$themes = array('barbie', 'bluewhite', 'brown', 'burntorange', 'camouflage',
                'cornflower', 'gennevilliers', 'green', 'grey', 'lavender',
                'lightblue', 'lucblue', 'luc', 'mozilla', 'NeXTgrey',
                'simplex', 'default');
if (!isset($_SESSION['random-theme'])) {
    $_SESSION['random-theme'] = $themes[rand(0, sizeof($themes) - 1)];
}

$_prefs['theme'] = array(
    'value' => $_SESSION['random-theme'],
    'locked' => false,
    'shared' => true,
    'type' => 'select',
    'desc' => _("Select your color scheme.")
);


----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.


More information about the dev mailing list