Weather & Pictures


Please use http://lmac.ca/weather/

London Model Aircraft Club


Radar
Radar

[insert_php]
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Display the most recent images uploaded to a web site directory
// Once displayed the images can be kept or deleted
// Images can be skipped
// Code based on http://stackoverflow.com/questions/3847955/php-display-most-recent-images-from-directory
// Code by Ravi Gupta; started around June 2015
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////

// Time Zone http://php.net/manual/en/timezones.php
date_default_timezone_set(‘Canada/Eastern’);

// Number of images to display
$number_of_images = 12 ;

// Skip images
// The Escam takes two pictures on motion detection
// 1 don’t skip
// 2 , 3 , 4 skip the next n-1 images
$skip_image = 2;

// After displaying $number_of_images are the rest deleted
// Set TRUE or FALSE
$delete = TRUE ;

// Website’s (image location’s) domain name; include sub domains if required
$domain = “ravigupta.ca”;

// Ftp directory(s) where camera puts images
// paul/ipcamera/2015/12/31/pictures
// paul/ipcamera/2016/1/1/pictures
// would be paul/ipcamera/*/*/*/pictures
// with this pattern all the directories under paul/ipcamera would be included
// remember to routinely manually delete folders when no longer required
$image_locations = “lmac/*/*/*/*/”;

// Image file name pattern.
// Motion0001.jpg Motion0002.JPG and so on would be Motion*.{jpg,JPG}
// 2015-06-30.jpg 2016-1-1.JPG and so on would be *.{jpg,JPG}
// Probable image file name extensions jpg, JPG, png, PNG, gif, GIF (case sensitive)
$file_names = “*.{jpg,JPG}”;

// It is unlikely anything below needs to be edited
//////////////////////////////////////////////////////////////////////////////////

// locations to search
$search = $image_locations.$file_names;

// Get image files from locations in $search
$images = glob($search, GLOB_BRACE);

//sort descending, newest images first based on file name
rsort($images);

// Setting a skip counter
$skip_this_image = $skip_image;

// Image display loop
// writes out the HTML code required to show the images
foreach($images as $image)
{
if($number_of_images > 0) // Show image
{
if( ($skip_this_image % $skip_image) == 0) // Show this image
{
echo “
“.date (“F d, Y g:i A T”, filemtime($image));
echo “
“; //placing html code into the page
$number_of_images–; // Image shown, reduce counter
$skip_this_image++; // Change the skip counter else check will always be true
}
else
{
$skip_this_image++; // Change the skip counter else check will always be false
}
}
else // Don’t show more images
{
if($delete)
unlink($image); //delete the rest of the image files
}

} // Image display loop

[/insert_php]