Advanced search  

News:

cpg1.5.46 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter recently discovered vulnerabilities. It is important that all users who run version cpg1.5.44 or older update to this latest version as soon as possible.
[more]

Pages: 1 [2] 3   Go Down

Author Topic: Limit upload plugin for cpg1.5.x  (Read 21490 times)

0 Members and 1 Guest are viewing this topic.

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15369
Re: Limit upload plugin for cpg1.5.x
« Reply #20 on: April 06, 2011, 04:52:49 pm »

I haven't tested that, but it should work if you set the multiplier
Code: [Select]
        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:
Code: [Select]
$multiplicator = 3*24;in codebase.php.
Logged

guygar

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 26
Re: Limit upload plugin for cpg1.5.x
« Reply #21 on: April 06, 2011, 05:30:58 pm »

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.
Logged

jmcreis

  • Coppermine novice
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 36
Re: Limit upload plugin for cpg1.5.x
« Reply #22 on: May 17, 2011, 12:22:32 am »

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
Logged

jmcreis

  • Coppermine novice
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 36
Re: Limit upload plugin for cpg1.5.x
« Reply #23 on: May 17, 2011, 12:29:22 am »

Here is the portuguese lang for the plugin
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15369
Re: Limit upload plugin for cpg1.5.x
« Reply #24 on: May 17, 2011, 10:18:32 am »

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

jmcreis

  • Coppermine novice
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 36
Re: Limit upload plugin for cpg1.5.x
« Reply #25 on: May 19, 2011, 01:55:18 pm »

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

jmcreis

  • Coppermine novice
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 36
Re: Limit upload plugin for cpg1.5.x
« Reply #26 on: May 20, 2011, 11:33:29 am »

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 ?
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15369
Logged

jmcreis

  • Coppermine novice
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 36
Re: Limit upload plugin for cpg1.5.x
« Reply #28 on: May 20, 2011, 12:03:58 pm »

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

jmcreis

  • Coppermine novice
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 36
Re: Limit upload plugin for cpg1.5.x
« Reply #29 on: May 20, 2011, 12:20:37 pm »

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

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15369
Re: Limit upload plugin for cpg1.5.x
« Reply #30 on: May 20, 2011, 03:25:10 pm »

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

NoDigital

  • Coppermine newbie
  • Offline Offline
  • Posts: 1
Re: Limit upload plugin for cpg1.5.x
« Reply #31 on: March 19, 2012, 01:05:39 am »

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.
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15369
Re: Limit upload plugin for cpg1.5.x
« Reply #32 on: March 19, 2012, 09:46:22 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.


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.
Logged

heavensportal

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 240
    • The Fantasy Attic
Limit UPload plugin
« Reply #33 on: March 02, 2014, 03:40:29 am »

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.
Logged

heavensportal

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 240
    • The Fantasy Attic
Re: Limit UPload plugin
« Reply #34 on: March 03, 2014, 03:42:42 am »

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?
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15369
Re: Limit UPload plugin
« Reply #35 on: March 03, 2014, 09:27:11 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
Code: [Select]
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.
Logged

heavensportal

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 240
    • The Fantasy Attic
Re: Limit upload plugin for cpg1.5.x
« Reply #36 on: March 03, 2014, 11:49:36 pm »

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.
Logged

heavensportal

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 240
    • The Fantasy Attic
Re: Limit upload plugin for cpg1.5.x
« Reply #37 on: March 04, 2014, 02:26:34 am »

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;
}
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15369
Re: Limit upload plugin for cpg1.5.x
« Reply #38 on: March 04, 2014, 08:53:29 am »

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

PavvelB

  • Coppermine newbie
  • Offline Offline
  • Posts: 3
Re: Limit upload plugin for cpg1.5.x
« Reply #39 on: December 07, 2014, 04:41:29 pm »

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 :)
Logged
Pages: 1 [2] 3   Go Up
 

Page created in 0.021 seconds with 20 queries.