diff --git a/.gitignore b/.gitignore index 5f0bc30..496f39d 100644 --- a/.gitignore +++ b/.gitignore @@ -15,7 +15,7 @@ uploads/thumbs/* !uploads/thumbs/.htaccess styles/* !styles/bootstrap/* -!styles/default/* +!/styles/bootstrap/js/script.js !styles/index.html .DS_Store */.DS_Store diff --git a/do.php b/do.php index e8f1596..ffb73f8 100755 --- a/do.php +++ b/do.php @@ -31,7 +31,7 @@ if (ig('id') || ig('filename')) is_array($plugin_run_result = Plugins::getInstance()->run('begin_download_id_filename', get_defined_vars())) ? extract($plugin_run_result) : null; //run hook $query = [ - 'SELECT' => 'f.id, f.real_filename, f.name, f.folder, f.size, f.time, f.uploads, f.type', + 'SELECT' => 'f.id, f.real_filename, f.about, f.name, f.folder, f.size, f.time, f.uploads, f.type', 'FROM' => "{$dbprefix}files f", 'LIMIT' => '1', ]; @@ -84,13 +84,23 @@ if (ig('id') || ig('filename')) $size = $file_info['size']; $time = $file_info['time']; $uploads = $file_info['uploads']; + $about_file = ! in_array($file_info['about'], ['', null]) ? $file_info['about'] : $lang['FILE_NO_INFO']; - $fname2 = str_replace('.', '-', htmlspecialchars($name)); - $name = $real_filename != '' ? str_replace('.' . $type, '', htmlspecialchars($real_filename)) : $name; - $name = strlen($name) > 70 ? substr($name, 0, 70) . '...' : $name; - $fusername = $config['user_system'] == 1 && $file_info['fuserid'] > -1 ? $file_info['fusername'] : false; - $userfolder = $config['siteurl'] . ($config['mod_writer'] ? 'fileuser-' . $file_info['fuserid'] . '.html' : 'ucp.php?go=fileuser&id=' . $file_info['fuserid']); + $fname2 = str_replace('.', '-', htmlspecialchars($name)); + $name = $real_filename != '' ? str_replace('.' . $type, '', htmlspecialchars($real_filename)) : $name; + $name = strlen($name) > 70 ? substr($name, 0, 70) . '...' : $name; + $fusername = $config['user_system'] == 1 && $file_info['fuserid'] > -1 ? $file_info['fusername'] : false; + $userfolder = $config['siteurl'] . ($config['mod_writer'] ? 'fileuser-' . $file_info['fuserid'] . '.html' : 'ucp.php?go=fileuser&id=' . $file_info['fuserid']); + $isFileOwnerOfFounder = $fusername == $usrcp->name() || $usrcp->get_data('founder')['founder'] == 1; + + if (ip('change_file_about') && $isFileOwnerOfFounder) + { + $newAbout = (String) p('about') != '' ? (string) p('about') : null; + $SQL->query("UPDATE {$dbprefix}files SET about = \"{$newAbout}\" WHERE id = {$file_info['id']}"); + + exit; + } if (ig('filename')) { diff --git a/includes/version.php b/includes/version.php index 9489f25..5e1dd54 100755 --- a/includes/version.php +++ b/includes/version.php @@ -16,9 +16,9 @@ if (! defined('IN_COMMON')) -define('KLEEJA_VERSION', '3.1.6'); +define('KLEEJA_VERSION', '3.1.7'); -define('KLEEJA_DB_VERSION', '9'); +define('KLEEJA_DB_VERSION', '10'); // Kleeja min requirements define('MIN_PHP_VERSION', '7.0'); diff --git a/install/includes/update_schema.php b/install/includes/update_schema.php index ec83705..93acfe4 100755 --- a/install/includes/update_schema.php +++ b/install/includes/update_schema.php @@ -32,3 +32,7 @@ $update_schema[9]['sql'] = [ // function () { // }, // ]; + +$update_schema[10]['sql'] = [ + 'about_files' => "ALTER TABLE `{$dbprefix}files` ADD `about` LONGTEXT NULL DEFAULT NULL AFTER `real_filename`;", +]; \ No newline at end of file diff --git a/lang/ar/common.php b/lang/ar/common.php index 2b2e346..0d2e008 100755 --- a/lang/ar/common.php +++ b/lang/ar/common.php @@ -279,4 +279,7 @@ return [ 'EMAIL_CHANGE_REQ_PASS' => 'لتغيير بريدك الإلكتروني يجب أن تقوم بكتابة كلمة مرورك الحالية.', 'DRAG_AND_DROP' => 'جر وأسقط ملف هنا للرفع…', 'OR_MANUAL_SELECT' => 'أو قم بالضغط هنا لإختيار ملف يدوياً..', + 'ABOUT_FILE' => 'معلومات الملف', + 'FILE_NO_INFO' => 'لم يتم العثور على معلومات حول هذا الملف', + 'SAVE' => 'حفظ', ]; diff --git a/lang/en/common.php b/lang/en/common.php index 48ac639..fa47442 100755 --- a/lang/en/common.php +++ b/lang/en/common.php @@ -282,4 +282,7 @@ return [ 'EMAIL_CHANGE_REQ_PASS' => 'In order to change your email address, It\'s required to type your current password.', 'DRAG_AND_DROP' => 'Drop a file inside…', 'OR_MANUAL_SELECT' => 'Or click here to Select a file manually..', + 'ABOUT_FILE' => 'File Information', + 'FILE_NO_INFO' => 'No Information found about this file', + 'SAVE' => 'Save', ]; diff --git a/styles/bootstrap/download.html b/styles/bootstrap/download.html index 4cd1e0d..f4fc3dc 100755 --- a/styles/bootstrap/download.html +++ b/styles/bootstrap/download.html @@ -64,6 +64,26 @@ +
{about_file}
+