AbelCam Forum
Download AbelCam buy Pro
 
 
 
Welcome Anonymous User
04/16/2025 - 05:25 PM
Quick Search:
Quick Jump:
 
Announcements
Latest Topics
 
PHP Motion Album
By: AndrewG
Rank: Master Contributor
Topics: 172
From: St. Andrews, Scotland
Added: 06/03/2007 - 10:58 PM

I've had this running for a few months on my server so I thought I'd share. The motions pictures at the bottom of webcam 2 view here.
I found a free script on dynamicdrive.com here.
You'll need:
Apache with php
How to set it up:
First setup Motion detection as shown in the help file or here you'll need sent to files via ftp to a apache or as I do local save into the apache folder.
In folder where these image are being saved put:
<?
Header("content-type: application/x-javascript");

function returnimages($dirname=".") {
   $pattern="\.(jpg|jpeg|png|gif|bmp)$";
   $files = array();
   $curimage=0;
   if($handle = opendir($dirname)) {
       while(false !== ($file = readdir($handle))){
               if(eregi($pattern, $file)){
		 $filedate=date ("M d, Y H:i:s", filemtime($file));
                 echo 'galleryarray[' . $curimage .']=["' . $file . '", "'.$filedate.'"];' . "\n";
                 $curimage++;
               }
       }

       closedir($handle);
   }
   return($files);
}

echo "var galleryarray=new Array();" . "\n";
returnimages();
?> 

Save it as getpics.php

From here on in your probably better to go here and go on from step 2. Hope this helps.
Andrew
Topic has no responses