4 Replies - 936 Views - Last Post: 08 July 2011 - 01:18 AM Rate Topic: -----

#1 polska03  Icon User is offline

  • D.I.C Regular

Reputation: 5
  • View blog
  • Posts: 302
  • Joined: 28-November 09

photo upload, tile and list views

Posted 07 July 2011 - 03:36 PM

Hello, I am trying to create a system monitoring site for my home. I have modified a webcam program to take snapshots every minute and store these images in a folder locally. I would like to create a web site which would display all of these images. I was wondering if it is possible to create the site in such a way that I can view all the contents of this folder and view them as tiles, lists ( like windows 7 directory allows).I want to do this because I am estimating over a 100,000 pictures to be taken and stored so I want to interchange between tile view and list view. I am not sure if there is a template such as CSS already out there that someone knows about? I was just wondering what would be the best way to do this?
Cheers

ps I would like to stay away from flash because of the amount of pictures and do not want to simply use a FTP server cause it must be viewable from a phone.

This post has been edited by polska03: 07 July 2011 - 03:43 PM


Is This A Good Question/Topic? 0
  • +

Replies To: photo upload, tile and list views

#2 maniacalsounds  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 117
  • View blog
  • Posts: 472
  • Joined: 27-June 10

Re: photo upload, tile and list views

Posted 07 July 2011 - 03:47 PM

As far as I know, there is no template to do this.

This project wouldn't be all that difficult, but would require some heave CSS tweaking.

Simply have PHP get all the files from the folder via fopen(), and echo all of them in their own span with a class of whatever you want. You could then style that class to make sure that all the pictures are shown however you'd like.
Was This Post Helpful? 0
  • +
  • -

#3 polska03  Icon User is offline

  • D.I.C Regular

Reputation: 5
  • View blog
  • Posts: 302
  • Joined: 28-November 09

Re: photo upload, tile and list views

Posted 07 July 2011 - 04:16 PM

I havent used php in a few years, I am simply first trying to just open all the images in my images folder, but it doesnt work. I have the images folder located in the var/www/ directory and it wont show the 3 pictures I have in that folder.
<html>
    <body>
        <?php
$files = glob("images/*.*");
for ($i=1; $i<count($files); $i++)
{
	$num = $files[$i];
	print $num."<br />";
	echo '<img src="'.$num.'" alt="random image" />'."<br /><br />";
}


?>
    </body>
</html>


Was This Post Helpful? 0
  • +
  • -

#4 maniacalsounds  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 117
  • View blog
  • Posts: 472
  • Joined: 27-June 10

Re: photo upload, tile and list views

Posted 07 July 2011 - 04:22 PM

I don't see why you created the $num variable. Why not just use $files[$i]?

Also, you'd need to start $i at zero, because array indices start at 0 in PHP.
Was This Post Helpful? 0
  • +
  • -

#5 polska03  Icon User is offline

  • D.I.C Regular

Reputation: 5
  • View blog
  • Posts: 302
  • Joined: 28-November 09

Re: photo upload, tile and list views

Posted 08 July 2011 - 01:18 AM

haha sorry thank you for your help they display now, havent done programming in a bit getting used to it. I am using $num just to make it a bit easier to read to code,(atleast easier for me to understand). I decided I will like to simply make small thumbnails of the pictures and then enlarge them. Also instead of thumbnails if someone can give me the code of simply hyperlinking to the pictures, this way none of the pictures have to load to the browser until I click on them? The code provided is for the thumbnails which i can't get to work, but would prefer to hyperlink if possible?
Cheers

<html>
    <body>
        <?php
$files = glob("images/*.*");
for ($i=0; $i<count($files); $i++)
{
	$num = $files[$i];
	
echo '<A HREF="'.$num.'"> <IMG HEIGHT=50 WIDTH=50 SRC="'.$num.'"> </A>'

}


?>
    </body>
</html>



PS I FIGURED IT ALL OUT never mind thank you very much

This post has been edited by polska03: 08 July 2011 - 10:13 AM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1