Skip to content
Snippets Groups Projects
Commit 54e5a108 authored by Bartek Przybylski's avatar Bartek Przybylski
Browse files

avoid creating empty albums, removing od depreciated code openings

parent 07b3b103
Branches
No related tags found
No related merge requests found
......@@ -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']));
}
......
<?
<?php
OC_Util::addStyle('gallery', 'styles');
OC_Util::addScript('gallery', 'albums');
OC_Util::addScript('gallery', 'album_cover');
......
<?
<?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
}
?>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment