Revision: 1400
http://mrbs.svn.sourceforge.net/mrbs/?rev=1400&view=rev
Author: jberanek
Date: 2010-07-28 12:36:05 +0000 (Wed, 28 Jul 2010)
Log Message:
-----------
* Added 30 minute expiry to generated CSS files.
Modified Paths:
--------------
mrbs/trunk/web/functions.inc
mrbs/trunk/web/mrbs-ielte7.css.php
mrbs/trunk/web/mrbs-js-overrides.css.php
mrbs/trunk/web/mrbs-print.css.php
mrbs/trunk/web/mrbs.css.php
Modified: mrbs/trunk/web/functions.inc
===================================================================
--- mrbs/trunk/web/functions.inc 2010-07-27 21:07:46 UTC (rev 1399)
+++ mrbs/trunk/web/functions.inc 2010-07-28 12:36:05 UTC (rev 1400)
@@ -109,6 +109,23 @@
}
+// Format a timestamp in RFC 1123 format, for HTTP headers
+//
+// e.g. Wed, 28 Jul 2010 12:43:58 GMT
+function rfc1123_date($timestamp)
+{
+ return gmdate("D, d M Y G:i:s \\G\\M\\T",$timestamp);
+}
+
+
+// A little helper function to send an "Expires" header. Just one
+// parameter, the number of seconds in the future to set the expiry
+function expires_header($seconds)
+{
+ header("Expires: ".rfc1123_date(time()+$seconds));
+}
+
+
function toTimeString(&$dur, &$units, $translate=TRUE)
{
if (abs($dur) >= 60)
Modified: mrbs/trunk/web/mrbs-ielte7.css.php
===================================================================
--- mrbs/trunk/web/mrbs-ielte7.css.php 2010-07-27 21:07:46 UTC (rev 1399)
+++ mrbs/trunk/web/mrbs-ielte7.css.php 2010-07-28 12:36:05 UTC (rev 1400)
@@ -2,12 +2,14 @@
// $Id$
-header("Content-type: text/css");
-
require_once "systemdefaults.inc.php";
require_once "config.inc.php";
+require_once "functions.inc";
require_once "theme.inc";
+header("Content-type: text/css");
+expires_header(60*30); // 30 minute expiry
+
?>
/* Fixes for Internet Explorer 7 and less */
Modified: mrbs/trunk/web/mrbs-js-overrides.css.php
===================================================================
--- mrbs/trunk/web/mrbs-js-overrides.css.php 2010-07-27 21:07:46 UTC (rev
1399)
+++ mrbs/trunk/web/mrbs-js-overrides.css.php 2010-07-28 12:36:05 UTC (rev
1400)
@@ -1,11 +1,17 @@
<?php
-require_once "theme.inc";
-header("Content-type: text/css");
// $Id$
// Only used if JavaScript is enabled
+require_once "systemdefaults.inc.php";
+require_once "config.inc.php";
+require_once "functions.inc";
+require_once "theme.inc";
+
+header("Content-type: text/css");
+expires_header(60*30); // 30 minute expiry
+
?>
<?php
Modified: mrbs/trunk/web/mrbs-print.css.php
===================================================================
--- mrbs/trunk/web/mrbs-print.css.php 2010-07-27 21:07:46 UTC (rev 1399)
+++ mrbs/trunk/web/mrbs-print.css.php 2010-07-28 12:36:05 UTC (rev 1400)
@@ -2,9 +2,14 @@
// $Id$
-header("Content-type: text/css");
+require_once "systemdefaults.inc.php";
+require_once "config.inc.php";
+require_once "functions.inc";
require_once "theme.inc";
+header("Content-type: text/css");
+expires_header(60*30); // 30 minute expiry
+
?>
div.screenonly { display: none; }
Modified: mrbs/trunk/web/mrbs.css.php
===================================================================
--- mrbs/trunk/web/mrbs.css.php 2010-07-27 21:07:46 UTC (rev 1399)
+++ mrbs/trunk/web/mrbs.css.php 2010-07-28 12:36:05 UTC (rev 1400)
@@ -2,12 +2,13 @@
// $Id$
-header("Content-type: text/css");
-
require_once "systemdefaults.inc.php";
require_once "config.inc.php";
+require_once "functions.inc";
require_once "theme.inc";
+header("Content-type: text/css");
+expires_header(60*30); // 30 minute expiry
// IMPORTANT
*************************************************************************************************
// In order to avoid problems in locales where the decimal point is
represented as a comma, it is important to
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share
of $1 Million in cash or HP Products. Visit us here for more details:
http://ad.doubleclick.net/clk;226879339;13503038;l?
http://clk.atdmt.com/CRS/go/247765532/direct/01/
_______________________________________________
Mrbs-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mrbs-commits