Gallery of Finds - 2012+
Pre 2012 | Back to Blog
|
03/15/13) go here
{
// pics more than 4 days older than post date are ignored,
// as they are presumed to be attached to their original
// older post
if (strcmp($postdate, "none"))
{
$pic_day_test = "20" . $y . "-" . $m . "-" . $d;
$pic_day = strtotime($pic_day_test);
$post_day = strtotime($postdate);
$diff = $post_day - $pic_day;
if ($diff >= (4*86400 + 1))
return;
}
// pics with one letter suffix > 'j' are ignored
if ($a > 'j')
return;
}
if (!handle_dup($pic))
return;
$alt = $m . "-" . $d . "-" . $y;
$storylink = "http://www.mapsurfer.com/blog/archives/" . $id;
$title .= " ($alt)";
$filename_template = "/uploads/20%s/%s/%s%s.jpg";
$filename_http_root = "http://www.mapsurfer.com/blog/wp-content";
$filename_base = sprintf($filename_template, $y, $m, $pic, "");
$filename_base_thumb = sprintf($filename_template, $y, $m, $pic, "-t");
$filename_local = ".." . $filename_base;
$filename_thumb_local = ".." . $filename_base_thumb;
$filename_http = $filename_http_root . $filename_base;
$filename_thumb_http = $filename_http_root . $filename_base_thumb;
if (!file_exists($filename_local))
return;
try
{
if (file_exists($filename_thumb_local))
{
$thumb = new Imagick($filename_thumb_local);
}
else
{
$thumb = new Imagick($filename_local);
$thumb->resizeImage(150, 150, Imagick::FILTER_LANCZOS, 1, TRUE);
$thumb->writeImage($filename_thumb_local);
}
$width = $thumb->getImageWidth();
$height = $thumb->getImageHeight();
$thumb->destroy();
}
catch (Exception $e)
{
return;
}
// $title |
echo <<
$title
|
EOT;
}
function handle_legacy($pic, $title)
{
$legacy = "||031513|030413a|031013|022713b|022813|022713|022613c|022613a|022513|021513|021313g|021313f|021313e|021313a|013113|013013|011813|122712|120812c|120812b|120812a|120312|112712a|112112|112112c|111612b|111612|110812b|110812|102412b|102412|101812|093012b|090612|082012|081712|072712d|072412a|072112|072112c|061512|053012c|050712a|050612a|050312|031812|013112a|";
$pic_test = "|" . $pic . "|";
if (strpos($legacy, $pic_test))
return FALSE;
if (!strcmp($pic, "110812a") && !strcmp($title, "Woods Hunt"))
return FALSE;
if (!strcmp($pic, "013112") && !strcmp($title, "Double Digit Day Baby!"))
return FALSE;
return TRUE;
}
function handle_dup($pic)
{
static $dup;
if ($dup[$pic])
return FALSE;
$dup[$pic] = 1;
return TRUE;
}
?>
|