Limit upload plugin for cpg1.5.x - Page 2 Limit upload plugin for cpg1.5.x - Page 2
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

Limit upload plugin for cpg1.5.x

Started by Αndré, July 06, 2010, 03:13:32 PM

Previous topic - Next topic

0 Members and 3 Guests are viewing this topic.

Αndré

I haven't tested that, but it should work if you set the multiplier
        switch($CONFIG['limit_upload_time_limit']) {
            // TODO: determine beginning of current hour/day/week/month/year and adjust the calculation
            case 'total': $multiplicator = -1; break;
            case 'hour': $multiplicator = 1; break;
            case 'day': $multiplicator = 24; break;
            case 'week': $multiplicator = 7*24; break;
            case 'month': $multiplicator = 30*24; break;
            case 'year': $multiplicator = 365*24; break;
            default: $multiplicator = false; break;
        }

to 3*24 or 72:
$multiplicator = 3*24;
in codebase.php.

guygar

ok! I have modified and installed the plugin.

Now I have to wait 3 days to see if it is working.

Cannot happen sooner as I need to test it against the time period.

Thanks.

jmcreis

I think there is a problem.
The plugin adds the uploads to the comments made ​​by the same user.
So if the max upload is set at 4 per day and the user has two comments, he can only send two photos that day (24 hours)
Sorry for my bad English but I think you will understand what i say

jmcreis

Here is the portuguese lang for the plugin

Αndré

Portuguese language file has been added in svn revision 8203. Thanks for your contribution.

jmcreis

The problem i reported is solved. Was my fault. Sorry guys.

jmcreis

Well here I am again. And I´m very sorry. Please excuse me my friend André.
Thats the story:
First of all I instaled the plugin and asked users to test. They report a problem between number of files uploaded and comments, so that was the reason of my first topic reply.
Then I tryed miself and all was fine for me. Then my second reply saying that problem was solved. I forgot I had administrator premissions.  :-[ Sorry fellows !!
But the reports from users continue and i tryed it myself again, now without administrator power.
This is what I did:
1 - I made a lot of comments in user's pics without any problem.
2 - Then I uploaded my own files till the limit (till I received the error message: You\'ve reached the upload limit...)
3 - After this I tried to comment another pic and I received the same error message again (You\'ve reached the upload limit...) and I couldn't make more comments.
Can anybody try the same way i did ?


jmcreis

Thanks André.
Do you mean I must use the plugin and the mod at same time ?

jmcreis

WOW
Sorry again André
I made the mod in codebase.php.
I'll give feedback later. Thanks once more

Αndré

Version 1.0 (attached to initial post) contains the suggested fix.

NoDigital

Hello everybody.
In attachment the italian translation for this very useful plugin.
I'd like to use it to manage an on-line contest with 2 themes: I created 2 public galleries - one per each theme - and I need to limit the upload to 4 images per each gallery.
How/where to modify this plugi to obtain it?

Thanks in advance, any help is appreciated.

Αndré

Quote from: NoDigital on March 19, 2012, 01:05:39 AM
In attachment the italian translation for this very useful plugin.
Thank you for your contribution. Added Italian language file (with some fixes) in SVN revision 8341.


Quote from: NoDigital on March 19, 2012, 01:05:39 AM
I need to limit the upload to 4 images per each gallery.
How/where to modify this plugi to obtain it?
You don't need to modify the plugin, just set it accordingly in the plugin config.

heavensportal

I am using this to limit my members to 5 images a day. I have not really had admins tell me they can not do more than 5 a day since I am the only one to do so thus far--via ftp

But is there a way to either make a group in SMF (bridged) that will allow the member of that group to not be limited or in gallery to have the group not be limited.

It would be only that  member that uploads images of our winners which are more than 5 and her own images also.

I will ask at SMF also about the "special" group.

heavensportal

well got word from SMF that there is no way to make an admin clone group so, Is there anyway to adjust the modification (plugin in) to disallow the global admins group or a different specific group?

Αndré

Quote from: heavensportal on March 02, 2014, 03:40:29 AM
It would be only that  member that uploads images of our winners which are more than 5 and her own images also.

If it's only one (or a few) users, you could also add a simple check like
if (USER_ID == 123) return;
to the top of the function limit_upload_page_start in codebase.php. This way you don't need to add those user(s) to a separate group, as you just check the user ID.

heavensportal

thank you so very much with your help to these little things I ask for.

Will give it a try and hope I put it in the right spot.

heavensportal

ok I did as you said--providing I put it in the right spot

this is the code as it appears in that file:

if (defined('DB_INPUT_PHP')) {
    $thisplugin->add_action('page_start', 'limit_upload_page_start') ;
if (USER_ID == 1080) return;
}

Αndré

Unfortunately that's the wrong place. Please undo your last change, instead search for
function limit_upload_page_start() {
and add the code below that line.

PavvelB

Hi.
I have some question about this plugin. Is it possible to apply the limit only for some galleries? My situation looks (or will look, I'm testing cpg on my local computer :) ) like this: there are some categories like Nature, Portrait available for all users, and I would like to limit the file numbers added in preiod of time to this categories. Every user has his personal gallery and could have possibility to add more pictures at once without waiting. But on the other hand I would like to limit all personal galleries to, for example, 40 pictures. Is it possible with your plugin?
As a small "gift" polish version :)