150){ $new_height2 = floor(imagesy($source2)*(150/imagesx($source2))); $new_width2 = 150; } else{ $new_width2 = imagesx($source2); $new_height2 = imagesy($source2); } $dest2 = imagecreatetruecolor($new_width2,$new_height2); imagecopyresampled($dest2,$source2,0,0,0,0,$new_width2,$new_height2,imagesx($source2),imagesy($source2)); imagejpeg($dest2,"../o_images/min_".$ogl_id."_".$i.".jpg",50); imagedestroy($source2); imagedestroy($dest2); $source = imagecreatefromjpeg("../o_images/".$ogl_id."_".$i.".jpg"); if(imagesy($source)>400){ $new_height = 400; $new_width = floor(imagesx($source)*(400/imagesy($source))); } else{ $new_width = imagesx($source); $new_height = imagesy($source); } $dest = imagecreatetruecolor($new_width,$new_height); imagecopyresampled($dest,$source,0,0,0,0,$new_width,$new_height,imagesx($source),imagesy($source)); imagejpeg($dest,"../o_images/".$ogl_id."_".$i.".jpg",50); imagedestroy($source); imagedestroy($dest); } function zdjecia_user($zdjecie, $ogl_id, $i){ //copy ($zdjecie, "o_images/".$ogl_id."_".$i.".jpg"); move_uploaded_file($zdjecie, "o_images/".$ogl_id."_".$i.".jpg"); $source2 = imagecreatefromjpeg("o_images/".$ogl_id."_".$i.".jpg"); if(imagesy($source2)>150){ $new_height2 = floor(imagesy($source2)*(150/imagesx($source2))); $new_width2 = 150; } else{ $new_width2 = imagesx($source2); $new_height2 = imagesy($source2); } $dest2 = imagecreatetruecolor($new_width2,$new_height2); imagecopyresampled($dest2,$source2,0,0,0,0,$new_width2,$new_height2,imagesx($source2),imagesy($source2)); imagejpeg($dest2,"o_images/min_".$ogl_id."_".$i.".jpg",50); imagedestroy($source2); imagedestroy($dest2); $source = imagecreatefromjpeg("o_images/".$ogl_id."_".$i.".jpg"); if(imagesy($source)>400){ $new_height = 400; $new_width = floor(imagesx($source)*(400/imagesy($source))); } else{ $new_width = imagesx($source); $new_height = imagesy($source); } $dest = imagecreatetruecolor($new_width,$new_height); imagecopyresampled($dest,$source,0,0,0,0,$new_width,$new_height,imagesx($source),imagesy($source)); imagejpeg($dest,"o_images/".$ogl_id."_".$i.".jpg",50); imagedestroy($source); imagedestroy($dest); } function tytul($tytul){ $s_len=strlen($tytul); if (strlen($tytul) > 25){ for ($i=0;$i<25;$i++){ $new_t=$tytul[$i]; echo $new_t; } echo' ...'; } else echo $tytul; } function tytul_ogl($str){ $str=str_replace(" ","_",$str); $str=str_replace("","a",$str); $str=str_replace("","c",$str); $str=str_replace("","e",$str); $str=str_replace("","l",$str); $str=str_replace("","n",$str); $str=str_replace("","o",$str); $str=str_replace("","s",$str); $str=str_replace("","z",$str); $str=str_replace("","z",$str); $str=str_replace("","A",$str); $str=str_replace("","C",$str); $str=str_replace("","E",$str); $str=str_replace("","L",$str); $str=str_replace("","N",$str); $str=str_replace("","O",$str); $str=str_replace("","S",$str); $str=str_replace("","Z",$str); $str=str_replace("","Z",$str); $str = strtolower($str); $str = preg_replace('/[^a-z0-9_]/', '', $str); return $str; } ?>