
I have posted a (less lines of code) header.php and footer.php for preview for XOOPS 2.0.13.2
Header
Footer
SetOutputFilter DEFLATE
SetEnvIfNoCase Request_URI .(?:gif|jpg|png|mov|wmv)$ no-gzip dont-vary
php_flag zlib.output_compression on
php_value zlib.output_compression_level 5
Herko Coomans wrote:
So if I'm reading this right, it's not so much a hacked XOOPS, but an optimised server and XOOPS install? Perhaps your XOOPS eXtreme would be more usefull as an optimisation guide then a codefork then?
Hekro
<?php
if (!defined("XOOPS_ROOT_PATH")) { die("Hacking Attempt Header"); }
include_once XOOPS_ROOT_PATH.'/class/xoopsblock.php';
$xoopsOption['theme_use_smarty'] = 1;
require_once XOOPS_ROOT_PATH.'/class/template.php';
$xoopsTpl = new XoopsTpl();
$xoopsTpl->xoops_setCaching(2);
//if ($xoopsConfig['debug_mode'] == 3) { $xoopsTpl->xoops_setDebugging(true); }
$xoopsTpl->assign(array('xoops_theme' => $xoopsConfig['theme_set'], 'xoops_imageurl' => XOOPS_THEME_URL.'/'.$xoopsConfig['theme_set'].'/', 'xoops_themecss'=> xoops_getcss($xoopsConfig['theme_set']), 'xoops_requesturi' => htmlspecialchars($GLOBALS['xoopsRequestUri'], ENT_QUOTES), 'xoops_sitename' => htmlspecialchars($xoopsConfig['sitename'], ENT_QUOTES), 'xoops_slogan' => htmlspecialchars($xoopsConfig['slogan'], ENT_QUOTES)));
$config_handler =& xoops_gethandler('config');
$criteria = new CriteriaCompo(new Criteria('conf_modid', 0));
$criteria->add(new Criteria('conf_catid', XOOPS_CONF_METAFOOTER));
$config =& $config_handler->getConfigs($criteria, true);
foreach (array_keys($config) as $i) {
$xoopsTpl->assign('xoops_'.$config[$i]->getVar('conf_name'), $config[$i]->getConfValueForOutput());
}
$xoopsTpl->assign('xoops_js', '//--></script><script type="text/javascript" src="'.XOOPS_URL.'/include/xoops.js"></script><script type="text/javascript"><!--');
$xoopsblock = new XoopsBlock();
$block_arr = array();
if ($xoopsUser != '') {
$xoopsTpl->assign(array('xoops_isuser' => true, 'xoops_userid' => $xoopsUser->getVar('uid'), 'xoops_uname' => $xoopsUser->getVar('uname'), 'xoops_isadmin' => $xoopsUserIsAdmin));
$groups = $xoopsUser->getGroups();
} else {
$xoopsTpl->assign(array('xoops_isuser' => false, 'xoops_isadmin' => false));
$groups = XOOPS_GROUP_ANONYMOUS;
}
$toppage = false;
if (isset($xoopsModule) && is_object($xoopsModule)) {
$xoopsTpl->assign('xoops_pagetitle', $xoopsModule->getVar('name'));
$xoopsTpl->assign('xoops_dirname', $xoopsModule->getVar('dirname'));
$moduleid = $xoopsModule->getVar('mid');
if (preg_match("/index.php$/i", xoops_getenv('PHP_SELF')) && $xoopsConfig['startpage'] == $xoopsModule->getVar('dirname')) {
$toppage = true;
}
} else {
$xoopsTpl->assign('xoops_pagetitle', 'All About Emma Watson');
$xoopsTpl->assign('xoops_dirname', "system");
$moduleid = 0;
//if (!empty($xoopsOption['show_cblock'])) {
//$toppage = true;
//}
}
/*
if (!isset($show_rblock)) {
$xoopsTpl->assign('xoops_showrblock', 0);
}
if (!isset($show_cblock)) {
$xoopsTpl->assign('xoops_showcblock', 0);
}
if (!isset($show_lblock)) {
$xoopsTpl->assign('xoops_showlblock', 0);
}
*/
if (xoops_getenv('REQUEST_METHOD') != 'POST' && !empty($xoopsModule) && !empty($xoopsConfig['module_cache'][$xoopsModule->getVar('mid')])) {
$xoopsTpl->xoops_setCaching(2);
$xoopsTpl->xoops_setCacheTime($xoopsConfig['module_cache'][$xoopsModule->getVar('mid')]);
if (!isset($xoopsOption['template_main'])) {
$xoopsCachedTemplate = 'db:system_dummy.html';
} else {
$xoopsCachedTemplate = 'db:'.$xoopsOption['template_main'];
}
$xoopsCachedTemplateId = 'mod_'.$xoopsModule->getVar('dirname').'|'.md5(str_replace(XOOPS_URL, '', $GLOBALS['xoopsRequestUri']));
if ($xoopsTpl->is_cached($xoopsCachedTemplate, $xoopsCachedTemplateId)) {
$xoopsLogger->addExtra($xoopsCachedTemplate, sprintf('Cached (regenerates every %d seconds)', $xoopsConfig['module_cache'][$xoopsModule->getVar('mid')]));
$xoopsTpl->assign('xoops_contents', $xoopsTpl->fetch($xoopsCachedTemplate, $xoopsCachedTemplateId));
$xoopsTpl->xoops_setCaching(0);
if (!headers_sent()) { header ('Content-Type:text/html; charset='._CHARSET); }
$xoopsTpl->display($xoopsConfig['theme_set'].'/theme.html');
exit();
}
} else {
$xoopsTpl->xoops_setCaching(0);
}
if (!isset($xoopsOption['template_main'])) {
include XOOPS_ROOT_PATH.'/include/old_theme_functions.php';
$xoopsTheme['thename'] = $xoopsConfig['theme_set'];
ob_start();
}
if (isset($_COOKIE[$xoopsConfig['usercookie']])) { $xoopsTpl->assign('unamevalue', $_COOKIE[$xoopsConfig['usercookie']]); }
//echo '<!--'.$xoopsLogger->dumpAll().'-->';
$cmodule = isset($GLOBALS['xoopsModule']) ? $GLOBALS['xoopsModule']->getVar('dirname') : "system";
$xoopsTpl->assign('cmodule', $cmodule);
$xoopsTpl->assign('nojavascript', 'no');
?>