/** * Create needed arrays for Extension Assignments */ function init_complete_extensions_data() { global $db, $allowed_extensions, $display_categories, $download_modes, $upload_icons; $extension_informations = get_extension_informations(); $allowed_extensions = array(); for ($i = 0, $size = sizeof($extension_informations); $i < $size; $i++) { $extension = strtolower(trim($extension_informations[$i]['extension'])); $allowed_extensions[] = $extension; $display_categories[$extension] = intval($extension_informations[$i]['cat_id']); $download_modes[$extension] = intval($extension_informations[$i]['download_mode']); $upload_icons[$extension] = trim($extension_informations[$i]['upload_icon']); } }
/** * Create needed arrays for Extension Assignments */ function init_complete_extensions_data() { global $allowed_extensions, $display_categories, $download_modes, $upload_icons; if (!($extension_informations = get_extension_informations())) { $extension_informations = $GLOBALS['datastore']->update('attach_extensions'); //get_extension_informations() $extension_informations = get_extension_informations(); } $allowed_extensions = array(); for ($i = 0, $size = sizeof($extension_informations); $i < $size; $i++) { $extension = strtolower(trim($extension_informations[$i]['extension'])); $allowed_extensions[] = $extension; $display_categories[$extension] = intval($extension_informations[$i]['cat_id']); $download_modes[$extension] = intval($extension_informations[$i]['download_mode']); $upload_icons[$extension] = trim($extension_informations[$i]['upload_icon']); } }
$is_auth = array(); $is_auth = auth(AUTH_ALL, $forum_id, $userdata); set_die_append_msg($forum_id, $topic_id); if ($is_auth['auth_download']) { $authorised = TRUE; } } } if (!$authorised) { bb_die($lang['SORRY_AUTH_VIEW_ATTACH']); } $datastore->rm('cat_forums'); // // Get Information on currently allowed Extensions // $rows = get_extension_informations(); $num_rows = count($rows); for ($i = 0; $i < $num_rows; $i++) { $extension = strtolower(trim($rows[$i]['extension'])); $allowed_extensions[] = $extension; $download_mode[$extension] = $rows[$i]['download_mode']; } // Disallowed if (!in_array($attachment['extension'], $allowed_extensions) && !IS_ADMIN) { bb_die(sprintf($lang['EXTENSION_DISABLED_AFTER_POSTING'], $attachment['extension'])); } $download_mode = intval($download_mode[$attachment['extension']]); if ($thumbnail) { $attachment['physical_filename'] = THUMB_DIR . '/t_' . $attachment['physical_filename']; } // Update download count