aboutsummaryrefslogtreecommitdiff
path: root/lib/helper.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/helper.php')
-rw-r--r--lib/helper.php28
1 files changed, 28 insertions, 0 deletions
diff --git a/lib/helper.php b/lib/helper.php
new file mode 100644
index 0000000..3e5e8a6
--- /dev/null
+++ b/lib/helper.php
@@ -0,0 +1,28 @@
+<?php
+
+function link_index()
+{
+ return '';
+}
+
+function link_room($room)
+{
+ return rawurlencode($room).'/';
+}
+
+function link_player($room, $format, $translated = false)
+{
+ return rawurlencode($room).'/'.rawurlencode($format).($translated ? '/translated' : '');
+}
+
+function baseurl()
+{
+ if(isset($GLOBALS['CONFIG']['baseurl']))
+ return $GLOBALS['CONFIG']['baseurl'];
+
+ $base = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS']) ? 'https://' : 'http://';
+ $base .= $_SERVER['HTTP_HOST'];
+ $base .= dirname($_SERVER['SCRIPT_NAME']).'/';
+
+ return $base;
+}