コード例 #1
0
<?php

/*
* @author     Flip
* @package    FreifunkInstaller
* @version    1.0

provides access to the json data
*/
function getCommunityJSON($community)
{
    $json = null;
    switch ($community) {
        case 'Stuttgart':
            $json = 'http://gw01.freifunk-stuttgart.de/gluon/firmwares_s.json';
            break;
        default:
            break;
    }
    return $json == null ? null : file_get_contents($json);
}
if (isset($_GET['echo']) && $_GET['echo'] == 'true') {
    header('Content-type: application/json');
    // Always talk JSON
    header('Cache-Control: no-cache, must-revalidate');
    header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
    echo getCommunityJSON($_GET['community']);
}
コード例 #2
0
<?php

if (empty($_GET["community"])) {
    die("Community error");
}
require_once 'json/getjson.php';
$json = getCommunityJSON($_GET["community"]);
if (isset($json)) {
    $community = json_decode($json, true);
} else {
    die("Community error");
}
?>

<!DOCTYPE html>
<!--[if lt IE 7]> <html class="lt-ie9 lt-ie8 lt-ie7" lang="en"> <![endif]-->
<!--[if IE 7]>    <html class="lt-ie9 lt-ie8" lang="en"> <![endif]-->
<!--[if IE 8]>    <html class="lt-ie9" lang="en"> <![endif]-->
<!--[if gt IE 8]><!--><html lang="en"><!--<![endif]-->


<div class="modal-content">
<div class="close-modal" data-dismiss="modal">
    <div class="lr">
        <div class="rl">
        </div>
    </div>
</div>

<html>
<head>