* minor chages to tdoAbstract
[vsc.git] / style.php
blob8d17c9cd7193a2b78dd3c3f8d826eb779b8e646c
1 <?php
2 /**
3 * this will output the desired css style
4 * incoming variables
5 * @var theme _COOKIE
6 * @var media _GET
7 */
9 ob_start();
10 require ('./config.inc.php');
11 header('Content-type: text/css');
12 $theme = (!empty($_COOKIE['theme']) ? $_COOKIE['theme'] : DEFAULT_THEME);
13 if (!empty($_GET)) {
14 list($media) = array_keys($_GET);
15 } else {
16 $media = 'screen';
19 if (!is_file(THEME_PATH. $theme . DIRECTORY_SEPARATOR .'_css'. DIRECTORY_SEPARATOR .$media.'.css')) {
20 $theme = DEFAULT_THEME;
21 $media = 'screen';
24 $out = file_get_contents ( THEME_PATH. $theme . DIRECTORY_SEPARATOR .'_css'. DIRECTORY_SEPARATOR .$media.'.css');
25 ob_end_clean();
26 if (stristr ($_SERVER['HTTP_USER_AGENT'], 'MSIE'))
27 $out = str_replace(array('min-width:', 'max-width:'), 'width:', $out);
28 echo $out;