/** * static boolean inBakeout() * Arguments: * String $test_date: the date for finding out if bakeout is on * Return: * A bool stating whether bakeout is on */ public static function inBakeout($test_date) { if (file_exists("./common_files/bakeout_dates.txt")) { $lines = file("./common_files/bakeout_dates.txt"); foreach ($lines as $line) { $start = substr($line, 0, 8); $end = substr($line, -9, 8); if ($test_date >= $start && $test_date <= $end) { return true; } } return false; } else { return false; } return SMImage::inKeyhole($test_date); }
<?php include "globals.php"; include "include.php"; include "image.class.php"; $json = array("imageSources" => array()); $types = SMImage::getAvailableImageTypes($date); for ($i = 0; $i < count($types); $i++) { $obj = new SMImage($types[$i], $date); if ($obj->requiresSubstitute()) { $obj = $obj->getSubstitute(); if ($obj == false) { continue; } } $file = $obj->getLatestFilename(); $json["imageSources"][] = array("time" => $obj->getTimestampForFilename($file), "type" => $obj->type, "name" => $obj->getName(), "image" => $obj->getThumbnail(), "fullRes" => $file); } print json_encode($json);