Open upload.php, find
define('ADMIN_PHP', true);
and below, add
define('REGISTER_PHP', true);
find
$form_array = array(
sprintf($lang_upload_php['max_fsize'], cpg_format_bytes($max_file_size)),
and replace with
if (USER_ID && $USER_DATA['group_quota']) {
if ($disk_usage = mysql_result(cpg_db_query("SELECT ROUND(SUM(total_filesize)/1024) AS disk_usage FROM {$CONFIG['TABLE_PICTURES']} WHERE owner_id = ".USER_ID), 0)) {
$disk_usage_output = '<div style="float: right;"><div style="float: left;">'.$lang_register_php['disk_usage'].': </div><div style="float: left;">'.theme_display_bar($disk_usage, $USER_DATA['group_quota'],150,'', '', '/'.$USER_DATA['group_quota'].' '.$lang_byte_units[1],'red','green').'</div>';
}
}
$form_array = array(
sprintf($lang_upload_php['max_fsize'], cpg_format_bytes($max_file_size)).$disk_usage_output,
find
$max_fsize = sprintf($lang_upload_php['max_fsize'], cpg_format_bytes($max_file_size));
and replace with
global $CONFIG, $USER_DATA, $lang_register_php, $lang_byte_units;
if (USER_ID && $USER_DATA['group_quota']) {
if ($disk_usage = mysql_result(cpg_db_query("SELECT ROUND(SUM(total_filesize)/1024) AS disk_usage FROM {$CONFIG['TABLE_PICTURES']} WHERE owner_id = ".USER_ID), 0)) {
$disk_usage_output = '<div style="float: right;"><div style="float: left;">'.$lang_register_php['disk_usage'].': </div><div style="float: left;">'.theme_display_bar($disk_usage, $USER_DATA['group_quota'],150,'', '', '/'.$USER_DATA['group_quota'].' '.$lang_byte_units[1],'red','green').'</div>';
}
}
$max_fsize = sprintf($lang_upload_php['max_fsize'], cpg_format_bytes($max_file_size)).$disk_usage_output;
For the flash uploader the quota should be updated after each upload IMHO. This isn't implemented yet.