diff options
| author | Horus3 | 2014-04-21 18:35:43 +0200 |
|---|---|---|
| committer | Horus3 | 2014-04-21 18:35:43 +0200 |
| commit | def084a19a19e1d5c77600c0c0967e5a8fed5b93 (patch) | |
| tree | 6b8eb4b3af0decc1d0a48dc9304789f2794fd98a /www/functions/func_folder.php | |
| parent | 2a1a332c4e7625a40008d5c4565fca1bbf062d91 (diff) | |
| download | files.iamfabulous.de-def084a19a19e1d5c77600c0c0967e5a8fed5b93.tar.gz | |
Now you can get a full list of FILES or DIRECTORY from class files. Also changed database layout to log every up- and download.
Diffstat (limited to 'www/functions/func_folder.php')
| -rw-r--r-- | www/functions/func_folder.php | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/www/functions/func_folder.php b/www/functions/func_folder.php index 044fd8e..f389227 100644 --- a/www/functions/func_folder.php +++ b/www/functions/func_folder.php @@ -3,7 +3,7 @@ function database_mkdir($db, $file_id, $new_folder_name, $share){ if($db->exec(" BEGIN TRANSACTION; - INSERT INTO files (id, parent, owner, name, folder, size, share, hash) VALUES (Null, " . $file_id . ", " . $_SESSION['userid'] . ", '" . SQLite3::escapeString($new_folder_name) . "', 'DIRECTORY', 0, '" . SQLite3::escapeString($share) . "', ''); + INSERT INTO files (id, parent, owner, name, folder, size, share, hash, upload, lastseen) VALUES (Null, " . $file_id . ", " . $_SESSION['userid'] . ", '" . SQLite3::escapeString($new_folder_name) . "', 'DIRECTORY', 0, '" . SQLite3::escapeString($share) . "', '', (SELECT strftime('%s', 'now')), (SELECT strftime('%s', 'now'))); COMMIT; ")){ return true; @@ -78,7 +78,7 @@ function move_folder($old_path, $new_path){ if($db->exec(" BEGIN TRANSACTION; - UPDATE files SET parent=".$new_file_id." WHERE id=".$old_file_id."; + UPDATE files SET parent=".$new_file_id.", lastseen=(SELECT strftime('%s', 'now')) WHERE id=".$old_file_id."; COMMIT; ")){ return MV_FOLDER_SUCCESS; @@ -116,7 +116,7 @@ function rename_folder($path, $new_name){ if($db->exec(" BEGIN TRANSACTION; - UPDATE files SET name='".SQLite3::escapeString($new_name)."' WHERE id=".$file_id."; + UPDATE files SET name='".SQLite3::escapeString($new_name)."', lastseen=(SELECT strftime('%s', 'now')) WHERE id=".$file_id."; COMMIT; ")){ return true; |
