NameSilo

Looking for a script [PHP]

Spacemail by SpaceshipSpacemail by Spaceship
Watch

Cooper

Established Member
Impact
2
Okay, I’m looking for a simple gallery script.
I need it to make auto thumbs, and when clicked opens full size in a new window. It also has to be easy to update (EG: Just upload a picture into the directory) Also, i want it to be simply included into a webpage.
I've looked at HotScrips but couldn't find anything and I’ve also tried Google =p

Any recommendations?
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
Last edited:
0
•••
Yeah thanks, that'd be great
 
0
•••
0
•••
Thanks so much. Is it okay if i edit the script a little bit?
 
0
•••
0
•••
Amnezia said:
how does your script create thumbnails??
Dang, It dont. Sorry PoorDoggie, cant use it. Thanks anyway :)
 
0
•••
Cooper said:
Dang, It dont. Sorry PoorDoggie, cant use it. Thanks anyway :)


i have one you can use it has an upload function and a thumbnail creator but it requires an sql database to keep track of the images uploaded
 
0
•••
That would be great. Thanks
 
0
•••
Cooper said:
That would be great. Thanks

i can't let it go for free, it took quite a few hours to make.

make me an offer, if its reasonalbe, il create you an install script and help you set it up.
 
0
•••
:(
*Has no Money*

Nevermind, thanks for the offer anyway
 
0
•••
0
•••
I could make it do the thumbnail thing, but I don't know how it would have to do it. How can I make a thumbnail of an image in php?

By the way - it is free to use, edit, and pass on as you please! :)
 
0
•••
I'd assume it has something to do with the gd_image library.
 
0
•••
0
•••
0
•••
PoorDoggie said:
I could make it do the thumbnail thing, but I don't know how it would have to do it. How can I make a thumbnail of an image in php?

By the way - it is free to use, edit, and pass on as you please! :)


PHP:
<?

function make_thumb($imageName){

	$imagePath = '../site_images/gallery/';
	$imageURL = $imagePath.$imageName;
	$thumbPath = '../site_images/gallery/thumbs/';
	$thumbName = 'tn_'.$imageName;
	$thumbURL = $thumbPath.$thumbName;
	$maxXY = 140;
	
	//read source file
	$sourceImage = imagecreatefromjpeg($imageURL);
	$sourceWidth = imagesx($sourceImage);
	$sourceHeight = imagesy($sourceImage);
	
	//determine dimensions
	if ($sourceWidth<$sourceHeight){
		$ratio = $sourceHeight/$maxXY;
		$thumbHeight=$maxXY;
		$thumbWidth = $sourceWidth/$ratio;
	}
	
	elseif ($sourceWidth>$sourceHeight){
		$ratio = $sourceWidth/$maxXY;
		$thumbWidth=$maxXY;
		$thumbHeight = $sourceHeight/$ratio;
	}
	
	elseif (($sourceWidth<$maxXY)&&(sourceHeight<$maxXY)){
        $thumbWidth=$sourceWidth;
		$thumbHeight =$sourceHeight;
    }

	else{ 
		$thumbWidth=$thumbHeight=$maxXY;
	}

	//create blank thumb
	$targetImage = imagecreatetruecolor($thumbWidth,$thumbHeight);

	//copy resized image into thumb
	imagecopyresampled($targetImage,$sourceImage,0,0,0,0,$thumbWidth,
	$thumbHeight,$sourceWidth,$sourceHeight);
	imagejpeg($targetImage, $thumbURL);

	return $thumbName;
}

?>

Im feeling generous today so here is a script i wrote to create thumbnails of jpgs. It should be pretty much self explanitory to those with a basic knowledge of php. Anyone may use it. If you can afford it a donation of a few nps would be welcomed.
 
0
•••
Dynadot — .com Registration $8.99Dynadot — .com Registration $8.99
Appraise.net

We're social

Unstoppable Domains
Domain Recover
DomainEasy — Live Options
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back