// $base_url = "http://jennysmusicgallery.herokuapp.com/"; $base_url = ""; include "bands.php"; if ($id >= count($bands)) { header('Location: ' . $base_url . 'notfound'); } ?> <!DOCTYPE html> <html> <?php include "functions.php"; $band = $bands[$id]; $artist_id = getArtistId($band); $json_file = decodeJSON($artist_id); $favicon = getArtistFavicon($json_file); ?> <head> <meta charset="UTF-8"> <title><?php echo $band . " // Jenny's Music Gallery"; ?> </title> <link rel="stylesheet" href="<?php echo $base_url; ?> style.css" type="text/css"> <link href='http://fonts.googleapis.com/css?family=Lato:100,300,400,100italic,300italic' rel='stylesheet' type='text/css'> <link href='http://fonts.googleapis.com/css?family=Montserrat:400,700' rel='stylesheet' type='text/css'>
function find_config($a, $replace) { // Given a list of possible locations, find and parse the config file. global $debug_common; foreach ($a as $filename) { if (file_exists($filename)) { if ($debug_common) { print "Found {$filename}, parsing..<br>\n"; } $js = file_get_contents($filename); if ($js) { $ret = decodeJSON($js, $replace); if ($ret) { return $ret; } print "could not parse {$filename}"; exit(1); } } } print "Could not find (or possibly open due to safe mode) any of: "; foreach ($a as $filename) { print "{$filename} "; } exit(1); }
$s->bind_result($result); $s->fetch(); $s->close(); return $result; } // try to find the IP address in the database $C_ID = getSQLID($conn, "select C_ID from ClientIP where C_SID=? LIMIT 1", $data["ipaddr"]); if ($C_ID == 0) { // this IP is not in the database. Look up the IP // information and then add $host = gethostbyaddr($data["ipaddr"]); $loc = file_get_contents("http://freegeoip.net/json/" . $data["ipaddr"]); $country = "unknown"; $region = "unknown"; $city = "unknown"; $loc = decodeJSON($loc); if (!empty($loc["country_name"])) { $country = $loc["country_name"]; } if (!empty($loc["region_name"])) { $region = $loc["region_name"]; } if (!empty($loc["city"])) { $city = $loc["city"]; } // now make sure that all of the information is the right length $ipaddr = trimString($data["ipaddr"], 45); $country = trimString($country, 255); $region = trimString($region, 255); $city = trimString($city, 255); $domain = trimString(getDomain($host), 255);