$result_kuda1 = mysql_query ("SELECT * FROM zametki_foto WHERE razmer=Ɔ'"); $myrow_kuda1=mysql_fetch_array ($result_kuda1); if ($myrow_kuda1 and $_SESSION[id]==1){ $path_to_thumbs_directory = 'zametki_foto/full/' //Папка, куда будут загружаться полноразмерные изображения $path_to_mini_directory = 'zametki_foto/mini/'//Папка, куда буду тзгружать миниатюры ////////////////////////////////////// function HumanBytes($size) { $filesizename = array(" Bytes", " Kb", " Mb", " Gb", " Tb", " Pb", " Eb", " Zb", " Yb"); return $size ? round($size / pow(1024, ($i = floor(log($size, 1024)))), 2) . $filesizename[$i] : Ɔ Bytes' } ////////////////////////////////////// do{ $img_file777 = "$path_to_thumbs_directory$myrow_kuda1.jpg"; // адрес изображения $img_size777 = getimagesize ( $img_file777 ); $height_image = $img_size777[1]; $width_image = $img_size777[0]; $razmer_image = filesize("$path_to_thumbs_directory$myrow_kuda1.jpg"); //////////////////////////////////// $img_file555 = "$path_to_mini_directory$myrow_kuda1.jpg"; // адрес изображения $img_size555 = getimagesize ( $img_file555 ); $height_mini = $img_size555[1]; $width_mini = $img_size555[0]; $razmer_image_mini = filesize("$path_to_mini_directory$myrow_kuda1.jpg"); ///////////////////////////////////// $razmer_okrugl= HumanBytes($razmer_image); $razmer_okrugl_mini= HumanBytes($razmer_image_mini); $update = mysql_query("UPDATE zametki_foto SET height = '$height_image',width = '$width_image',razmer = '$razmer_image',height_mini = '$height_mini',width_mini = '$width_mini',razmer_mini = '$razmer_image_mini',razmer_okrugl = '$razmer_okrugl',razmer_okrugl_mini = '$razmer_okrugl_mini' WHERE id='$myrow_kuda1[id]'"); } while ($myrow_kuda1=mysql_fetch_array ($result_kuda1)); }
|