Ejemplo n.º 1
0
Archivo: online.php Proyecto: OvBB/v1.0
    $aUsers[$iUserID][LOCATION] = GetLocation($strLastLocation, $aRequest);
    $aUsers[$iUserID][LASTACTIVE] = $aSQLResult['lastactive'];
    if ($_SESSION['permissions']['cviewips'] && $CFG['iplogging']) {
        $aUsers[$iUserID][IPADDRESS] = gethostbyaddr(long2ip($aSQLResult['ipaddress']));
    } else {
        $aUsers[$iUserID][IPADDRESS] = NULL;
    }
}
// Get the online guests.
$dbConn->query("SELECT lastactive, lastlocation, lastrequest, ipaddress FROM guest WHERE (lastactive + 300) >= {$CFG['globaltime']} ORDER BY lastactive DESC");
for ($iIndex = 0; $aSQLResult = $dbConn->getresult(TRUE); $iIndex++) {
    // Get the data.
    $strLastLocation = $aSQLResult['lastlocation'];
    $aRequest = unserialize($aSQLResult['lastrequest']);
    // Store the user's information.
    $aGuests[$iIndex][LOCATION] = GetLocation($strLastLocation, $aRequest);
    $aGuests[$iIndex][LASTACTIVE] = $aSQLResult['lastactive'];
    if ($_SESSION['permissions']['cviewips'] && $CFG['iplogging']) {
        $aGuests[$iIndex][IPADDRESS] = gethostbyaddr(long2ip($aSQLResult['ipaddress']));
    } else {
        $aGuests[$iIndex][IPADDRESS] = NULL;
    }
}
// Free memory.
unset($aSQLResult);
unset($aLocations);
unset($aRequest);
// Get the information of each forum.
list($aCategory, $aForum) = GetForumInfo();
// Template
require "./skins/{$CFG['skin']}/online.tpl.php";
Ejemplo n.º 2
0
function GetUserInput()
{
    if (!empty($_POST["submit"])) {
        $street = $_POST["street"];
        $city = $_POST["city"];
        $state = $_POST["state"];
        $degree = $_POST["degree"];
        echo "<script type='text/javascript'>\n SaveUserInput('" . $street . "','" . $city . "','" . $state . "','" . $degree . "');\n </script>";
        if (!empty($street) && !empty($city) && !empty($state) && !empty($degree)) {
            $GeoCodeFile = simplexml_load_file("http://maps.google.com/maps/api/geocode/xml?address=" . $street . "," . $city . "," . $state);
            $Location = GetLocation($GeoCodeFile);
            $CallAPI = "https://api.forecast.io/forecast/7d75118b73458c705f9b911f7d637507/" . $Location[0] . "," . $Location[1] . "?units=" . $degree . "&exclude=flags";
            echo $CallAPI;
            GetJSON($CallAPI, $degree);
        }
    }
}