Ejemplo n.º 1
0
array_pop($parts);
$parentpath = implode('/', $parts);
define('TTPDS_URL', $_SERVER['HTTP_HOST'] . $parentpath);
// script url
define('TTPDS_DIR', $_SERVER['DOCUMENT_ROOT'] . $parentpath);
// script directory
include TTPDS_DIR . '/config.php';
include TTPDS_DIR . '/inc/lang.php';
include TTPDS_DIR . '/inc/files.php';
include TTPDS_DIR . '/inc/browserargs.php';
// Parsing arguments manually as $_GET is not working due to htaccess redirect
$uri_parts = explode('?', $_SERVER['REQUEST_URI'], 2);
$page_redirected_from = 'http://' . TTPDS_URL . substr($uri_parts[0], strlen($parentpath));
parse_str(isset($uri_parts[1]) ? $uri_parts[1] : "", $output_get);
$acc = filter_url(getargfrom('acc', $output_get));
$lang = filter_url(getargfrom('lang', $output_get));
asort($TTPDS_langs);
if ($lang == "" || !in_array($lang, $TTPDS_langs)) {
    $lang = prefered_language($TTPDS_langs);
}
switch ($lang) {
    case 'de':
        include TTPDS_DIR . '/lang/de.php';
        break;
    case 'en':
        include TTPDS_DIR . '/lang/en.php';
        break;
    default:
        // 'en'
        include TTPDS_DIR . '/lang/en.php';
        $lang = 'en';
Ejemplo n.º 2
0
function getarg($argkey)
{
    return getargfrom($argkey, filter_url($_GET));
}