コード例 #1
0
ファイル: details.php プロジェクト: dieterdreist/OpenLinkMap
<?php

/*
OpenLinkMap Copyright (C) 2010 Alexander Matheisen
This program comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to redistribute it under certain conditions.
See http://wiki.openstreetmap.org/wiki/OpenLinkMap for details.
*/
require_once "functions.php";
// include translation file
includeLocale($_GET['lang']);
$format = $_GET['format'];
$id = $_GET['id'];
$type = $_GET['type'];
// offset of user's timezone to UTC
$offset = offset($_GET['offset']);
$callback = $_GET['callback'];
date_default_timezone_set('UTC');
// protection of sql injections
if (!isValidType($type) || !isValidId($id)) {
    echo "NULL";
    exit;
}
// get the most important langs of the user
$langs = getLangs();
if ($_GET['lang']) {
    $langs[0] = $_GET['lang'];
}
if (!getDetails($db, $id, $type, $langs, $offset)) {
    echo "NULL";
}
コード例 #2
0
ファイル: index.php プロジェクト: rurseekatze/OpenRailwayMap
<?php

/*
OpenRailwayMap Copyright (C) 2012 Alexander Matheisen
This program comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to redistribute it under certain conditions.
See http://wiki.openstreetmap.org/wiki/OpenRailwayMap for details.
*/
require_once "api/functions.php";
if (isset($_GET['lang']) && array_key_exists($_GET['lang'], $langs)) {
    $lang = $_GET['lang'];
} else {
    $lang = getUserLang();
}
includeLocale($lang);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php 
echo $lang;
?>
" lang="<?php 
echo $lang;
?>
">
	<head>
		<title>OpenRailwayMap</title>
		<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
		<meta http-equiv="content-language" content="<?php 
echo $lang;
?>
" />