isLoggedIn()) {
media_loginAndPassThrough();
exit;
}
// check if member is on at least one teamlist
$query = 'SELECT * FROM ' . sql_table('team'). ' WHERE tmember=' . $member->getID();
$teams = mysql_query($query);
if (mysql_num_rows($teams) == 0)
media_doError(_ERROR_DISALLOWEDUPLOAD);
// basic action:
$action = requestVar('action');
switch($action) {
case 'chooseupload':
case _MEDIA_UPLOAD_TO:
case _MEDIA_UPLOAD_NEW:
media_choose();
break;
case 'uploadfile':
media_upload();
break;
case _MEDIA_FILTER_APPLY:
case 'selectmedia':
case _MEDIA_COLLECTION_SELECT:
default:
media_select();
break;
}
// select a file
function media_select() {
global $member, $CONF, $DIR_MEDIA;
media_head();
// show 10 files + navigation buttons
// show msg when no files
// show upload form
// files sorted according to last modification date
// currently selected collection
$currentCollection = requestVar('collection');
if (!$currentCollection || !@is_dir($DIR_MEDIA . $currentCollection))
$currentCollection = $member->getID();
// get collection list
$collections = MEDIA::getCollectionList();
if (sizeof($collections) > 1) {
?>