user->canReadAlbum($gallery->album)) { header("Location: " . makeAlbumUrl()); return; } if (isset($full) && !$gallery->user->canViewFullImages($gallery->album)) { header("Location: " . makeAlbumUrl($gallery->session->albumName, $id)); return; } if (!isset($full)) { $full=NULL; } if (!isset($openAnchor)) { $openAnchor=0; } if (isset($id)) { $index = $gallery->album->getPhotoIndex($id); if ($index == -1) { // That photo no longer exists. header("Location: " . makeAlbumUrl($gallery->session->albumName)); return; } } else { $id = $gallery->album->getPhotoId($index); } if (!function_exists('array_search')) { function array_search($needle, $haystack) { for ($x=0; $x < sizeof($haystack); $x++) { if ($haystack[$x] == $needle) { return $x; } } return NULL; } } if (!empty($votes)) { if (!isset($votes[$id]) && $gallery->album->getPollScale() == 1 && $gallery->album->getPollType() == "critique") { $votes[$id]=null; } saveResults($votes); if ($gallery->album->getPollShowResults()) { list($buf, $rank)=showResultsGraph(0); print $buf; } } // is photo hidden? should user see it anyway? if (($gallery->album->isHidden($index)) && (!$gallery->user->canWriteToAlbum($gallery->album))){ header("Location: " . makeAlbumUrl($gallery->session->albumName)); return; } $albumName = $gallery->session->albumName; if (!isset($gallery->session->viewedItem[$gallery->session->albumName][$id]) && !$gallery->session->offline) { $gallery->session->viewedItem[$albumName][$id] = 1; $gallery->album->incrementItemClicks($index); } $photo = $gallery->album->getPhoto($index); if ($photo->isMovie()) { $image = $photo->thumbnail; } else { $image = $photo->image; } $photoURL = $gallery->album->getAlbumDirURL("full") . "/" . $image->name . "." . $image->type; list($imageWidth, $imageHeight) = $image->getRawDimensions(); $do_fullOnly = isset($gallery->session->fullOnly) && !strcmp($gallery->session->fullOnly,"on") && !strcmp($gallery->album->fields["use_fullOnly"],"yes"); if ($do_fullOnly) { $full = $gallery->user->canViewFullImages($gallery->album); } $fitToWindow = !strcmp($gallery->album->fields["fit_to_window"], "yes") && !$gallery->album->isResized($index) && !$full && (!$GALLERY_EMBEDDED_INSIDE || $GALLERY_EMBEDDED_INSIDE =='phpBB2'); $numPhotos = $gallery->album->numPhotos($gallery->user->canWriteToAlbum($gallery->album)); $next = $index+1; if ($next > $numPhotos) { //$next = 1; $last = 1; } $prev = $index-1; if ($prev <= 0) { //$prev = $numPhotos; $first = 1; } if ($index > $gallery->album->numPhotos(1)) { $index = $numPhotos; } /* * We might be prev/next navigating using this page * so recalculate the 'page' variable */ $rows = $gallery->album->fields["rows"]; $cols = $gallery->album->fields["cols"]; $perPage = $rows * $cols; $page = (int)(ceil($index / ($rows * $cols))); $gallery->session->albumPage[$gallery->album->fields['name']] = $page; /* * Relative URLs are tricky if we don't know if we're rewriting * URLs or not. If we're rewriting, then the browser will think * we're down 1 dir farther than we really are. Use absolute * urls wherever possible. */ $top = $gallery->app->photoAlbumURL; $bordercolor = $gallery->album->fields["bordercolor"]; $borderwidth = $gallery->album->fields["border"]; if (!strcmp($borderwidth, "off")) { $borderwidth = 1; } if (!strcmp($gallery->album->fields["resize_size"], "off")) { $mainWidth = 0; } else { $mainWidth = "100%"; } $navigator["id"] = $id; $navigator["allIds"] = $gallery->album->getIds($gallery->user->canWriteToAlbum($gallery->album)); $navigator["fullWidth"] = "100"; $navigator["widthUnits"] = "%"; $navigator["url"] = "."; $navigator["bordercolor"] = $bordercolor; #-- breadcrumb text --- $upArrowURL = '' . _('; $breadCount = 0; $breadtext[$breadCount] = _("Album") .": session->albumName) . "\">" . $gallery->album->fields['title'] . " " . $upArrowURL . ""; $breadCount++; $pAlbum = $gallery->album; $depth = 0; do { if (!strcmp($pAlbum->fields["returnto"], "no")) { break; } $depth++; $pAlbumName = $pAlbum->fields['parentAlbumName']; if ($pAlbumName && (!$gallery->session->offline || $gallery->session->offlineAlbums[$pAlbumName])) { $pAlbum = new Album(); $pAlbum->load($pAlbumName); $breadtext[$breadCount] = _("Album") .": " . $pAlbum->fields['title'] . " " . $upArrowURL . ""; } elseif (!$gallery->session->offline || isset($gallery->session->offlineAlbums["albums.php"])) { //-- we're at the top! --- $breadtext[$breadCount] = _("Gallery") .": " . $gallery->app->galleryTitle . " " . $upArrowURL . ""; $pAlbumName = ''; } $breadCount++; } while ($pAlbumName && $depth < $gallery->app->maximumAlbumDepth); //-- we built the array backwards, so reverse it now --- for ($i = count($breadtext) - 1; $i >= 0; $i--) { $breadcrumb["text"][] = $breadtext[$i]; } $extra_fields=$gallery->album->getExtraFields(); $title=NULL; if (in_array("Title", $extra_fields)) { $title=$gallery->album->getExtraField($index, "Title"); } if (!$title) { $title=$index; } if (!$GALLERY_EMBEDDED_INSIDE) { doctype() ?> <?php echo $gallery->app->galleryTitle ?> :: <?php echo $gallery->album->fields["title"] ?> :: <?php echo $title ?> 0) { if (!strcmp($navigator['allIds'][$navpage], $id)) { break; } $navpage--; } if ($navigator['allIds'][0] != $id) { if ($navigator['allIds'][0] != 'unknown') { ?> album->isRoot() && (!$gallery->session->offline || isset($gallery->session->offlineAlbums["albums.php"]))) { ?> album->getKeywords($index)); ?> >
album->isMovie($id)) { print "\n"; print ' 1)).'">'."\n"; if ($gallery->user->canWriteToAlbum($gallery->album)) { $adminCommands .= popup_link("[" . _("resize photo") ."]", "resize_photo.php?index=$index", false, true, 500, 500, 'admin'); } if ($gallery->user->canDeleteFromAlbum($gallery->album) || ($gallery->album->getItemOwnerDelete() && $gallery->album->isItemOwner($gallery->user->getUid(), $index))) { // determine index of next item (after deletion) // we move to previous image if we're at the end // and move forward if we're not if ($index >= $numPhotos && $index > 1) { $nextIndex = $index - 1; } elseif ($index + 1 <= $numPhotos) { $nextIndex = $index + 1; } else { $nextIndex = $index; } // make sure that the "next" item isn't an album if ($gallery->album->isAlbum($nextIndex)) { $nextId=''; } else { $nextId = $gallery->album->getPhotoId($nextIndex); } $adminCommands .= ' ' . popup_link("[" . _("delete photo") ."]", "delete_photo.php?id=$id&nextId=$nextId", false, true, 500, 500, 'admin'); } if (!strcmp($gallery->album->fields["use_fullOnly"], "yes") && !$gallery->session->offline && $gallery->user->canViewFullImages($gallery->album)) { $link = doCommand("", array("set_fullOnly" => (!isset($gallery->session->fullOnly) || strcmp($gallery->session->fullOnly,"on") ? "on" : "off")), "view_photo.php", array("id" => $id)); $adminCommands .= ' ' . _('View Images') .': [ '; if (!isset($gallery->session->fullOnly) || strcmp($gallery->session->fullOnly,"on")) { $adminCommands .= _('normal') . " | " . _('full') .' ]'; } else { $adminCommands .= "" . _("normal") .' | '. _('full') .' ]'; } } $field="EXIF"; $key=array_search($field, $extra_fields); if (!is_int($key) && !strcmp($gallery->album->fields["use_exif"],"yes") && (eregi("jpe?g\$", $photo->image->type)) && isset($gallery->app->use_exif)) { $albumName = $gallery->session->albumName; $adminCommands .= ' ' . popup_link("[" . _("photo properties") ."]", "view_photo_properties.php?set_albumName=$albumName&index=$index", 0, false, 500, 500, 'admin'); } if (isset($gallery->album->fields["print_photos"]) && !$gallery->session->offline && !$gallery->album->isMovie($id)){ $photo = $gallery->album->getPhoto($GLOBALS["index"]); $photoPath = $gallery->album->getAlbumDirURL("full"); $prependURL = ''; if (!ereg('^https?://', $photoPath)) { $prependURL = 'http'; if (stristr($HTTP_SERVER_VARS['HTTPS'], "on")) { $prependURL .= 's'; } $prependURL .= '://'. $HTTP_SERVER_VARS['HTTP_HOST']; } $rawImage = $prependURL . $photoPath . "/" . $photo->image->name . "." . $photo->image->type; $thumbImage= $prependURL . $photoPath . "/"; if ($photo->thumbnail) { $thumbImage .= $photo->image->name . "." . "thumb" . "." . $photo->image->type; } else if ($photo->image->resizedName) { $thumbImage .= $photo->image->name . "." . "sized" . "." . $photo->image->type; } else { $thumbImage .= $photo->image->name . "." . $photo->image->type; } list($imageWidth, $imageHeight) = $photo->image->getRawDimensions(); if (strlen($adminCommands) > 0) { $adminCommands .="
"; } /* display photo printing services */ $printServices = $gallery->album->fields['print_photos']; $numServices = count($printServices); if (!isset($printServices['shutterfly']['checked']) && isset($printServices['shutterfly']['donation'])) { $numServices--; } $fullName = array( 'ezprints' => 'EZ Prints', 'fotokasten' => 'Fotokasten', 'photoaccess' => 'PhotoAccess', 'shutterfly' => 'Shutterfly' ); /* display a '; $selectCommand .= ""; foreach ($printServices as $name => $data) { /* skip if it's not actually selected */ if (!isset($data['checked'])) { continue; } switch ($name) { case 'ezprints': $printEZPrintsForm = true; break; case 'photoaccess': $printPhotoAccessForm = true; break; case 'shutterfly': $printShutterflyForm = true; break; } $selectCommand .= ""; } $selectCommand .= ''; $adminCommands .= '[' . sprintf(_('print this photo with %s'), $selectCommand) . ']'; /* just print out text if only one option */ } elseif ($numServices == 1) { $name = key($printServices); switch ($name) { case 'ezprints': $printEZPrintsForm = true; break; case 'photoaccess': $printPhotoAccessForm = true; break; case 'shutterfly': $printShutterflyForm = true; break; } $adminCommands .= "[" . sprintf(_('print this photo with %s'), $fullName[$name]) . ']'; } } ?> $adminCommands"; $adminbox["commands"] = $adminCommands; $adminbox["text"] = " "; $adminbox["bordercolor"] = $bordercolor; $adminbox["top"] = true; includeLayout('adminbox.inc'); includeLayout('navtablemiddle.inc'); } $breadcrumb["bordercolor"] = $bordercolor; $breadcrumb["top"] = true; $breadcrumb['bottom'] = false; includeLayout('breadcrumb.inc'); includeLayout('navtablemiddle.inc'); includeLayout('navphoto.inc'); includeLayout('navtableend.inc'); #-- if borders are off, just make them the bgcolor ---- if (!strcmp($gallery->album->fields["border"], "off")) { $bordercolor = $gallery->album->fields["bgcolor"]; } if ($bordercolor) { $bordercolor = "bgcolor=$bordercolor"; } ?>
album->isMovie($id)) { if (!$do_fullOnly && ($full || $fitToWindow || $gallery->album->isResized($index))) { if ($full) { $href= makeAlbumUrl($gallery->session->albumName, $id); } else if ($gallery->user->canViewFullImages($gallery->album)) { $href= makeAlbumUrl($gallery->session->albumName, $id, array("full" => 1)); } } } else { $href= $gallery->album->getPhotoPath($index) ; } $photoTag=""; $frame= $gallery->album->fields['image_frame']; if ($fitToWindow && preg_match('/safari|opera/i', $HTTP_SERVER_VARS['HTTP_USER_AGENT'])) { //Safari/Opera can't render dynamically sized image frame $frame = 'none'; } $photoTag .= $gallery->album->getPhotoTag($index, $full); list($width, $height) = $photo->getDimensions($full); $gallery->html_wrap['borderColor'] = $gallery->album->fields["bordercolor"]; $gallery->html_wrap['borderWidth'] = $gallery->album->fields["border"]; $gallery->html_wrap['frame'] = $frame; $gallery->html_wrap['imageWidth'] = $width; $gallery->html_wrap['imageHeight'] = $height; $gallery->html_wrap['imageHref'] = $href; $gallery->html_wrap['imageTag'] = $photoTag; $gallery->html_wrap['pixelImage'] = getImagePath('pixel_trans.gif'); includeHtmlWrap("inline_photo.frame"); ?>

"; echo "\n"; echo "\n\t". '"; echo "\n"; } if ($gallery->album->getPollShowResults()) { echo "\n"; echo "\n"; echo "\n\t". '"; echo "\n"; } echo "\n"; echo "\n"; echo "\n\t". '"; unSet($extra_fields[$key]); } $field="Capture Date"; $key=array_search($field, $extra_fields); if (is_int($key)) { $itemCaptureDate = $gallery->album->getItemCaptureDate($index); $table .= ""; unSet($extra_fields[$key]); } $field="Dimensions"; $key=array_search($field, $extra_fields); if (is_int($key)) { $dimensions=$photo->getDimensions($full); $table .= ""; unSet($extra_fields[$key]); } // skip title - only for header display $field="Title"; $key=array_search($field, $extra_fields); if (is_int($key)) { unSet($extra_fields[$key]); } $field="EXIF"; $do_exif=false; $key=array_search($field, $extra_fields); if (is_int($key)) { unSet($extra_fields[$key]); if ( ($gallery->album->fields["use_exif"] === "yes") && $gallery->app->use_exif && (eregi("jpe?g\$", $photo->image->type))) { $do_exif=true; } } foreach ($extra_fields as $field) { $value=$gallery->album->getExtraField($index, $field); if ($value) { $table .= ""; } } if ($do_exif) { $myExif = $gallery->album->getExif($index, isset($forceRefresh)); // we dont want to show the full system path to the file array_shift($myExif); foreach ($myExif as $field => $value) { $table .= ""; } } if ($table) { print "
album, $index) ?>

'; echo makeFormIntro("view_photo.php", array("name" => "vote_form", "method" => "POST")); ?> ' . addPolling("item.$id"); print ''; echo "\n\t
'; echo showResults("item.$id"); echo "\n\t
'; $automaticFields=automaticFieldsList(); $field="Upload Date"; $table=''; $key=array_search($field, $extra_fields); if (is_int($key)) { $table .= "
".$automaticFields[$field].":". strftime($gallery->app->dateTimeString , $gallery->album->getUploadDate($index)). "
".$automaticFields[$field].":". strftime($gallery->app->dateTimeString , mktime ($itemCaptureDate['hours'], $itemCaptureDate['minutes'], $itemCaptureDate['seconds'], $itemCaptureDate['mon'], $itemCaptureDate['mday'], $itemCaptureDate['year'])). "
".$automaticFields[$field].":". $dimensions[0]." x ".$dimensions[1]." (". ((int) $photo->getFileSize($full) >> 10) ."k)
$field:". str_replace("\n", "
", $value). "
$field:". str_replace("\n", "

", $value). "

$table
\n"; } ?> user->canViewComments($gallery->album) && $gallery->app->comments_enabled == 'yes') { echo viewComments($index, $gallery->user->canAddComments($gallery->album)); } ?>
album->fields['print_photos']['shutterfly']['donation'] === 'no') { ?> album->getCaption($index); if (empty($imbkprnt)) { $imbkprnt = makeAlbumUrl($gallery->session->albumName, $id); } ?>
album->getCaption($index); if (empty($imbkprnt)) { $imbkprnt = makeAlbumUrl($gallery->session->albumName, $id); } ?>
"); includeHtmlWrap("inline_photo.footer"); echo(""); ?> user->isLoggedIn() && $gallery->user->getEmail() && !$gallery->session->offline && $gallery->app->emailOn == "yes") { if (isset($submitEmailMe)) { if (isset($comments)) { $gallery->album->setEmailMe('comments', $gallery->user, $id); } else { $gallery->album->unsetEmailMe('comments', $gallery->user, $id); } /* if (isset($other)) { $gallery->album->setEmailMe('other', $gallery->user, $id); } else { $gallery->album->unsetEmailMe('other', $gallery->user, $id); } */ } echo makeFormIntro("view_photo.php", array("name" => "email_me", "method" => "POST")); print ""; print _("Email me when:") . " "; print _("Comments are added"); ?> album->getEmailMe('comments', $gallery->user, $id)) ? "checked" : "" ?> onclick="document.email_me.submit()" >