Ad script / images / css versionning to allow aggressive cache
This commit is contained in:
parent
6fa0031b9f
commit
a8f888a13b
8
base.php
8
base.php
|
@ -6,6 +6,8 @@
|
|||
* @author Sébastien Lucas <sebastien@slucas.fr>
|
||||
*/
|
||||
|
||||
define ("VERSION", "0.0.4");
|
||||
|
||||
function getURLParam ($name, $default = NULL) {
|
||||
if (!empty ($_GET) && isset($_GET[$name])) {
|
||||
return $_GET[$name];
|
||||
|
@ -13,6 +15,10 @@ function getURLParam ($name, $default = NULL) {
|
|||
return $default;
|
||||
}
|
||||
|
||||
function getUrlWithVersion ($url) {
|
||||
return $url . "?v=" . VERSION;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method is a direct copy-paste from
|
||||
* http://tmont.com/blargh/2010/1/string-format-in-php
|
||||
|
@ -138,7 +144,7 @@ class Entry
|
|||
foreach (self::$icons as $reg => $image)
|
||||
{
|
||||
if (preg_match ("/" . $reg . "/", $pid)) {
|
||||
array_push ($this->linkArray, new Link ($image, "image/png", Link::OPDS_THUMBNAIL_TYPE));
|
||||
array_push ($this->linkArray, new Link (getUrlWithVersion ($image), "image/png", Link::OPDS_THUMBNAIL_TYPE));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -32,7 +32,7 @@
|
|||
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.min.js"></script>
|
||||
<script type="text/javascript" src="fancybox/jquery.fancybox.js?v=2.0.6"></script>
|
||||
<link rel="stylesheet" type="text/css" href="fancybox/jquery.fancybox.css?v=2.0.6" media="screen" />
|
||||
<link rel="stylesheet" type="text/css" href="style.css" media="screen" />
|
||||
<link rel="stylesheet" type="text/css" href="<?php echo getUrlWithVersion("style.css") ?>" media="screen" />
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
// Handler for .ready() called.
|
||||
|
@ -70,11 +70,11 @@
|
|||
<div class="head">
|
||||
<div class="headleft">
|
||||
<a href="<?php echo $_SERVER["SCRIPT_NAME"] ?>">
|
||||
<img src="images/home.png" alt="Home" />
|
||||
<img src="<?php echo getUrlWithVersion("images/home.png") ?>" alt="Home" />
|
||||
</a>
|
||||
</div>
|
||||
<div class="headright">
|
||||
<a class="fancysearch" href="#search"><img src="images/search.png" alt="Search" /></a>
|
||||
<a class="fancysearch" href="#search"><img src="<?php echo getUrlWithVersion("images/search.png") ?>" alt="Search" /></a>
|
||||
</div>
|
||||
<div class="headcenter">
|
||||
<p><?php echo $currentPage->title ?></p>
|
||||
|
|
Loading…
Reference in a new issue