diff options
author | MaZderMind | 2014-10-01 10:33:00 +0200 |
---|---|---|
committer | MaZderMind | 2014-10-01 10:33:00 +0200 |
commit | bf4c140f5438101d87dcb0395c7c778585b7fe09 (patch) | |
tree | 6ebaf53ec3205222ca00796f9d880f719b2bb54a /lib/helper.php |
31c3 php player site
Diffstat (limited to 'lib/helper.php')
-rw-r--r-- | lib/helper.php | 28 |
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; +} |