3 use Friendica\Core\Config;
4 use Friendica\Core\PConfig;
6 $uid = get_theme_uid();
8 $style = PConfig::get($uid, 'vier', 'style');
11 $style = Config::get('vier', 'style');
17 $stylecssfile = 'view/theme/vier/flat.css';
18 else if ($style == "netcolour")
19 $stylecssfile = 'view/theme/vier/netcolour.css';
20 else if ($style == "breathe")
21 $stylecssfile = 'view/theme/vier/breathe.css';
22 else if ($style == "plus")
23 $stylecssfile = 'view/theme/vier/plus.css';
24 else if ($style == "dark")
25 $stylecssfile = 'view/theme/vier/dark.css';
27 if (file_exists($THEMEPATH."//style.css")) {
28 $stylecss = file_get_contents($THEMEPATH."//style.css")."\n";
29 $modified = filemtime($THEMEPATH."//style.css");
32 $stylemodified = filemtime($stylecssfile);
33 $stylecss .= file_get_contents($stylecssfile);
35 if ($stylemodified > $modified)
36 $modified = $stylemodified;
38 $modified = gmdate('r', $modified);
40 $etag = md5($stylecss);
42 // Only send the CSS file if it was changed
43 header('Cache-Control: public');
44 header('ETag: "'.$etag.'"');
45 header('Last-Modified: '.$modified);
47 if (isset($_SERVER['HTTP_IF_MODIFIED_SINCE']) || isset($_SERVER['HTTP_IF_NONE_MATCH'])) {
49 $cached_modified = gmdate('r', strtotime($_SERVER['HTTP_IF_MODIFIED_SINCE']));
50 $cached_etag = str_replace(array('"', "-gzip"), array('', ''),
51 stripslashes($_SERVER['HTTP_IF_NONE_MATCH']));
53 if (($cached_modified == $modified) && ($cached_etag == $etag)) {
54 header('HTTP/1.1 304 Not Modified');