header('Expires: Fri, 1 Jan 2500 01:01:01 GMT'); } else { $seconds = 3600 * $DBVARS['f_cache']; header('Cache-Control: max-age = ' . $seconds); header('Expires: ' . date('r', time() + $seconds)); } header('Pragma:'); } header('Content-Length: ' . filesize($file)); header("Last-Modified: " . gmdate("D, d M Y H:i:s", filemtime($file)) . " GMT"); ob_clean(); flush(); readfile($file); /** * returns a MimeType when given a filename * * @param string $f filename * * @return string */ function MimeType_get($f) { $mimetypes = array('doc' => 'application/msword', 'exe' => 'application/octet-stream', 'pdf' => 'application/pdf', 'xls' => 'application/vnd.ms-excel', 'ppt' => 'application/vnd.ms-powerpoint', 'js' => 'application/x-javascript', 'sh' => 'application/x-sh', 'swf' => 'application/x-shockwave-flash', 'tar' => 'application/x-tar', 'xhtml' => 'application/xhtml+xml', 'zip' => 'application/zip', 'mid' => 'audio/midi', 'midi' => 'audio/midi', 'mp3' => 'audio/mpeg', 'ram' => 'audio/x-pn-realaudio', 'rm' => 'audio/x-pn-realaudio', 'wav' => 'audio/x-wav', 'bmp' => 'image/bmp', 'gif' => 'image/gif', 'jpeg' => 'image/jpeg', 'jpg' => 'image/jpeg', 'jpe' => 'image/jpeg', 'png' => 'image/png', 'tiff' => 'image/tiff', 'tif' => 'image/tiff', 'djvu' => 'image/vnd.djvu', 'css' => 'text/css', 'html' => 'text/html', 'htm' => 'text/html', 'txt' => 'text/plain', 'rtf' => 'text/rtf', 'tsv' => 'text/tab-separated-values', 'xml' => 'text/xml', 'mpeg' => 'video/mpeg', 'mpg' => 'video/mpeg', 'qt' => 'video/quicktime', 'mov' => 'video/quicktime', 'avi' => 'video/x-msvideo'); $extension = preg_replace('/.*\\./', '', $f); if (isset($mimetypes[$extension])) { return $mimetypes[$extension]; } return 'unknown/mimetype'; } Core_flushBuffer('file');
if (isset($DBVARS['theme_variant']) && $DBVARS['theme_variant']) { if (!file_exists(THEME_DIR . '/' . THEME . '/cs/' . $DBVARS['theme_variant'] . '.css')) { unset($DBVARS['theme_variant']); Core_configRewrite(); } else { $c .= '<link rel="stylesheet" href="/ww.skins/' . THEME . '/cs/' . $DBVARS['theme_variant'] . '.css" />'; } } // } // { favicon if (file_exists(USERBASE . '/f/skin_files/favicon.png')) { $c .= '<link rel="shortcut icon" href="/f/skin_files/favicon.png" />'; } // } $smarty->assign('METADATA', $c . Core_trigger('building-metadata')); // } Core_headerTime('finished'); // { display the document ob_start(); if (strpos($template, '/') === false) { $template = THEME_DIR . '/' . THEME . '/h/' . $template . '.html'; } $t = $smarty->fetch($template); session_write_close(); $t = str_replace(array('WW_SCRIPTS_GO_HERE', 'WW_CSS_GOES_HERE', '</body>'), array(WW_getScripts(), WW_getCSS(), WW_getInlineScripts() . '</body>'), $t); if (isset($DBVARS['cdn'])) { $t = str_replace(array('href="/f/', 'src="/f/', 'src="/js/', 'href="/ww.skins/', 'url(/f/', 'src="/a/f=getImg/'), array('href="//' . $DBVARS['cdn'] . '/f/', 'src="//' . $DBVARS['cdn'] . '/f/', 'src="//' . $DBVARS['cdn'] . '/js/', 'href="//' . $DBVARS['cdn'] . '/ww.skins/', 'url(//' . $DBVARS['cdn'] . '/f/', 'src="//' . $DBVARS['cdn'] . '/a/f=getImg/'), $t); } echo $t; Core_flushBuffer('page', 'Content-type: text/html; Charset=utf-8'); // }
$degs = $matches[2][$i]; $css = '-moz-transform:rotate(' . $degs . ');' . '-webkit-transform:rotate(' . $degs . ');' . '-o-transform:rotate(' . $degs . ');' . '-ms-transform:rotate(' . $degs . ');'; break; default: $css = $matches[0][$i]; } $f = str_replace($matches[0][$i], $css, $f); } // } $f = str_replace('{{$THEMEDIR}}', '/ww.skins/' . THEME, $f); file_put_contents($parsed, $f); } $file = $parsed; } header('Content-Description: File Transfer'); header('Content-Type: ' . $mimetype); header('Content-Transfer-Encoding: binary'); header('Expires-Active: On'); header('Cache-Control: max-age = 99999999'); header('Expires: ' . date('r', time() + 9999999)); header('Pragma:'); header('Content-Length: ' . filesize($file)); if (ob_get_length() === false) { ob_start(); } ob_clean(); flush(); ob_start(); readfile($file); Core_flushBuffer('design_file');