function install_msie_buffer_fix() { if (browser_check(BROWSER_MSIE)) { echo str_repeat("<!-- bh_install_buffer //-->\n", 20); } }
function html_frame($src, $name, $frameborder = 0, $scrolling = '', $noresize = '') { $this->src = $src; $this->name = $name; if (in_array($scrolling, array('yes', 'no', ''))) { $this->scrolling = $scrolling; } if (in_array($noresize, array('noresize', ''))) { $this->noresize = $noresize; } if (browser_check(BROWSER_WEBKIT)) { $this->frameborder = 1; } else { $this->frameborder = is_numeric($frameborder) ? $frameborder : 0; } if (browser_check(BROWSER_MSIE)) { $this->allowtransparency = "allowtransparency=\"true\" "; } }
function cache_check_etag($local_etag) { if (browser_check(BROWSER_AOL)) { return false; } if (headers_sent()) { return false; } $local_last_modified = gmdate("D, d M Y H:i:s", time()) . "GMT"; if (isset($_SERVER['HTTP_IF_NONE_MATCH']) && strlen(trim($_SERVER['HTTP_IF_NONE_MATCH'])) > 0) { $remote_etag = mb_substr($_SERVER['HTTP_IF_NONE_MATCH'], 1, -1); } else { $remote_etag = false; } if (isset($_SERVER['HTTP_IF_MODIFIED_SINCE']) && strlen(trim($_SERVER['HTTP_IF_MODIFIED_SINCE'])) > 0) { $remote_last_modified = $_SERVER['HTTP_IF_MODIFIED_SINCE']; } else { $remote_last_modified = false; } $local_last_modified = gmdate("D, d M Y H:i:s", time()) . "GMT"; if (strcmp($remote_etag, $local_etag) == 0) { header("Etag: \"{$remote_etag}\"", true); header("Expires: {$local_last_modified}", true); header("Last-Modified: {$remote_last_modified}", true); header('Cache-Control: private, must-revalidate', true); header_status(304, 'Not Modified'); exit; } header("Etag: \"{$local_etag}\"", true); header("Expires: {$local_last_modified}", true); header("Last-Modified: {$local_last_modified}", true); header('Cache-Control: private, must-revalidate', true); return true; }
function html_frame($src, $name, $frameborder = 0, $scrolling = '', $noresize = '') { $this->src = $src; $this->name = $name; if (in_array($scrolling, array('yes', 'no'))) { $this->scrolling = sprintf(' scrolling="%s"', htmlentities_array($scrolling)); } if (in_array($noresize, array('noresize'))) { $this->noresize = sprintf(' noresize="%s"', htmlentities_array($noresize)); } if (browser_check(BROWSER_WEBKIT)) { $this->frameborder = 1; } else { $this->frameborder = is_numeric($frameborder) ? $frameborder : 0; } if (browser_check(BROWSER_MSIE)) { $this->allowtransparency = ' allowtransparency="true"'; } }
function cache_check_last_modified($last_modified, $etag, $expires = null) { if (isset($_SERVER['REQUEST_METHOD']) && $_SERVER['REQUEST_METHOD'] == 'POST') { return false; } if (browser_check(BROWSER_AOL)) { return false; } if (headers_sent()) { return false; } $cache_expires = gmdate("D, d M Y H:i:s", is_numeric($expires) ? $expires : $last_modified) . " GMT"; $last_modified = gmdate("D, d M Y H:i:s", $last_modified) . " GMT"; $remote_last_modified = isset($_SERVER['HTTP_IF_MODIFIED_SINCE']) ? $_SERVER['HTTP_IF_MODIFIED_SINCE'] : null; if (isset($_SERVER['HTTP_IF_NONE_MATCH']) && preg_match('/^W\\/"([^"]+)"/', $_SERVER['HTTP_IF_NONE_MATCH'], $matches_array)) { $remote_etag = isset($matches_array[1]) ? $matches_array[1] : false; } else { $remote_etag = false; } if ($remote_etag == $etag && $remote_last_modified == $last_modified) { header("Etag: W/\"{$remote_etag}\"", true); header("Expires: {$cache_expires}", true); header("Last-Modified: {$remote_last_modified}", true); header('Cache-Control: private, must-revalidate', true); header_status(304, 'Not Modified'); exit; } header("Etag: W/\"{$etag}\"", true); header("Expires: {$cache_expires}", true); header("Last-Modified: {$last_modified}", true); header('Cache-Control: private, must-revalidate', true); return true; }