1 pic per user... - Page 2 1 pic per user... - Page 2
 

News:

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

Main Menu

1 pic per user...

Started by ymca, May 29, 2006, 01:33:55 PM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

ymca

I think that the problem is related to the other problem
that after i did change the need approve to "no" it gave me -
The selected album/file does not exist !
but still the pic did go to the albom.

ymca

Stramm...

i have also tried to make the Quota:1
but still i can upload 2 pictures.
do you know if the problem is from another file that is linked to the picmgmt.inc.php ?

Stramm

cause someone else on the german support board asked this question too and had similar problems...
Coppermine (standard behaviour) checks limitations only for the user galleries and not pics of a user in the public galleries. So does this hack. To change the behaviour and allow users only to upload a certain number of pics to public and user galleries you'll have to change the query eg. to

        $result = cpg_db_query("SELECT pid FROM {$CONFIG['TABLE_PICTURES']} WHERE owner_name = '" . (USER_NAME) . "'");

ymca

thnx... its working
i tried to upload a pic after i had 1 already, i got to the choose gallery & after that it gave me-

QuoteYou have already uploaded a pic

You have a limit quota of 1pictures, your files currently use 0K, adding this file would make you exceed your quota.
the "0K" is ok ?

Stramm

The message depends on what you've set in the lang file.

ymca


treret

It works,

but

I want to allow 2 photos and no more, so I change

        if ($total_space_used > 1 ) {     

to

        if ($total_space_used > 2 ) {

It doesn't work and users can upload 3 or more files.

What it doesn't work?

Thanks.     

Oracle9

Quote from: treret on October 22, 2007, 06:50:29 PM
It works,

but

I want to allow 2 photos and no more, so I change

        if ($total_space_used > 1 ) {     

to

        if ($total_space_used > 2 ) {

It doesn't work and users can upload 3 or more files.

What it doesn't work?

Thanks.     


I got the same error , did you find why ?
Regards

Sami

it should works , unless you're uploading as an admin
‍I don't answer to PM with support question
Please post your issue to related board

Oracle9

Quote from: Sami on October 25, 2007, 11:04:42 AM
it should works , unless you're uploading as an admin
Thanks Sami for your replay but I loged as a user not Admin , and have the same issue , I tried the select statment on MySQL  and it work fine , but  after adding it to the php , it work only with :  if ($total_space_used > 1 )s

Regards

Stramm

use that instead... it uses the limits from the group control panel as number of files instead of kb

    // Test if disk quota exceeded
    if (!GALLERY_ADMIN_MODE && $USER_DATA['group_quota'] && $category == FIRST_USER_CAT + USER_ID) {
        $result = cpg_db_query("SELECT 1 FROM {$CONFIG['TABLE_PICTURES']}, {$CONFIG['TABLE_ALBUMS']} WHERE  {$CONFIG['TABLE_PICTURES']}.aid = {$CONFIG['TABLE_ALBUMS']}.aid AND category = '" . (FIRST_USER_CAT + USER_ID) . "'");
        $total_space_used = mysql_num_rows($result);
        mysql_free_result($result);

        if (($total_space_used) >= $USER_DATA['group_quota'] ) {

treret

I set In GROUP Diisc Quota = 12 for registered.

I Login with different usernane as a registered user, who already has 12 images.

I uploaded the 13th image without problem.

It seems to me that the mod doesn't work.

Stramm

Quote from: Stramm on August 04, 2006, 08:20:23 AM
cause someone else on the german support board asked this question too and had similar problems...
Coppermine (standard behaviour) checks limitations only for the user galleries and not pics of a user in the public galleries. So does this hack. To change the behaviour and allow users only to upload a certain number of pics to public and user galleries you'll have to change the query eg. to

Prometheus

Phew! After searching really hard I managed to find this thread. Was worth the effort as it works flawlessly. Thanks, though it would have been great is someone had pointed me to this thread in the first place. :)

Joachim Müller

Thanks for your review.
This thread hasn't made it into the mods board because it contained too much personall issues of the thread starter. You might want to summarize the mod instructions into a posting in a new thread so it could be moved into the mods board. Ideally, this could be done as a plugin.