summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2013-03-20 20:33:46 +0400
committerAndrew Dolgov <[email protected]>2013-03-20 20:33:46 +0400
commitb5d4716a52aab283e1d3e0527d036134c5787095 (patch)
treeb0215ff969e40204ea661000d7f89914335eae89 /include
parent47e909d1cfc1199a068732137bbb2d1d31a400ed (diff)
optimize loading of external libraries a bit
fix bold text in Unread articles
Diffstat (limited to 'include')
-rw-r--r--include/functions.php21
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";
+ }
+
?>