Welcome to the Cumulus Support forum.

Latest Cumulus MX V4 release 4.4.2 (build 4085) - 12 March 2025

Latest Cumulus MX V3 release 3.28.6 (build 3283) - 21 March 2024

Legacy Cumulus 1 release 1.9.4 (build 1099) - 28 November 2014
(a patch is available for 1.9.4 build 1099 that extends the date range of drop-down menus to 2030)

Download the Software (Cumulus MX / Cumulus 1 and other related items) from the Wiki

If you are posting a new Topic about an error or if you need help PLEASE read this first viewtopic.php?p=164080#p164080

php recursive directory search working for webcams

Other discussion about creating web sites for Cumulus that doesn't have a specific subforum

Moderator: daj

Post Reply
Warrandyte
Posts: 41
Joined: Sat 06 Apr 2013 11:46 pm
Weather Station: Fine Offset with Solar
Operating System: Windows XP, 7 8 and 10
Location: TIrrannaville NSW Australia

php recursive directory search working for webcams

Post by Warrandyte »

http://www.warrandytefarm.com/test/getimagenames.php

the code is below for anyone who wants one that works on php4+

Code: Select all

<?php

/**
 * @author Rob France
*/
$myfile = new RecursiveDirectoryIterator("webcam/");
$display = Array ('jpeg', 'jpg' );
foreach(new RecursiveIteratorIterator($myfile) as $file)
{
    if (in_array(strtolower(array_pop(explode('.', $file))), $display))
/**        echo "<img src='" . $file . "'width='600' height='400'><br/> \n";
 uncomment the above to display the images */
        echo $file . "<br/> \n";
}
?>
now I have that's going (and its a real pain to do so), I need to filter by camera number and date, probably using drop downs but I get kind of stuck there.

its been a lot of headaches trying to get all the recursive stuff to work

webcams is a subdirectory of the root from where the script is run

another one getimages.php will give the images using the same code but there's a lot of them and i don't want to blow peoples bandwidth

There is probably also a much better way of doing this using glob functions or similar but I cant convince my hosting people to get away from php4

I have used the filenames Cam1_ cam2_ etc and the dates are the main folder names apart from a few rogues that have crept in there.
TNETWeather

Re: php recursive directory search working for webcams

Post by TNETWeather »

Seriously, get a new web host if they are not upgrading the Insecure PHP4 to current PHP5. There is no excuse for that. Especially with all the new security issues that have been released over the past 4-6 months.

PHP Support:
Support for PHP 4 has been discontinued since 2007-12-31.

Ref:
http://php.net/releases/
Warrandyte
Posts: 41
Joined: Sat 06 Apr 2013 11:46 pm
Weather Station: Fine Offset with Solar
Operating System: Windows XP, 7 8 and 10
Location: TIrrannaville NSW Australia

Re: php recursive directory search working for webcams

Post by Warrandyte »

Kevin.
My mistake. It was 5.4... And i needed 5.5 so theyre not too bad once you can get around the phillipino need to script and reiterate every sentence of a conversation.

I live in a more remote part of Australia and they have one of the few intrfaces that isnt image intensive so i can actually use it on my lousy broadband connection.
Something i also love about Cumulus.

Great work with all your wx related stuff.

Im thinking one day we should all get together and get Steve to incorporate an advanced version for newbies rather than collect various bits and pieces from around the web. Only problem is there been too much great work done by so many people that it would be hard to know what to leave out.

Im offline for a few days as our latest addition has choaen not to wait the extra 3 weeks till his due date.

Rob
Post Reply