Jump to content


[PHP] Latest Images + Details of peice


5 replies to this topic

#1 fblade

    Young Padawan

  • Members
  • Pip
  • 15 posts

Posted 19 June 2006 - 04:22 PM

Hey guys im currently developing my Photography and digital art Portfolio and i need to develop a script (well 2 actaully depending how i do it), Well anyways the script i want to try and make will look in a directory for the latest images added by date and display them in a tumbnail and have a short description about them (eg Date took, and Title opf the piece).

at the moment i have this which i worked on a while back, i would like to use this has i was chuffed with the outcome even though not much was my first piece i did
<?php
$pathtodir = "http://www.64pixels.com/cameraimages/"; 

if ($handle = opendir('.')) {
   while (false !== ($file = readdir($handle))) {
	   if ($file != "." && $file != "..") {
		   echo "[img]".$pathtodir.$file."[/img]<br />\n";
		   echo "<a href=".$pathtodir.$file. "><img src=".$pathtodir.$file. " width= 25% height= 18.75% /></a><br />\n";
	   }
   } 
   closedir($handle);
}

is there anyway to use that and still achive what i wanted ?
thanks for time matt

#2 Mr. Matt

    Moderator

  • P2L Staff
  • PipPipPipPip
  • 1,945 posts
  • Gender:Not Telling

Posted 20 June 2006 - 01:43 AM

yes use a database and table. The table will hold all the information you would need for each photo inputed by you, the date added, the url to the photo and so on.

Then all you need is a few more scripts to add / edit / delete photos and one which displays the photos from the database.

Hope that helps

Matt

#3 fblade

    Young Padawan

  • Members
  • Pip
  • 15 posts

Posted 20 June 2006 - 07:06 AM

how am i able to extract the photo details/summary from the image itself though?

#4 Mr. Matt

    Moderator

  • P2L Staff
  • PipPipPipPip
  • 1,945 posts
  • Gender:Not Telling

Posted 20 June 2006 - 08:26 AM

what details are you talking about. If you are talking about photo size (width, height), file size, file type etc its easy with a php function. If you are talking about the name and description of the photo you cant store them in the file, well the filename is the only one.

#5 fblade

    Young Padawan

  • Members
  • Pip
  • 15 posts

Posted 20 June 2006 - 09:08 AM

View Postdeadly, on Jun 20 2006, 01:25 PM, said:

what details are you talking about. If you are talking about photo size (width, height), file size, file type etc its easy with a php function. If you are talking about the name and description of the photo you cant store them in the file, well the filename is the only one.
i had seen this site http://phpbuilder.co...f-read-data.php
about getting information i wanted and i had a try and well i failed misrably lol

heres what i got
<?php
$pathtodir = "http://www.64pixels.com/cameraimages/"; 

if ($handle = opendir('.')) {
   while (false !== ($file = readdir($handle))) {
	   if ($file != "." && $file != "..") {
		   echo "[img]".$pathtodir.$file."[/img]<br />\n";
		   echo "<a href=".$pathtodir.$file. "><img src=".$pathtodir.$file. " width= 25% height= 18.75% /></a><br />\n";

$exif = exif_read_data(.$pathtodir.$file., 0, true);
echo "test2.jpg:<br />\n";
foreach ($exif as $key => $section) {
   foreach ($section as $name => $val) {
	   echo "$key.$name: $val<br />\n";
   }
}
	   }

   } 
   closedir($handle);
}

but the sort of information i want is filename iso s[eed and stuff like that also comments and description basicaly the exif data

#6 fblade

    Young Padawan

  • Members
  • Pip
  • 15 posts

Posted 23 June 2006 - 04:30 PM

sorry to double post but has anymanaged to figure out a solution to this?





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users