<?php
function more_images($datoteka,$pot,$tip,$image,$file){
	//
	switch($tip){		
		case "galerija":
			
			require_once $_SERVER['DOCUMENT_ROOT'].'/admin/sys/phpthumb/ThumbLib.inc.php';
			
			//full
			$source = $pot.$datoteka;
			$destination = $pot."full/".$datoteka;
			copy($source,$destination);
			
			//thumb
			$source = $pot.$datoteka;
			$destination = $pot."thumb/".$datoteka;			
			$thumb = PhpThumbFactory::create($source);
			$thumb->setOptions(
				array('jpegQuality'=> 90)
			);
			$thumb->adaptiveResize(80, 72);
			$thumb->save($destination);
			
			//thumb_up
			$source = $pot.$datoteka;
			$destination = $pot."thumb_up/".$datoteka;
			$image->createThumb_up($source,$destination,80,72);
			
			
			// 800
			$source = $pot.$datoteka;
			$destination = $pot."800/".$datoteka;
			$image->resize($source,$destination,800,'fixed_w');
			
			// 475
			$source = $pot.$datoteka;
			$destination = $pot."475/".$datoteka;
			$image->resize($source,$destination,475,'fixed_w');
			
			// 475x342
			$source = $pot.$datoteka;
			$destination = $pot."475x342/".$datoteka;
			$image->createCustom_1($source,$destination,475,342);
			
			// 475x342
			$source = $pot.$datoteka;
			$destination = $pot."475x342_up/".$datoteka;
			$image->createCustom_2($source,$destination,475,342);

			
		break;
	}
}
function odstrani_more_images($pot, $ime){
	//
	unlink($pot.$ime);
	unlink($pot."full/".$ime);
	unlink($pot."800/".$ime);
	unlink($pot."475/".$ime);
	unlink($pot."475x342/".$ime);
	unlink($pot."thumb/".$ime);
	unlink($pot."475x342_up/".$ime);
	unlink($pot."thumb_up/".$ime);
}
?>