diff options
author | Alex AUVOLAT <alexis211@gmail.com> | 2012-06-21 16:34:27 +0200 |
---|---|---|
committer | Alex AUVOLAT <alexis211@gmail.com> | 2012-06-21 16:34:27 +0200 |
commit | 889e8eaf7c40817663dd602a21ac771062ccac3b (patch) | |
tree | ca8ac81ee202165333e5ffe16147d09e5cdaf2ab /lib/file/index.php | |
parent | 5c4caed8560d5fded00525844dfa8386b97e7918 (diff) | |
download | Bits-889e8eaf7c40817663dd602a21ac771062ccac3b.tar.gz Bits-889e8eaf7c40817663dd602a21ac771062ccac3b.zip |
Big change, sir. Can now upload any kind of files.
Diffstat (limited to 'lib/file/index.php')
-rw-r--r-- | lib/file/index.php | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/lib/file/index.php b/lib/file/index.php new file mode 100644 index 0000000..34686c5 --- /dev/null +++ b/lib/file/index.php @@ -0,0 +1,44 @@ +<?php + +require("lib/conf/file.php"); + +$filters = array ( + "order" => array ( + "name" => "title", + "upl_date" => "date uploaded", + "folder_name" => "folder", + ), + "way" => $ord_ways, +); +$fdefaults = array ( + "order" => "upl_date", + "way" => "DESC", +); + +$title = "Image upload"; + +$files = array(); +$fileq = sql("SELECT files.id AS id, files.name AS name, files.extension AS extension, files.upl_date AS upl_date, ". + "files.comment_html AS comment_html, folders.id AS folder_id, folders.name AS folder_name ". + " FROM files LEFT JOIN folders ON folders.id = files.folder ". + "WHERE files.owner = " . $user['id'] . + " ORDER BY " . get_filter('order') . " " . get_filter('way')); +while ($img = mysql_fetch_assoc($fileq)) $files[] = $img; + +if ($user['priv'] < $apps['file']['upload']) { + $error = "You don't have the rights to upload files."; + $can_upload = false; +} else { + $can_upload = true; +} + +$folders = array(); +$r = sql("SELECT id, name FROM folders WHERE owner = " . $user['id'] . " ORDER BY name ASC"); +while ($f = mysql_fetch_assoc($r)) { + $folders[] = $f; +} + +$can_delete = ($user['priv'] >= $apps['file']['delete'] && $user['id'] != 0); +$can_rename = ($user['priv'] >= $apps['file']['editinfo'] && $user['id'] != 0); + +require("tpl/file/index.php"); |