diff options
author | Andrew Dolgov <[email protected]> | 2013-03-20 20:33:46 +0400 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2013-03-20 20:33:46 +0400 |
commit | b5d4716a52aab283e1d3e0527d036134c5787095 (patch) | |
tree | b0215ff969e40204ea661000d7f89914335eae89 /include/functions.php | |
parent | 47e909d1cfc1199a068732137bbb2d1d31a400ed (diff) |
optimize loading of external libraries a bit
fix bold text in Unread articles
Diffstat (limited to 'include/functions.php')
-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"; + } + ?> |