app_die(__FUNCTION__, __LINE__, '<strong>{--FATAL_ERROR--}:</strong> {--LANG_NO_RENDER_DIRECT--}');
break;
} // END - switch
- } elseif ((getPhpCaching() == 'on') && (isset($GLOBALS['footer_sent'])) && ($GLOBALS['footer_sent'] == 1)) {
- // Headers already sent?
- if (headers_sent()) {
- // Log this error
- logDebugMessage(__FUNCTION__, __LINE__, 'Headers already sent! We need debug backtrace here.');
-
- // Trigger an user error
- debug_report_bug('Headers are already sent!');
- } // END - if
-
+ } elseif (getPhpCaching() == 'on') {
// Output cached HTML code
$GLOBALS['output'] = ob_get_contents();
sendHeader('HTTP/1.1 200');
// General headers for no caching
- sendHeader('Expired: ' . $now); // RFC2616 - Section 14.21
+ sendHeader('Expires: ' . $now); // RFC2616 - Section 14.21
sendHeader('Last-Modified: ' . $now);
sendHeader('Cache-Control: no-store, no-cache, must-revalidate, pre-check=0, post-check=0, max-age=0'); // HTTP/1.1
sendHeader('Pragma: no-cache'); // HTTP/1.0
$cnt++;
} // END - while
+ // Compress it?
+ if (!empty($_SERVER['HTTP_ACCEPT_ENCODING']) && (strpos('gzip', $_SERVER['HTTP_ACCEPT_ENCODING']) !== null)) {
+ // Compress it
+ $GLOBALS['output'] = gzencode($GLOBALS['output'], 9, true);
+
+ // Add header
+ sendHeader('Content-Encoding: gzip');
+ } // END - if
+
// Add final length
sendHeader('Content-Length: ' . strlen($GLOBALS['output']));
+
+ // Flush all headers
+ flushHeaders();
}
// Output the raw HTML code
$rel = '';
} // END - if
- // Get output buffer
- $GLOBALS['output'] = ob_get_contents();
-
- // Clear it only if there is content
- if (!empty($GLOBALS['output'])) {
- clearOutputBuffer();
- } // END - if
-
// Three different ways to debug...
//* DEBUG: */ debug_report_bug(sprintf("%s[%s:] URL=%s", __FUNCTION__, __LINE__, $URL));
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'URL=' . $URL);
// Add it to URL
if (session_id() != '') {
+ die($url);
$url .= $seperator . session_name() . '=' . session_id();
} // END - if
} // END - if
// Simple check for spider
function isSpider () {
+ // Get the UA
+ $userAgent = strtolower(detectUserAgent(true));
+
// It should not be empty, if so it is better a spider/bot
- if (detectUserAgent(true) == '') return true;
+ if (empty($userAgent)) return true;
// Is it a spider?
- return ((strpos('spider', strtolower(detectUserAgent(true))) !== false) || (strpos('bot', strtolower(detectUserAgent(true))) !== false));
+ return ((strpos($userAgent, 'spider') !== false) || (strpos($userAgent, 'slurp') !== false) || (strpos($userAgent, 'bot') !== false));
}
//////////////////////////////////////////////////
// Set content type
setContentType('text/html');
-// Header
-loadIncludeOnce('inc/header.php');
-
// Fix missing array elements here
if (!isConfigEntrySet('index_delay')) setConfigEntry('index_delay' , 0);
if (!isConfigEntrySet('index_cookie')) setConfigEntry('index_cookie', 0);
// Check for cookies
if ((isSessionVariableSet('visited')) || (getConfig('index_delay') > -1)) {
+ // Header
+ loadIncludeOnce('inc/header.php');
+
// Is the index page configured for redirect pr not?
if (getConfig('index_cookie') > 0) {
// Set cookie and remeber it for specified time
// Load template
loadTemplate('index_forward', false, $content);
} // END - if
+
+ // Footer
+ loadIncludeOnce('inc/footer.php');
} else {
// Redirect to main page
redirectToUrl('modules.php?module=index');
}
-// Footer
-loadIncludeOnce('inc/footer.php');
-
// [EOF]
?>