exit;
         }
     }
 }
 // END PHP Upload Slike u zavisnosti od gresaka - Error Handling ------------------------
 $photo = $first_value . "-" . $vreme . "." . $fileExt;
 // Postavljamo sliku u "uploads" folder koristeci move_uploaded_file() funkciju, ali pre toga proveravamo da li folder postoji
 if (!is_dir('../img/gallery')) {
     mkdir('../img/gallery');
 }
 // ------------- START Resizing i Croping funkcije za sliku ----------------
 $target_file = $fileTmpLoc;
 $resized_file = "../img/gallery/" . $first_value . "-" . $vreme . "." . $fileExt;
 $wmax = 1000;
 $hmax = 800;
 ak_img_resize($target_file, $resized_file, $wmax, $hmax, $fileExt);
 $target_file = $fileTmpLoc;
 $temp_file = "../img/gallery/mid_" . $first_value . "-" . $vreme . "." . $fileExt;
 $resized_file = "../img/gallery/thumb_" . $first_value . "-" . $vreme . "." . $fileExt;
 if ($ph_type == 1) {
     $wmax = 360;
     $hmax = 360;
 } elseif ($ph_type == 2) {
     $wmax = 551;
     $hmax = 551;
 } elseif ($ph_type == 3) {
     $wmax = 720;
     $hmax = 360;
 }
 create_nimage($target_file, $temp_file, $resized_file, $wmax, $hmax, $fileExt);
 if (file_exists($target_file)) {
Exemple #2
0
         foreach ($idpictures as $idpicture) {
             unlink(getPicturePath($idpicture)['path']);
         }
         updatePicture($_SESSION['username'], 'small', $filePathSmall);
         updatePicture($_SESSION['username'], 'medium', $filePathMedium);
         updatePicture($_SESSION['username'], 'large', $filePathLarge);
     }
     $wmaxsmall = 50;
     $hmaxsmall = 50;
     $wmaxmedium = 100;
     $hmaxmedium = 100;
     $wmaxlarge = 110;
     $hmaxlarge = 110;
     ak_img_resize($fileTmpPath, $filePathSmall, $wmaxsmall, $hmaxsmall, $extension);
     ak_img_resize($fileTmpPath, $filePathMedium, $wmaxmedium, $hmaxmedium, $extension);
     ak_img_resize($fileTmpPath, $filePathLarge, $wmaxlarge, $hmaxlarge, $extension);
     chmod($filePathSmall, 0644);
     chmod($filePathMedium, 0644);
     chmod($filePathLarge, 0644);
     unlink($fileTmpPath);
 } else {
     if ($_POST['email']) {
         updateUserInfo('email', $_POST['email'], $_SESSION['username']);
     } else {
         if ($_POST['username']) {
             updateUserInfo("username", $_POST['username'], $_SESSION['username']);
             $_SESSION['username'] = $_POST['username'];
         } else {
             if ($_POST['firstname']) {
                 updateUserInfo('firstname', $_POST['firstname'], $_SESSION['username']);
             } else {