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) { ?>
0) { if (($offset + $CONF['MediaPerPage']) >= sizeof($arr)) $offset = sizeof($arr) - $CONF['MediaPerPage']; if ($offset < 0) $offset = 0; $idxStart = $offset; $idxEnd = $offset + $CONF['MediaPerPage']; $idxNext = $idxEnd; $idxPrev = $idxStart - $CONF['MediaPerPage']; if ($idxPrev < 0) $idxPrev = 0; if ($idxEnd > sizeof($arr)) $idxEnd = sizeof($arr); for($i=$idxStart;$i<$idxEnd;$i++) { $obj = $arr[$i]; $filename = $DIR_MEDIA . $currentCollection . '/' . $obj->filename; $old_level = error_reporting(0); $size = @GetImageSize($filename); error_reporting($old_level); $width = $size[0]; $height = $size[1]; $filetype = $size[2]; echo ""; echo ""; if ($filetype != 0) { // image (gif/jpg/png/swf) echo ""; } else { // no image (e.g. mpg) echo ""; } echo ''; echo ''; } } // if (sizeof($arr)>0) ?>
". date("Y-m-d",$obj->timestamp) ."" . htmlspecialchars(shorten($obj->filename,25,'...')) .""; echo ' (',_MEDIA_VIEW,')'; echo "" . htmlspecialchars(shorten($obj->filename,30,'...')) ."' , $width , 'x' , $height , '
0) echo "". _LISTS_PREV." "; if ($idxEnd < sizeof($arr)) echo "". _LISTS_NEXT." "; ?>

File:
1) { ?>




$CONF['MaxUploadSize']) media_doError(_ERROR_FILE_TOO_BIG); // check file type against allowed types $ok = 0; $allowedtypes = explode (',', $CONF['AllowedTypes']); foreach ( $allowedtypes as $type ) if (eregi("\." .$type. "$",$filename)) $ok = 1; if (!$ok) media_doError(_ERROR_BADFILETYPE); if (!is_uploaded_file($filetempname)) media_doError(_ERROR_BADREQUEST); // prefix filename with current date (YYYY-MM-DD-) // this to avoid nameclashes if ($CONF['MediaPrefix']) $filename = strftime("%Y%m%d-", time()) . $filename; $collection = requestVar('collection'); $res = MEDIA::addMediaObject($collection, $filetempname, $filename); if ($res != '') media_doError($res); // shows updated list afterwards media_select(); } function media_loginAndPassThrough() { media_head(); ?>

:
:

Nucleus Media