aboutsummaryrefslogtreecommitdiff
path: root/lib/helper.php
blob: 3e5e8a6c2bb562177507fefa0f30523396a36643 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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;
}