diff --git a/apps/gallery/lib_scanner.php b/apps/gallery/lib_scanner.php index e9a022c606b13c1a61df0edc0677a5c5b612ca3e..fe14b68add1345ae50384b888395024629ce531d 100644 --- a/apps/gallery/lib_scanner.php +++ b/apps/gallery/lib_scanner.php @@ -30,7 +30,7 @@ class OC_GALLERY_SCANNER { $albums[] = $current_album; $stmt = OC_DB::prepare('SELECT * FROM *PREFIX*gallery_albums WHERE "uid_owner" = ? AND "album_name" = ?'); $result = $stmt->execute(array(OC_User::getUser(), $current_album['name'])); - if ($result->numRows() == 0) { + if ($result->numRows() == 0 && count($current_album['images'])) { $stmt = OC_DB::prepare('INSERT OR REPLACE INTO *PREFIX*gallery_albums ("uid_owner", "album_name") VALUES (?, ?)'); $stmt->execute(array(OC_User::getUser(), $current_album['name'])); } diff --git a/apps/gallery/templates/index.php b/apps/gallery/templates/index.php index 97869907557954a41a37a18ac447f6bb85214b59..0e89e448768bfab117352aa774b6b41bf95db968 100644 --- a/apps/gallery/templates/index.php +++ b/apps/gallery/templates/index.php @@ -1,4 +1,4 @@ -<? +<?php OC_Util::addStyle('gallery', 'styles'); OC_Util::addScript('gallery', 'albums'); OC_Util::addScript('gallery', 'album_cover'); diff --git a/apps/gallery/templates/view_album.php b/apps/gallery/templates/view_album.php index c1298a22c222b410bca27d72a12169a9fdfe4a66..ea2969e01104c98a0e6e227381edaf9bb6edad6d 100644 --- a/apps/gallery/templates/view_album.php +++ b/apps/gallery/templates/view_album.php @@ -1,4 +1,4 @@ -<? +<?php OC_Util::addStyle('gallery', 'styles'); OC_Util::addScript('gallery', 'album_cover'); OC_Util::addScript( 'files_imageviewer', 'lightbox' ); @@ -9,11 +9,11 @@ OC_Util::addStyle( 'files_imageviewer', 'lightbox' ); <a href="?"><input type="button" value="Back" /></a><br/> </div> <div id="gallery_list"> -<? +<?php foreach ($_['photos'] as $a) { ?> -<a onclick="javascript:viewImage('/','<? echo $a; ?>');"><img src="ajax/thumbnail.php?img=<? echo $a ?>"></a> -<? +<a onclick="javascript:viewImage('/','<?php echo $a; ?>');"><img src="ajax/thumbnail.php?img=<?php echo $a ?>"></a> +<?php } ?>