aboutsummaryrefslogtreecommitdiffstats
path: root/apps/gallery/index.php
diff options
context:
space:
mode:
Diffstat (limited to 'apps/gallery/index.php')
-rw-r--r--apps/gallery/index.php7
1 files changed, 2 insertions, 5 deletions
diff --git a/apps/gallery/index.php b/apps/gallery/index.php
index 87fdafcf13c..2c409089ebe 100644
--- a/apps/gallery/index.php
+++ b/apps/gallery/index.php
@@ -7,8 +7,7 @@ OC_App::setActiveNavigationEntry( 'gallery_index' );
if (!isset($_GET['view'])) {
- $stmt = OC_DB::prepare('SELECT * FROM *PREFIX*gallery_albums WHERE uid_owner = ?');
- $result = $stmt->execute(array(OC_User::getUser()));
+ $result = OC_Gallery_Album::find(OC_User::getUser());
$r = array();
while ($row = $result->fetchRow())
@@ -18,9 +17,7 @@ if (!isset($_GET['view'])) {
$tmpl->assign('r', $r);
$tmpl->printPage();
} else {
- $stmt = OC_DB::prepare('SELECT * FROM *PREFIX*gallery_photos, *PREFIX*gallery_albums WHERE uid_owner = ? AND album_name = ? AND *PREFIX*gallery_albums.album_id = *PREFIX*gallery_photos.album_id');
-
- $result = $stmt->execute(array(OC_User::getUser(), $_GET['view']));
+ $result = OC_Gallery_Photo::findForAlbum(OC_User::getUser(), $_GET['view']);
$photos = array();
while ($p = $result->fetchRow())