Exemple #1
0
$zip_files_array = array();
// alternate CSS buttons when selected in configuration
$status_color_hot = $jlistConfig['css.button.color.hot'];
$status_color_new = $jlistConfig['css.button.color.new'];
$status_color_updated = $jlistConfig['css.button.color.updated'];
$download_color = $jlistConfig['css.button.color.download'];
$download_size = $jlistConfig['css.button.size.download'];
$download_size_mirror = $jlistConfig['css.button.size.download.mirror'];
$download_color_mirror1 = $jlistConfig['css.button.color.mirror1'];
$download_color_mirror2 = $jlistConfig['css.button.color.mirror2'];
if (JDHelper::checkGroup('8', true) || JDHelper::checkGroup('7', true)) {
    $is_admin = true;
}
// build random value for zip filename
if (count($files) > 1) {
    $user_random_id = JDHelper::buildRandomNumber();
}
// we need the filed id when not used checkboxes
if (!$marked_files_id) {
    $marked_files_id = array($fileid);
}
$marked_files_id_string = implode(',', $marked_files_id);
// We must compute up to this point, what this user has downloaded before and compare it then later with the defined user limitations
// Important: Please note, that we can check it only for registered users. By visitors it is not really useful, then we have here only a changeable IP.
$total_consumed = JDHelper::getUserLimits($user_rules, $marked_files_id);
// When $total_consumed['limits_info'] has a value, we must check whether this user may download the selected files
// If so, then the result is: TRUE - otherwise: the limitations message
// Has $total_consumed['limits_info'] not any value, it exists not any limitations for this user
if ($total_consumed['limits_info']) {
    $may_download = JDHelper::checkUserDownloadLimits($user_rules, $total_consumed, $sum_selected_files, $sum_selected_volume, $marked_files_id);
} else {