cvs: pres2 / css.php getwidth.php show.php sniff.php

From: Date: Thu, 24 Apr 2003 13:22:08 +0000
Subject: cvs: pres2 / css.php getwidth.php show.php sniff.php
Groups: php.pres 
Request: Send a blank email to pres+get-647@lists.php.net to get a copy of this message
wez Thu Apr 24 09:22:08 2003 EDT Added files: /pres2 sniff.php Modified files: /pres2 css.php getwidth.php show.php Log: Some tweaks for better IE compatibility Index: pres2/css.php diff -u pres2/css.php:1.11 pres2/css.php:1.12 --- pres2/css.php:1.11 Sun Dec 15 13:38:51 2002 +++ pres2/css.php Thu Apr 24 09:22:08 2003 @@ -1,7 +1,11 @@ +<?php +require_once 'sniff.php'; +?> <style title="Default" type="text/css"> body { font-size: <?php echo $pres[1]->basefontsize; ?>; - margin-left:1.5em; + margin-top:0em; + margin-left:0em; margin-right:0em; margin-bottom:0em; <?php @@ -14,7 +18,7 @@ } div.sticky { margin: 0; -<?if(strstr($_SERVER['HTTP_USER_AGENT'],'MSIE')): // Need a much smarter check here ?> +<?php if(!$css_supports_fixed): // Need a much smarter check here ?> position: absolute; <?else:?> position: fixed; @@ -27,7 +31,7 @@ } div.bsticky { margin: 0; -<?if(strstr($_SERVER['HTTP_USER_AGENT'],'MSIE')): // Need a much smarter check here ?> +<?php if(!$css_supports_fixed): // Need a much smarter check here ?> position: absolute; <?else:?> position: fixed; Index: pres2/getwidth.php diff -u pres2/getwidth.php:1.2 pres2/getwidth.php:1.3 --- pres2/getwidth.php:1.2 Mon Aug 5 23:18:51 2002 +++ pres2/getwidth.php Thu Apr 24 09:22:08 2003 @@ -6,7 +6,7 @@ function is called if we don't have the dimensions already, or on a resize event to fetch the new window dimensions. */?> -<script language="JavaScript1.2"> +<script language="JavaScript1.2" defer="defer"> <!-- function get_dims() { var winW = 1024; Index: pres2/show.php diff -u pres2/show.php:1.45 pres2/show.php:1.46 --- pres2/show.php:1.45 Tue Mar 18 21:50:26 2003 +++ pres2/show.php Thu Apr 24 09:22:08 2003 @@ -2,6 +2,7 @@ error_reporting(E_ALL); require_once 'config.php'; + require_once 'sniff.php'; set_time_limit(0); // PDF generation can take a while if(!strlen($_SERVER['PATH_INFO'])) { @@ -108,7 +109,7 @@ $body_style = "margin-top: 5em;"; break; default: - $body_style = "margin-top: 8em;"; + $body_style = "margin-top: " . ($browser_is_IE ? "0px" : "8em") . ";"; break; } include 'getwidth.php'; Index: pres2/sniff.php +++ pres2/sniff.php <?php /* Code for sniffing out a reasonable IE browser implementation */ $browser_is_IE = false !== strstr($_SERVER['HTTP_USER_AGENT'], 'MSIE'); $css_supports_fixed = !$browser_is_IE; if ($browser_is_IE) { /* IE 6 seems to handle fixed positioning OK */ preg_match('/MSIE (\d+)\.(\d+)/', $_SERVER['HTTP_USER_AGENT'], $matches); if ((int)$matches[1] >= 6) { $css_supports_fixed = true; } } ?>

« previous php.pres (#647) next »