diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/functions.php | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/include/functions.php b/include/functions.php index 66054c23b..d9a3a5963 100644 --- a/include/functions.php +++ b/include/functions.php @@ -4070,4 +4070,25 @@ return $rv; } + function stylesheet_tag($filename) { + $timestamp = filemtime($filename); + + echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"$filename?$timestamp\"/>\n"; + } + + function javascript_tag($filename) { + $query = ""; + + if (!(strpos($filename, "?") === FALSE)) { + $query = substr($filename, strpos($filename, "?")+1); + $filename = substr($filename, 0, strpos($filename, "?")); + } + + $timestamp = filemtime($filename); + + if ($query) $timestamp .= "&$query"; + + echo "<script type=\"text/javascript\" charset=\"utf-8\" src=\"$filename?$timestamp\"></script>\n"; + } + ?> |