Hier kann eine Notiz zum Merk-Eintrag hinzugefügt werden (optional)
| [ Anmelden zum schreiben ] |
| Userpic & Avatar | |||
|---|---|---|---|
| sCar Mitglied
Posts: 157 |
Hi liebe Ilchler,
habe Forum durchstöbert aber nix gefunden wobei ich mir sicher bin dass es einen Post hierzu schon gibt, evtl kann mir jemand weiterhelfen.. Es geht um folgendes, ist es möglich bei avatarbild und userbild das jeweilige bild beim upload auf die festgesetzte Grösse zu formatieren? Also angenommen der Admin beschränkt die Bilder auf 100x100 und ein User ladet ein Bild mit dem Format von 250x250px up dass das script dieses bild in die vorgegebene Grösse umwandelt?! mfg scar verwendete ilchClan Version: 1.1 betroffene Homepage: www.atf-zone.de/index.php?news |
||
| GeCk0 Administrator
Posts: 2996 |
www.ilch.de/index.php?search=create_thumb&search_forum=1&search_texts=1&search_downloads=0&search_news=0&opt_own=0&opt_titel=0&opt_oldposts=0&sort_relevanz=1&sort_datum=0
bzw www.ilch.de/forum-showposts-39162.html#273688 Zuletzt modifiziert von GeCk0 am 22.09.2010 - 13:05:28 .:.Module, Zitate, 1-Klick-IMG-Host, MD5 und mehr.:. "Do not argue with an idiot. He will drag you down to his level and beat you with experience." |
||
| sCar Mitglied
Posts: 157 |
hi gecko danke für deine Hilfe, allerdings ist das nicht wirklich das was ich suche denn im forum ist die grösse bei mir längst festgesetzt.
Ich will das beim profiledit - upload das bild gleich umgewandelt wird Kriterien: max Breite 100px, max Höhe 100px und max size 1048576 bytes. sonst keine Aktion. fällt somit weg edit: zitat: hab das ganze auf der 1.2 Projectseite schon gepostet wo find ich die denn? xD muss ich nich hier was abändern? ich tippe ma auf zeile 13 und 14 ;D # avatar speichern START
$avatar_sql_update = '';
if ( !empty ( $_FILES['avatarfile']['name'] ) AND $allgAr['forum_avatar_upload'] ) {
$file_tmpe = $_FILES['avatarfile']['tmp_name'];
$rile_type = ic_mime_type ($_FILES['avatarfile']['tmp_name']);
$file_type = $_FILES['avatarfile']['type'];
$file_size = $_FILES['avatarfile']['size'];
$fmsg = $lang['avatarisnopicture'];
$size = @getimagesize ($file_tmpe);
$endar = array (1 => 'gif', 2 => 'jpg', 3 => 'png');
if ( ($size[2] == 1 OR $size[2] == 2 OR $size[2] == 3) AND $size[0] > 10 AND $size[1] > 10 AND substr ( $file_type , 0 , 6 ) == 'image/' AND substr ( $rile_type , 0 , 6 ) == 'image/' ) {
$endung = $endar[$size[2]];
$breite = $size[0];
$hoehe = $size[1];
$fmsg = $lang['avatarcannotupload'];
if ( $file_size <= $allgAr['Fasize'] AND $breite <= $allgAr['Fabreite'] AND $hoehe <= $allgAr['Fahohe'] ) {
$neuer_name = 'include/images/avatars/'.$_SESSION['authid'].'.'.$endung;
@unlink (db_result(db_query("SELECT avatar FROM prefix_user WHERE id = ".$_SESSION['authid']),0));
move_uploaded_file ( $file_tmpe , $neuer_name );
@chmod($neuer_name, 0777);
$avatar_sql_update = "avatar = '".$neuer_name."',";
$fmsg = $lang['pictureuploaded'];
}
}
} elseif ( isset($_POST['avatarloeschen']) ) {
$fmsg = $lang['picturedelete'];
@unlink (db_result(db_query("SELECT avatar FROM prefix_user WHERE id = ".$_SESSION['authid']),0));
$avatar_sql_update = "avatar = '',";
}
# avatar speichern ENDE
Zuletzt modifiziert von sCar am 22.09.2010 - 13:31:10 |
||
| Forengott Mitglied
Posts: 12 |
Zitat geschrieben von sCar
hi gecko danke für deine Hilfe, allerdings ist das nicht wirklich das was ich suche denn im forum ist die grösse bei mir längst festgesetzt. Ich will das beim profiledit - upload das bild gleich umgewandelt wird Kriterien: max Breite 100px, max Höhe 100px und max size 1048576 bytes. sonst keine Aktion. fällt somit weg edit: zitat: hab das ganze auf der 1.2 Projectseite schon gepostet wo find ich die denn? xD muss ich nich hier was abändern? ich tippe ma auf zeile 13 und 14 ;D # avatar speichern START
$avatar_sql_update = '';
if ( !empty ( $_FILES['avatarfile']['name'] ) AND $allgAr['forum_avatar_upload'] ) {
$file_tmpe = $_FILES['avatarfile']['tmp_name'];
$rile_type = ic_mime_type ($_FILES['avatarfile']['tmp_name']);
$file_type = $_FILES['avatarfile']['type'];
$file_size = $_FILES['avatarfile']['size'];
$fmsg = $lang['avatarisnopicture'];
$size = @getimagesize ($file_tmpe);
$endar = array (1 => 'gif', 2 => 'jpg', 3 => 'png');
if ( ($size[2] == 1 OR $size[2] == 2 OR $size[2] == 3) AND $size[0] > 10 AND $size[1] > 10 AND substr ( $file_type , 0 , 6 ) == 'image/' AND substr ( $rile_type , 0 , 6 ) == 'image/' ) {
$endung = $endar[$size[2]];
$breite = $size[0];
$hoehe = $size[1];
$fmsg = $lang['avatarcannotupload'];
if ( $file_size <= $allgAr['Fasize'] AND $breite <= $allgAr['Fabreite'] AND $hoehe <= $allgAr['Fahohe'] ) {
$neuer_name = 'include/images/avatars/'.$_SESSION['authid'].'.'.$endung;
@unlink (db_result(db_query("SELECT avatar FROM prefix_user WHERE id = ".$_SESSION['authid']),0));
move_uploaded_file ( $file_tmpe , $neuer_name );
@chmod($neuer_name, 0777);
$avatar_sql_update = "avatar = '".$neuer_name."',";
$fmsg = $lang['pictureuploaded'];
}
}
} elseif ( isset($_POST['avatarloeschen']) ) {
$fmsg = $lang['picturedelete'];
@unlink (db_result(db_query("SELECT avatar FROM prefix_user WHERE id = ".$_SESSION['authid']),0));
$avatar_sql_update = "avatar = '',";
}
# avatar speichern ENDE
Zuletzt modifiziert von sCar am 22.09.2010 - 13:31:10 Puh, da bin ich überfordert. Will den Thread aber mal pushen, weil es mich auch interessiert. www.home-bleaching.net |
||
| Lord|Schirmer Administrator
Posts: 4603 |
Da muss mit imagecopyresampled gearbeitet werden!
"In mir schlummert ein Genie, leider wacht es nicht auf!" my portfolio | my community | important link |
||
| [ Anmelden zum schreiben ] |