From: John K. <joh...@us...> - 2001-07-19 06:29:13
|
Update of /cvsroot/gallery/gallery In directory usw-pr-cvs1:/tmp/cvs-serv32100 Modified Files: edit_caption.php move_photo.php view_album.php view_photo_properties.php Log Message: Added static sorting ability... I'm checking these in so I can stop merging Bharat's changes! :-) The rest will be coming in a few seconds... Index: edit_caption.php =================================================================== RCS file: /cvsroot/gallery/gallery/edit_caption.php,v retrieving revision 1.14 retrieving revision 1.15 diff -u -r1.14 -r1.15 --- edit_caption.php 2001/07/11 04:35:14 1.14 +++ edit_caption.php 2001/07/19 06:29:10 1.15 @@ -24,13 +24,24 @@ if (!$gallery->user->canChangeTextOfAlbum($gallery->album)) { exit; } - +$err = ""; if ($save) { - $gallery->album->setCaption($index, stripslashes($data)); - $gallery->album->setKeywords($index, stripslashes($keywords)); - $gallery->album->save(); - dismissAndReload(); - return; + if (($capture_year < 3000) && ($capture_year > 1000)) { // only allow photo capture dates from 1000 to 3000. + $gallery->album->setCaption($index, stripslashes($data)); + $gallery->album->setKeywords($index, stripslashes($keywords)); + $dateArray["year"] = $capture_year; + $dateArray["mon"] = $capture_mon; + $dateArray["mday"] = $capture_mday; + $dateArray["hours"] = $capture_hours; + $dateArray["minutes"] = $capture_minutes; + $dateArray["seconds"] = $capture_seconds; + $gallery->album->setItemCaptureDate($index, $dateArray ); + $gallery->album->save(); + dismissAndReload(); + return; + } else { + $err = "Year must be between 1000 and 3000"; + } } ?> <html> @@ -61,6 +72,89 @@ <br><br> +<? +// get the itemCaptureDate +echo "<span class=error>$err</span><br><br>"; +$itemCaptureDate = $gallery->album->getItemCaptureDate($index); + +$hours = $itemCaptureDate["hours"]; +$minutes = $itemCaptureDate["minutes"]; +$seconds = $itemCaptureDate["seconds"]; +$mon = $itemCaptureDate["mon"]; +$mday = $itemCaptureDate["mday"]; +$year = $itemCaptureDate["year"]; +// start capture date table +?> +<table> + <tr> + <td colspan="5" align="center">Photo Capture Date</td> + </tr> + <tr> + <td>Month</td> + <td>Day</td> + <td>Year</td> + <td>Hours</td> + <td>Minutes</td> + <td>Seconds</td> + </tr> + <tr> +<? +// start making drop downs +echo "<td><select name=\"capture_mon\">"; +for ($i = 1; $i <= 12; $i++) { + if ($i == $mon) { + $sel = "selected"; + } else { + $sel = ""; + } + echo "<option value=\"$i\" $sel>$i</option>"; +} +echo "</select></td>\n"; +echo "<td><select name=\"capture_mday\">"; +for ($i = 1; $i <= 31; $i++) { + if ($i == $mday) { + $sel = "selected"; + } else { + $sel = ""; + } + echo "<option value = \"$i\" $sel>$i</option>"; +} +echo "</select></td>\n"; +echo "<td><INPUT TYPE=TEXT NAME=\"capture_year\" VALUE=$year SIZE=4></td>"; +echo "<td><select name=\"capture_hours\">"; +for ($i = 1; $i <= 23; $i++) { + if ($i == $hours) { + $sel = "selected"; + } else { + $sel = ""; + } + echo "<option value = \"$i\" $sel>$i</option>"; +} +echo "</select></td>\n"; +echo "<td><select name=\"capture_minutes\">"; +for ($i = 0; $i <= 59; $i++) { + if ($i == $minutes) { + $sel = "selected"; + } else { + $sel = ""; + } + echo "<option value = \"$i\" $sel>$i</option>"; +} +echo "</select></td>\n"; +echo "<td><select name=\"capture_seconds\">"; +for ($i = 0; $i <=59; $i++) { + if ($i == $seconds) { + $sel = "selected"; + } else { + $sel = ""; + } + echo "<option value = \"$i\" $sel>$i</option>"; +} +echo "</select></td>\n"; +?> + </tr> +</table> +<br><br> <input type=submit name="submit" value="Save"> <input type=submit name="submit" value="Cancel" onclick='parent.close()'> Index: move_photo.php =================================================================== RCS file: /cvsroot/gallery/gallery/move_photo.php,v retrieving revision 1.23 retrieving revision 1.24 diff -u -r1.23 -r1.24 --- move_photo.php 2001/07/09 04:31:48 1.23 +++ move_photo.php 2001/07/19 06:29:10 1.24 @@ -101,6 +101,18 @@ $err = $postAlbum->addPhoto($myfile, $mytype, $myname, $gallery->album->getCaption($index), $pathToThumb); if (!$err) { $newPhotoIndex = $postAlbum->numPhotos(1); + + // Save additional item settings... currently: + // $clicks $keywords $comments $uploadDate $itemCaptureDate; + $newphoto = $postAlbum->getPhoto($newPhotoIndex); + $oldphoto = $gallery->album->getPhoto($index); + $newphoto->clicks = $oldphoto->clicks; + $newphoto->keywords = $oldphoto->keywords; + $newphoto->comments = $oldphoto->comments; + $newphoto->uploadDate = $oldphoto->uploadDate; + $newphoto->itemCaptureDate = $oldphoto->itemCaptureDate; + $postAlbum->setPhoto($newphoto,$newPhotoIndex); + /* resize the photo if needed */ if ($postAlbum->fields["resize_size"] > 0 ) { $photo = $postAlbum->getPhoto($newPhotoIndex); @@ -121,7 +133,6 @@ $postAlbum->save(); if ($startPhoto == $endPhoto) { - print "hasHighlight = " . $gallery->album->hasHighlight() . "<br>"; if (!$gallery->album->hasHighlight()) { $resetHighlight = 1; $gallery->album->deletePhoto($index,$resetHighlight); Index: view_album.php =================================================================== RCS file: /cvsroot/gallery/gallery/view_album.php,v retrieving revision 1.73 retrieving revision 1.74 diff -u -r1.73 -r1.74 --- view_album.php 2001/07/13 05:17:19 1.73 +++ view_album.php 2001/07/19 06:29:10 1.74 @@ -196,9 +196,9 @@ if ($gallery->user->canWriteToAlbum($gallery->album)) { if ($gallery->album->numPhotos(1)) { - $adminCommands .= '<a href="#" onClick="'.popup("shuffle_album.php?albumName=" . + $adminCommands .= '<a href="#" onClick="'.popup("sort_album.php?albumName=" . $gallery->session->albumName). - '">[shuffle]</a> '; + '">[sort]</a> '; $adminCommands .= '<a href="#" onClick="'.popup("resize_photo.php?albumName=" . $gallery->session->albumName . "&index=all"). '">[resize all]</a> '; @@ -372,8 +372,9 @@ echo("<span class=error>*</span>"); $displayCommentLegend = 1; } + echo("<br>"); if (!(strcmp($gallery->album->fields["display_clicks"] , "yes")) && ($gallery->album->getItemClicks($i) > 0)) { - echo("<br>Viewed: ".pluralize($gallery->album->getItemClicks($i), "time", "0").".<br>"); + echo("Viewed: ".pluralize($gallery->album->getItemClicks($i), "time", "0").".<br>"); } } echo "</span>"; Index: view_photo_properties.php =================================================================== RCS file: /cvsroot/gallery/gallery/view_photo_properties.php,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- view_photo_properties.php 2001/07/18 11:41:25 1.7 +++ view_photo_properties.php 2001/07/19 06:29:10 1.8 @@ -79,54 +79,43 @@ */ -$mydir = $gallery->album->getAlbumDir(); -$myphoto = $gallery->album->getPhoto($index); -$myname = $myphoto->image->name; -$mytype=$myphoto->image->type; -$myfile="$mydir/$myname.$mytype"; - -/* display exif data with jhead */ -$return = array(); -$path = $gallery->app->use_exif; -exec_wrapper(fs_convert_filename($path) . - " " . - fs_convert_filename($myfile), - $return); - -while (list($key,$value) = each ($return)) { - $explodeReturn = explode(':', $value, 2); - $myExif[$explodeReturn[0]] = $explodeReturn[1]; -} -if ($myExif) { - array_pop($myExif); // get rid of empty element at end - array_shift($myExif); // get rid of file name at beginning - $sizeOfExif = sizeof($myExif); - $sizeOfTable = $sizeOfExif / 2; - $i = 1; - $column = 1; - echo ("<table width=100%>\n"); - echo ("<tr valign=top>\n"); - echo ("<td>\n"); - while (list($key, $value) = each ($myExif)) { - echo "<b>$key</b>: $value<br>\n"; - if (($i >= $sizeOfTable) && ($column == 1)) { - echo ("</td>\n"); - echo ("<td>\n"); - $column = 2; + $myExif = $gallery->album->getExif($index); + + if ($myExif) { + array_pop($myExif); // get rid of empty element at end + array_shift($myExif); // get rid of file name at beginning + $sizeOfExif = sizeof($myExif); + $sizeOfTable = $sizeOfExif / 2; + $i = 1; + $column = 1; + echo ("<table width=100%>\n"); + echo ("<tr valign=top>\n"); + echo ("<td>\n"); + while (list($key, $value) = each ($myExif)) { + echo "<b>$key</b>: $value<br>\n"; + if (($i >= $sizeOfTable) && ($column == 1)) { + echo ("</td>\n"); + echo ("<td>\n"); + $column = 2; + } + $i++; } - $i++; + echo ("</td>\n</table><br>"); } - echo ("</td>\n</table><br>"); - if ($myphoto->getKeyWords()) { - echo "<b>KEYWORDS</b>:   " . $myphoto->getKeyWords(); - } -} + echo ("File Upload Date:   " . date("m-d-Y H:i:s" , $gallery->album->getUploadDate($index)) . "<br>"); + $itemCaptureDate = $gallery->album->getItemCaptureDate($index); + echo ("Item Capture Date:   " . $itemCaptureDate[mon] . "-" . $itemCaptureDate[mday] . "-" . $itemCaptureDate[year] . " "); + echo ($itemCaptureDate[hours] . ":" . $itemCaptureDate[minutes] . ":" . $itemCaptureDate[seconds] . "<br>"); + + if ($gallery->album->getKeyWords($index)) { + echo "<b>KEYWORDS</b>:   " . $gallery->album->getKeyWords($index); + } } else { error("no album / index specified"); } ?> - +<br><br> <form action=#> <input type=submit value="Done" onclick='parent.close()'> </form> |