avoid creating empty albums, removing od depreciated code openings

This commit is contained in:
Bartek Przybylski 2011-10-02 13:52:04 +02:00
parent 07b3b103ce
commit 54e5a10846
3 changed files with 6 additions and 6 deletions

View file

@ -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']));
}

View file

@ -1,4 +1,4 @@
<?
<?php
OC_Util::addStyle('gallery', 'styles');
OC_Util::addScript('gallery', 'albums');
OC_Util::addScript('gallery', 'album_cover');

View file

@ -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
}
?>