Support > cpg1.6 plugin contributions
Limit upload plugin for cpg1.6.x
Αndré:
This is the cpg1.6.x and PHP7 compatible version of the Limit upload plugin.
--- Quote from: Αndré on July 06, 2010, 03:13:32 pm ---This plugin allows you to limit the number of uploads for your users. You can choose a total number of files, or a certain amount of files for different periods of time.
--- End quote ---
lurkalot:
Thank you Andre. I uninstalled the old one, and went to install this new one, unfortunately it gives me this error when I try.
Critical error
There was an error while processing a database query.
While executing query 'INSERT INTO cpg_config (name, value) VALUES ('limit_upload_upload_limit', '-1')' in plugins/limit_upload/codebase.php on line 96
database error: 1062 : Duplicate entry 'limit_upload_upload_limit' for key 'PRIMARY'
File: /hxxxx/cxxxxxxx/public_html/gallery/include/functions.inc.php - Line: 250
Αndré:
I'll fix that soon.
lurkalot:
--- Quote from: Αndré on November 28, 2018, 09:18:37 am ---I'll fix that soon.
--- End quote ---
Thanks Andre.
Αndré:
There's nothing to fix in the plugin, as the config values will be deleted when uninstalling the plugin (that function existed since the very first version):
--- Code: ---$thisplugin->add_action('plugin_uninstall', 'limit_upload_uninstall');
function limit_upload_uninstall () {
global $CONFIG;
cpg_db_query("DELETE FROM {$CONFIG['TABLE_CONFIG']} WHERE name = 'limit_upload_upload_limit'");
cpg_db_query("DELETE FROM {$CONFIG['TABLE_CONFIG']} WHERE name = 'limit_upload_time_limit'");
return true;
}
--- End code ---
For whatever reason they haven't been deleted in your gallery (maybe missing permissions to use the DELETE command?). To get the plugin installed, either delete the rows "limit_upload_upload_limit" and "limit_upload_time_limit" from your config table with phpMyAdmin, or adjust those lines in codebase.php:
--- Code: --- cpg_db_query("INSERT INTO {$CONFIG['TABLE_CONFIG']} (name, value) VALUES ('limit_upload_upload_limit', '-1')");
cpg_db_query("INSERT INTO {$CONFIG['TABLE_CONFIG']} (name, value) VALUES ('limit_upload_time_limit', 'total')");
--- End code ---
(either commend them out or replace INSERT with REPLACE).
Navigation
[0] Message Index
[#] Next page
Go to full version