');
}
while ($j <= $cols && $i <= $numPhotos) {
if ($gallery->album->isAlbum($i)) {
$myAlbum = new Album;
$myAlbum->load($gallery->album->getAlbumName($i));
}
else {
$myAlbum = NULL;
}
if ($gallery->album->isAlbum($i)) {
$iWidth = $gallery->album->fields['thumb_size'];
} else {
list($iWidth, $iHeight) = $gallery->album->getThumbDimensions($i);
}
echo("");
// put form outside caption to compress lines
if (!$gallery->session->offline &&
(($gallery->user->canDeleteFromAlbum($gallery->album)) ||
($gallery->user->canWriteToAlbum($gallery->album)) ||
($gallery->user->canChangeTextOfAlbum($gallery->album)) ||
(($gallery->album->getItemOwnerModify() || $gallery->album->getItemOwnerDelete()) &&
($gallery->album->isItemOwner($gallery->user->getUid(), $i) ||
(isset($myAlbum) && $gallery->user->isOwnerOfAlbum($myAlbum))))))
{
$showAdminForm = 1;
} else {
$showAdminForm = 0;
}
// Caption itself
echo "\n". '';
$id = $gallery->album->getPhotoId($i);
if ($gallery->album->isHidden($i) && !$gallery->session->offline) {
echo "(" . _("hidden") .") ";
}
if (isset($myAlbum)) {
$myDescription = $myAlbum->fields['description'];
$buf = "";
$buf = $buf." ". sprintf(_("Album: %s"), ''. $myAlbum->fields['title'] .''). '';
if ($myDescription != _("No description") &&
$myDescription != "No description" &&
$myDescription != "") {
$buf = $buf." ".$myDescription."";
}
echo $buf;
echo ' ';
echo _("Changed: ") ." ". $myAlbum->getLastModificationDate();
echo "\n ";
$visItems=array_sum($myAlbum->numVisibleItems($gallery->user));
echo _("Contains: ") ." ". pluralize_n2(ngettext("1 item", "%d items", $visItems), $visItems) . '. ';
// If comments indication for either albums or both
switch ($gallery->app->comments_indication) {
case "albums":
case "both":
$lastCommentDate = $myAlbum->lastCommentDate(
$gallery->app->comments_indication_verbose);
if ($lastCommentDate > 0) {
print lastCommentString($lastCommentDate, $displayCommentLegend);
}
}
echo ' ';
if (!(strcmp($gallery->album->fields["display_clicks"] , "yes")) && !$gallery->session->offline && ($myAlbum->getClicks() > 0)) {
echo ' ';
echo _("Viewed:") . " ". pluralize_n2(ngettext("1 time", "%d times", $myAlbum->getClicks()), $myAlbum->getClicks());
echo ". ";
}
echo '';
}
else {
echo ' ';
echo nl2br($gallery->album->getCaption($i));
echo $gallery->album->getCaptionName($i) . ' ';
// indicate with * if we have a comment for a given photo
if ($gallery->user->canViewComments($gallery->album)
&& $gallery->app->comments_enabled == 'yes') {
// If comments indication for either photos or both
switch ($gallery->app->comments_indication) {
case "photos":
case "both":
$lastCommentDate = $gallery->album->itemLastCommentDate($i);
print lastCommentString($lastCommentDate, $displayCommentLegend);
}
}
echo "";
if (!(strcmp($gallery->album->fields["display_clicks"] , "yes")) && !$gallery->session->offline && ($gallery->album->getItemClicks($i) > 0)) {
echo ' ';
echo _("Viewed:") ." ". pluralize_n2(ngettext("1 time", "%d times", $gallery->album->getItemClicks($i)), $gallery->album->getItemClicks($i));
echo ". \n";
}
}
echo " \n";
// End Caption
if (canVote()) {
print '| ';
addPolling($gallery->album->getVotingIdByIndex($i),
$form_pos, false);
$form_pos++;
}
if ($showAdminForm) {
if ($gallery->album->isMovieByIndex($i)) {
$label = _("Movie");
} elseif ($gallery->album->isAlbum($i)) {
$label = _("Album");
} else {
$label = _("Photo");
}
if (canVote()) {
echo ' | ';
echo "\n" . '| ';
}
echo("\n\t\n";
}
if (canVote()) {
print ' | ';
}
echo(' | ');
$j++;
$visibleItemIndex++;
$i = $visibleItemIndex<=$numVisibleItems ? $visibleItems[$visibleItemIndex] : $numPhotos+1;
}
if ($printTableRow) {
echo('
');
}
/* Now do the inline_albumthumb footer row */
$visibleItemIndex = $rowStart;
$i = $visibleItemIndex <= $numVisibleItems ? $visibleItems[$visibleItemIndex] : $numPhotos+1;
$j = 1;
if ($printTableRow) {
echo('