NetVision-Technik

Zur?ck   NetVision-Technik > Forum > NetVision-Technik > Off-Topic

Off-Topic Hier ist die allgemeine Plauder-Ecke. Alles, was sonst nirgends reinpasst kommt hier rein

Antwort
 
Themen-Optionen Ansicht
Alt 21.10.2011, 12:51   #1
Stifler
König
Punkte: 39.887, Level: 100 Punkte: 39.887, Level: 100 Punkte: 39.887, Level: 100
Levelaufstieg: 0% Levelaufstieg: 0% Levelaufstieg: 0%
Aktivität: 0% Aktivität: 0% Aktivität: 0%
Letzte Erfolge
Auszeichnungen
 
Benutzerbild von Stifler
 
Registriert seit: 14.02.2011
Ort: Graz
Alter: 40
Beitr?ge: 1.495
Abgegebene Danke: 82
Erhielt 200 Danke für 37 Beiträge
Downloads: 11
Uploads: 0
Nachrichten: 6230
Renommee-Modifikator:
3169 Stifler genießt hohes AnsehenStifler genießt hohes AnsehenStifler genießt hohes AnsehenStifler genießt hohes AnsehenStifler genießt hohes AnsehenStifler genießt hohes AnsehenStifler genießt hohes AnsehenStifler genießt hohes AnsehenStifler genießt hohes AnsehenStifler genießt hohes AnsehenStifler genießt hohes Ansehen
Standard

Kleine Anregung wie ich dass mit erlaubten Files mache, läuft übrigens über den Mimetype!

HTML-Code:
CREATE TABLE IF NOT EXISTS `mime_types` (
  `id` int(11) NOT NULL auto_increment,
  `mimetype` varchar(255) NOT NULL default '',
  `name` varchar(255) NOT NULL default '',
  `modul` enum('gallery','downloads','usergallery','mailcenter','homepage','forum','contest','document','store','video','screenshot') default NULL,
  `tool` enum('mediaplayer','quicktime','realplayer','flash','divx') default NULL,
  `image` varchar(20) NOT NULL default '',
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=95 ;

INSERT INTO `mime_types` (`id`, `mimetype`, `name`, `modul`, `tool`, `image`) VALUES
(90, 'image/gif', 'GIF-Dateien', 'screenshot', '', 'gif'),
(91, 'image/jpeg', 'JPEG-Dateien', 'screenshot', '', 'jpg'),
(92, 'image/pjpeg', 'JPEG-Dateien', 'screenshot', '', 'jpg'),
(93, 'image/x-png', 'PNG-Dateien', 'screenshot', '', 'png');
Beispiel bei screenshots upload
PHP-Code:
foreach($_FILES as $key => $value) {

$file $value['name'];
$temp $value['tmp_name'];
$size $value['size'];
$type $value['type'];
$error $value['error'];

if(!
$error) {

if(
substr($key,0,strlen("file_")) == "file_" && substr($type,0,strlen("image")) == "image") {

$maxsize $screenshot_img_size*1024;

$file_ending explode(".",$file);
$file_ending[1] = strtolower(end($file_ending));

$mime_types mysql_query("SELECT * FROM mime_types WHERE modul='screenshot' AND mimetype='$type'");
$row_mt mysql_num_rows($mime_types);

if(
$row_mt == "0") {
print 
tplprint(tplload("templates/error/error31.html"),array(
"COMMUNITY_NAME" => $community_name,
"ADSERVER" => adserver("tracker"),
"NICK" => $nick,
"MENU" => navigation(),
"LOGO" => logo(),
"INFO" => info()));
exit();
}
elseif((
$mode && $size $maxsize) || $size == "0") {
print 
tplprint(tplload("templates/error/error32.html"),array(
"COMMUNITY_NAME" => $community_name,
"ADSERVER" => adserver("tracker"),
"NICK" => $nick,
"MAXSIZE" => $screenshot_img_size,
"MENU" => navigation(),
"LOGO" => logo(),
"INFO" => info()));
exit();
}

$query_filename mysql_query("SELECT * FROM screenshots WHERE modul='tracker' ORDER BY 'id' DESC");
$result_filename mysql_fetch_array($query_filename);

$file_ending_2 explode(".",$result_filename[filename]);
$file_ending_2[1] = strtolower($file_ending_2[1]);

$new_filename $file_ending_2[0]+1;

$filename $new_filename.".".$file_ending[1];

CreateImage($screenshot_img_width,$screenshot_img_height,$temp,"images/screenshots/tracker/thumbnails/".$filename,$border=0);
CreateImage($screenshot_img_width2,$screenshot_img_height2,$temp,"images/screenshots/tracker/".$filename,$border=0);

mysql_query("INSERT INTO screenshots (id,id_2,owner,filename,realname,modul) VALUES('','$id','$nick','$filename','$file','tracker')");

$k++;

}

}



Anzeige von "Welche MimeTypen sind erlaubt"

PHP-Code:
<?

$types = array(
// Application
'ai'     => 'application/postscript',
'bcpio' => 'application/x-bcpio',
'bin'   => 'application/octet-stream',
'ccad'  => 'application/clariscad',
'cdf'   => 'application/x-netcdf',
'class' => 'application/octet-stream',
'cpio'  => 'application/x-cpio',
'cpt'   => 'application/mac-compactpro',
'csh'   => 'application/x-csh',
'dcr'   => 'application/x-director',
'dir'   => 'application/x-director',
'dms'   => 'application/octet-stream',
'doc'   => 'application/msword',
'drw'   => 'application/drafting',
'dvi'   => 'application/x-dvi',
'dwg'   => 'application/acad',
'dxf'   => 'application/dxf',
'dxr'   => 'application/x-director',
'eps'   => 'application/postscript',
'exe'   => 'application/octet-stream',
'ez'    => 'application/andrew-inset',
'gtar'  => 'application/x-gtar',
'gz'    => array('application/x-gzip','application/gzip-compressed'),
'hdf'   => 'application/x-hdf',
'hqx'   => 'application/mac-binhex40',
'ips'   => 'application/x-ipscript',
'ipx'   => 'application/x-ipix',
'js'    => 'application/x-javascript',
'latex' => 'application/x-latex',
'lha'   => 'application/octet-stream',
'lsp'   => 'application/x-lisp',
'lzh'   => 'application/octet-stream',
'man'   => 'application/x-troff-man',
'me'    => 'application/x-troff-me',
'mif'   => 'application/vnd.mif',
'ms'    => 'application/x-troff-ms',
'nc'    => 'application/x-netcdf',
'oda'   => 'application/oda',
'pdf'   => 'application/pdf',
'pgn'   => 'application/x-chess-pgn',
'pot'   => 'application/mspowerpoint',
'pps'   => 'application/mspowerpoint',
'ppt'   => 'application/mspowerpoint',
'ppz'   => 'application/mspowerpoint',
'pre'   => 'application/x-freelance',
'prt'   => 'application/pro_eng',
'ps'    => 'application/postscript',
'rar'   => 'application/x-rar-compressed',
'roff'  => 'application/x-troff',
'scm'   => 'application/x-lotusscreencam',
'set'   => 'application/set',
'sh'    => 'application/x-sh',
'shar'  => 'application/x-shar',
'sit'   => 'application/x-stuffit',
'skd'   => 'application/x-koan',
'skm'   => 'application/x-koan',
'skp'   => 'application/x-koan',
'skt'   => 'application/x-koan',
'smi'   => 'application/smil',
'smil'  => 'application/smil',
'sol'   => 'application/solids',
'spl'   => 'application/x-futuresplash',
'src'   => 'application/x-wais-source',
'step'  => 'application/STEP',
'stl'   => 'application/SLA',
'stp'   => 'application/STEP',
'sv4cpio' => 'application/x-sv4cpio',
'sv4crc'  => 'application/x-sv4crc',
'swf'   => 'application/x-shockwave-flash',
't'     => 'application/x-troff',
'tar'   => 'application/x-tar',
'tcl'   => 'application/x-tcl',
'tex'   => 'application/x-tex',
'texi'  => 'application/x-texinfo',
'texinfo' => 'application/x-texinfo',
'tr'    => 'application/x-troff',
'tsp'   => 'application/dsptype',
'unv'   => 'application/i-deas',
'ustar' => 'application/x-ustar',
'vcd'   => 'application/x-cdlink',
'vda'   => 'application/vda',
'xlc'   => array('application/vnd.ms-excel', 'application/msexcel'),
'xll'   => array('application/vnd.ms-excel', 'application/msexcel'),
'xlm'   => array('application/vnd.ms-excel', 'application/msexcel'),
'xls'   => array('application/vnd.ms-excel', 'application/msexcel'),
'xlw'   => array('application/vnd.ms-excel', 'application/msexcel'),
'zip'   => array('application/zip', 'application/x-zip-compressed'),
// Audio
'aif'  => 'audio/x-aiff',
'aifc' => 'audio/x-aiff',
'aiff' => 'audio/x-aiff',
'au'   => 'audio/basic',
'kar'  => array('audio/midi','audio/x-midi'),
'mid'  => array('audio/midi','audio/x-midi'),
'midi' => array('audio/midi','audio/x-midi'),
'mp2'  => 'audio/mpeg',
'mp3'  => 'audio/mpeg',
'mpga' => 'audio/mpeg',
'ra'   => 'audio/x-realaudio',
'ram'  => 'audio/x-pn-realaudio',
'rm'   => 'audio/x-pn-realaudio',
'rpm'  => 'audio/x-pn-realaudio-plugin',
'snd'  => 'audio/basic',
'tsi'  => 'audio/TSP-audio',
'wav'  => 'audio/x-wav',
// Text
'asc'  => 'text/plain',
'c'    => 'text/plain',
'cc'   => 'text/plain',
'css'  => 'text/css',
'etx'  => 'text/x-setext',
'f'    => 'text/plain',
'f90'  => 'text/plain',
'h'    => 'text/plain',
'hh'   => 'text/plain',
'htm'  => 'text/html',
'html' => 'text/html',
'js'   => 'text/javascript',
'm'    => 'text/plain',
'rtf'  => 'text/rtf',
'rtx'  => 'text/richtext',
'sgm'  => 'text/sgml',
'sgml' => 'text/sgml',
'tsv'  => 'text/tab-separated-values',
'tpl'  => 'text/template',
'txt'  => 'text/plain',
'xml'  => 'text/xml',
// Video
'avi'   => array('video/x-msvideo', 'video/avi'),
'asf'    => 'video/x-ms-asf',
'divx'    => 'video/divx',
'fli'   => 'video/x-fli',
'mkv'    => 'video/divx',
'mov'   => 'video/quicktime',
'movie' => 'video/x-sgi-movie',
'mpe'   => 'video/mpeg',
'mpeg'  => 'video/mpeg',
'mpg'   => 'video/mpeg',
'qt'    => 'video/quicktime',
'viv'   => 'video/vnd.vivo',
'vivo'  => 'video/vnd.vivo',
'wmv'   => 'video/x-ms-wmv',
// Image
'gif'  => 'image/gif',
'ief'  => 'image/ief',
'jpe'  => array('image/jpeg', 'image/pjpeg'),
'jpeg' => array('image/jpeg', 'image/pjpeg'),
'jpg'  => array('image/jpeg', 'image/pjpeg'),
'pbm'  => 'image/x-portable-bitmap',
'pgm'  => 'image/x-portable-graymap',
'png'  => array('image/png', 'image/x-png'),
'pnm'  => 'image/x-portable-anymap',
'ppm'  => 'image/x-portable-pixmap',
'ras'  => 'image/cmu-raster',
'rgb'  => 'image/x-rgb',
'tif'  => 'image/tiff',
'tiff' => 'image/tiff',
'xbm'  => 'image/x-xbitmap',
'xpm'  => 'image/x-xpixmap',
'xwd'  => 'image/x-xwindowdump',
// X-Conference
'ice' => 'x-conference/x-cooltalk',
// Model
'iges' => 'model/iges',
'igs'  => 'model/iges',
'mesh' => 'model/mesh',
'msh'  => 'model/mesh',
'silo' => 'model/mesh',
'vrml' => 'model/vrml',
'wrl'  => 'model/vrml',
// WWW
'mime' => 'www/mime',
// Chemical
'pdb' => 'chemical/x-pdb',
'xyz' => 'chemical/x-pdb');

$modul = $_GET[request];

$mime_types = mysql_query("SELECT * FROM mime_types WHERE modul='$modul' ORDER BY 'mimetype' ASC");

while($result = mysql_fetch_array($mime_types)) {
unset($extensions);

$mimetype = $result[mimetype];
$name = $result[name];

foreach($types as $key => $value) {

if(is_array($value) && in_array($mimetype,$value)) $extensions[] = "*.".$key;
if(!is_array($value) && $mimetype == $value) $extensions[] = "*.".$key;

}

if(count($extensions) > 0) sort($extensions);

$output .= "<tr bgcolor=\"#FAFAFA\" valign=\"top\"><td>$mimetype</td><td>".@implode(" ", $extensions)."</td><td>$name</td></tr>";

}

print tplprint(tplload("templates/mimetypes.html",FALSE),array(
"COMMUNITY_NAME" => $community_name,
"OUTPUT" => $output));
exit();

?>
__________________

Ge?ndert von Stifler (21.10.2011 um 12:53 Uhr)
Stifler ist offline   Mit Zitat antworten Nach oben
Alt 21.10.2011, 12:59   #2
Castor
Erfahrener Benutzer
Punkte: 4.185, Level: 41 Punkte: 4.185, Level: 41 Punkte: 4.185, Level: 41
Levelaufstieg: 18% Levelaufstieg: 18% Levelaufstieg: 18%
Aktivität: 0% Aktivität: 0% Aktivität: 0%
Letzte Erfolge
 
Benutzerbild von Castor
 
Registriert seit: 15.08.2008
Beitr?ge: 179
Abgegebene Danke: 124
Erhielt 0 Danke für 0 Beiträge
Downloads: 18
Uploads: 0
Nachrichten: 6
Renommee-Modifikator:
197 Castor befindet sich auf einem aufstrebenden Ast
Standard

Der Upload von .css, .php, .js etc. klappt bei uns nicht via Bitbucket/PicHoster.
Also muss es ne andere lücke geben.

Der Vogel war noch so frech das ganze in der Shout anzukündigen

LG Castor
__________________

Castor ist offline   Mit Zitat antworten Nach oben
Antwort


Aktive Benutzer in diesem Thema: 1 (Registrierte Benutzer: 0, G?ste: 1)
 

Forumregeln
Es ist Ihnen nicht erlaubt, neue Themen zu verfassen.
Es ist Ihnen nicht erlaubt, auf Beitr?ge zu antworten.
Es ist Ihnen nicht erlaubt, Anh?nge hochzuladen.
Es ist Ihnen nicht erlaubt, Ihre Beitr?ge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.

Gehe zu


Alle Zeitangaben in WEZ +1. Es ist jetzt 09:26 Uhr.


Powered by vBulletin® Version 3.8.9 (Deutsch)
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
Template-Modifikationen durch TMS