implemented buildURL() function (and fixed redirecting on https page)

added comments block (file description) in each PHP file
This commit is contained in:
2015-02-15 14:33:02 +01:00
parent 79034dd314
commit a542813c8f
21 changed files with 234 additions and 130 deletions

View File

@@ -1,5 +1,23 @@
<?php
function buildURL($URI, $https = false)
{
$url = 'http';
if ($https && USE_HTTPS)
$url .= 's';
$url .= '://'.FORUM_DOMAIN;
if ($https && USE_HTTPS && HTTPS_PORT != 443)
$url .= ':'.HTTPS_PORT;
if ((!$https || !USE_HTTPS) && HTTP_PORT != 80)
$url .= ':'.HTTP_PORT;
if (strpos($URI, FORUM_PATH) === 0)
$url .= $URI;
else
$url .= FORUM_PATH.'/'.$URI;
return $url;
}
?>