summaryrefslogtreecommitdiff
path: root/lib/image/index.php
diff options
context:
space:
mode:
authorNicolas BERNSTEIN <alexis211@gmail.com>2012-03-18 14:08:31 +0100
committerNicolas BERNSTEIN <alexis211@gmail.com>2012-03-18 14:08:31 +0100
commitccff9ce8d8a2818699ce4e20a310986fc95ea022 (patch)
treec585ead91c894c621c73b63bc84012709e795151 /lib/image/index.php
parent24547ccec6526fcef3cccb34bc35fb81f31236b3 (diff)
downloadBits-ccff9ce8d8a2818699ce4e20a310986fc95ea022.tar.gz
Bits-ccff9ce8d8a2818699ce4e20a310986fc95ea022.zip
Added a way of classifying images in folders.
Diffstat (limited to 'lib/image/index.php')
-rw-r--r--lib/image/index.php14
1 files changed, 12 insertions, 2 deletions
diff --git a/lib/image/index.php b/lib/image/index.php
index 59a304d..b9748dc 100644
--- a/lib/image/index.php
+++ b/lib/image/index.php
@@ -6,6 +6,7 @@ $filters = array (
"order" => array (
"name" => "title",
"upl_date" => "date uploaded",
+ "folder_name" => "folder",
),
"way" => $ord_ways,
);
@@ -17,7 +18,10 @@ $fdefaults = array (
$title = "Image upload";
$images = array();
-$files = sql("SELECT * FROM images WHERE owner = " . $user['id'] .
+$files = sql("SELECT images.id AS id, images.name AS name, images.extension AS extension, images.upl_date AS upl_date, ".
+ "images.comment_html AS comment_html, img_folders.id AS folder_id, img_folders.name AS folder_name ".
+ " FROM images LEFT JOIN img_folders ON img_folders.id = images.folder ".
+ "WHERE images.owner = " . $user['id'] .
" ORDER BY " . get_filter('order') . " " . get_filter('way'));
while ($img = mysql_fetch_assoc($files)) $images[] = $img;
@@ -33,7 +37,13 @@ if ($user['priv'] < $apps['image']['upload']) {
$can_upload = true;
}
+$folders = array();
+$r = sql("SELECT id, name FROM img_folders WHERE owner = " . $user['id'] . " ORDER BY name ASC");
+while ($f = mysql_fetch_assoc($r)) {
+ $folders[] = $f;
+}
+
$can_delete = ($user['priv'] >= $apps['image']['delete'] && $user['id'] != 0);
-$can_rename = ($user['priv'] >= $apps['image']['rename'] && $user['id'] != 0);
+$can_rename = ($user['priv'] >= $apps['image']['editinfo'] && $user['id'] != 0);
require("tpl/image/index.php");