ERROR
Not an image.
";
}
}
}
function isImage($url)
{
$params = array('http' => array(
'method' => 'HEAD'
));
$ctx = stream_context_create($params);
$fp = @fopen($url, 'rb', false, $ctx);
if (!$fp)
return false; // Problem with url
$meta = stream_get_meta_data($fp);
if ($meta === false)
{
fclose($fp);
return false; // Problem reading data from url
}
$wrapper_data = $meta["wrapper_data"];
if(is_array($wrapper_data)){
foreach(array_keys($wrapper_data) as $hh){
if (substr($wrapper_data[$hh], 0, 19) == "Content-Type: image") // strlen("Content-Type: image") == 19
{
fclose($fp);
return true;
}
}
}
fclose($fp);
return false;
}
function games_reorder($games,$orderby="last_played_desc") {
function totaltime_asc($a,$b) {
return ($a["game_total_time"] <= $b["game_total_time"]) ? -1 : 1;
}
function totaltime_desc($a,$b) {
return ($a["game_total_time"] >= $b["game_total_time"]) ? -1 : 1;
}
function firstplayed_asc($a,$b) {
return ($a["game_played_first"] <= $b["game_played_first"]) ? -1 : 1;
}
function firstplayed_desc($a,$b) {
return ($a["game_played_first"] >= $b["game_played_first"]) ? -1 : 1;
}
function lastplayed_asc($a,$b) {
if ($a["game_played_last"] == -1) { $a["game_played_last"] = (round(microtime(true) * 1000)); }
if ($b["game_played_last"] == -1) { $b["game_played_last"] = (round(microtime(true) * 1000)); }
return ($a["game_played_last"] <= $b["game_played_last"]) ? -1 : 1;
}
function lastplayed_desc($a,$b) {
if ($a["game_played_last"] == -1) { $a["game_played_last"] = (round(microtime(true) * 1000)); }
if ($b["game_played_last"] == -1) { $b["game_played_last"] = (round(microtime(true) * 1000)); }
return ($a["game_played_last"] >= $b["game_played_last"]) ? -1 : 1;
}
usort($games, $orderby);
return $games;
}
}
?>