Limiting quota for users without a personal album Limiting quota for users without a personal album
 

News:

CPG Release 1.6.27
change DB IP storage fields to accommodate IPv6 addresses
remove use of E_STRICT (PHP 8.4 deprecated)
update README to reflect new website
align code with new .com CPG website
correct deprecation in captcha

Main Menu

Limiting quota for users without a personal album

Started by olandir, January 18, 2007, 06:29:12 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

olandir

I've read both the documentation and several forum posts and have been unable to find an answer to this question.

I have Copermine 1.4.10 integrated with SMF 1.1.1, use post-based groups is set to 1.

I would like to set it so that any registered user can post to the public gallery, and when they reach a certain post-based group level, they get options like a personal album. However, I have read in the documentation that in order to set a quota for user groups, they have to have a personal album.

This does that make sense to me. Essentially the documentation reads that users without a personal album automatically have unlimited quota, which I certainly don't want. I need to be able to restrict these users as well so that they are limited to what they can post in the public albums.

Please let me know if I am missing any piece of information. As I said, I've read everything I can find and I've seen no one address this yet.


Nibbler

You can change the quota check to do that, find in include/picmgmt.inc.php

$result = cpg_db_query("SELECT sum(total_filesize) FROM {$CONFIG['TABLE_PICTURES']}, {$CONFIG['TABLE_ALBUMS']} WHERE  {$CONFIG['TABLE_PICTURES']}.aid = {$CONFIG['TABLE_ALBUMS']}.aid AND category = '" . (FIRST_USER_CAT + USER_ID) . "'");

change to

$result = cpg_db_query("SELECT sum(total_filesize) FROM {$CONFIG['TABLE_PICTURES']} WHERE owner_id = " . USER_ID);

olandir

Just so I'm 100% clear, if I make this change, that means that even users without a personal album will adhear to whatever quota I set?

Nibbler

The limit will apply to all the user's files, not just those in their user gallery.