Advanced search  

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

Pages: 1 [2]   Go Down

Author Topic: 1 pic per user...  (Read 20961 times)

0 Members and 1 Guest are viewing this topic.

ymca

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 79
Re: 1 pic per user...
« Reply #20 on: June 01, 2006, 07:50:49 pm »

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

ymca

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 79
Re: 1 pic per user...
« Reply #21 on: June 26, 2006, 11:56:43 pm »

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

Stramm

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 6006
    • Bettis Wollwelt
Re: 1 pic per user...
« Reply #22 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

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

ymca

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 79
Re: 1 pic per user...
« Reply #23 on: August 04, 2006, 08:56:54 am »

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-

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

Stramm

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 6006
    • Bettis Wollwelt
Re: 1 pic per user...
« Reply #24 on: August 04, 2006, 09:15:55 am »

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

ymca

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 79
Re: 1 pic per user...
« Reply #25 on: August 04, 2006, 09:21:01 am »

thank you
Logged

treret

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 23
Re: 1 pic per user...
« Reply #26 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.     
Logged

Oracle9

  • Coppermine newbie
  • Offline Offline
  • Posts: 15
Re: 1 pic per user...
« Reply #27 on: October 24, 2007, 07:52:45 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
Logged

Sami

  • VIP
  • Coppermine addict
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 3686
  • BMossavari
    • My Project
Re: 1 pic per user...
« Reply #28 on: October 25, 2007, 11:04:42 am »

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

Oracle9

  • Coppermine newbie
  • Offline Offline
  • Posts: 15
Re: 1 pic per user...
« Reply #29 on: November 01, 2007, 10:30:40 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
Logged

Stramm

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 6006
    • Bettis Wollwelt
Re: 1 pic per user...
« Reply #30 on: November 01, 2007, 11:06:23 am »

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

Code: [Select]
    // 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

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 23
Re: 1 pic per user...
« Reply #31 on: November 01, 2007, 08:05:10 pm »

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

Stramm

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 6006
    • Bettis Wollwelt
Re: 1 pic per user...
« Reply #32 on: November 01, 2007, 08:19:57 pm »

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

  • Coppermine newbie
  • Offline Offline
  • Posts: 4
Re: 1 pic per user...
« Reply #33 on: August 21, 2009, 08:01:45 pm »

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

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: 1 pic per user...
« Reply #34 on: August 23, 2009, 09:14:53 am »

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

Page created in 0.024 seconds with 20 queries.