addBehavior('publicHeadContent', array('dcYASH','publicHeadContent')); $core->addBehavior('publicFooterContent', array('dcYASH','publicFooterContent')); $core->url->register('yash3','yash3','^yash3(?:/(.+))?$',array('dcYASH','getVarFile')); class dcYASH { public static function getVarFile($args) { /* * send the css or js file * Don't take care about all path vars */ global $core; list($osef,$ext) = explode(".",$args); switch($ext){ case "css": $ext = "css"; header("Content-type: text/css"); break; case "js": header('Content-Type: application/javascript'); $ext = "js"; break; default: throw new Exception ("Page not found",404); break; } $fileToSend = path::real(DC_VAR)."/yash3/". $core->blog->id."/". $core->blog->settings->yash3->yash3_concat_version.".". $ext; if(file_exists($fileToSend)){ header('Expires: '.gmdate('D, d M Y H:i:s \G\M\T', time() + (365*3600*24))); echo file_get_contents($fileToSend); }else{ throw new Exception ("Page not found",404); } } public static function publicFooterContent() { global $core; $core->blog->settings->addNamespace('yash3'); if ($core->blog->settings->yash3->yash3_active){ $cssURL = $core->blog->url.$core->url->getBase('yash3')."/". $core->blog->settings->yash3->yash3_concat_version. ".css"; echo "\n". ""; $jsURL = $core->blog->url.$core->url->getBase('yash3')."/". $core->blog->settings->yash3->yash3_concat_version. ".js"; echo ''; } } }