Home | Community | Message Board


This site includes paid links. Please support our sponsors.


Welcome to the Shroomery Message Board! You are experiencing a small sample of what the site has to offer. Please login or register to post messages and view our exclusive members-only content. You'll gain access to additional forums, file attachments, board customizations, encrypted private messages, and much more!

Shop: Myyco.com Golden Teacher Liquid Culture For Sale   Kraken Kratom Red Vein Kratom

Jump to first unread post Pages: 1
Offlinestefan
work in progress


Registered: 04/11/01
Posts: 8,932
Loc: The Netherlands
Last seen: 3 years, 6 months
need a picture upload script, like the one on the shroomery
    #8391703 - 05/12/08 05:55 AM (15 years, 11 months ago)

only 1 image at a time is enough. it would be nice if it makes automatic thumbnails, or other resize something. we use an sql database if anyone wants to know

any suggestions where to find good code snippets?

Extras: Filter Print Post Top
OfflineAnnoA
Experimenter
 User Gallery


Folding@home Statistics
Registered: 06/17/99
Posts: 24,166
Loc: my room
Last seen: 4 days, 17 hours
Re: need a picture upload script, like the one on the shroomery [Re: stefan]
    #8392061 - 05/12/08 09:59 AM (15 years, 11 months ago)


Extras: Filter Print Post Top
InvisibleArp
roving mycophagist
 User Gallery


Registered: 04/20/98
Posts: 2,191
Loc: in a van by the river
Re: need a picture upload script, like the one on the shroomery [Re: Anno]
    #8392088 - 05/12/08 10:08 AM (15 years, 11 months ago)

should contain what you need. just play around with it or something

Code:
function changeavatar($info) {


if ($_POST['imgpost']) {


/*echo $_FILES['picture']['name'];*/



$allowed_types = array(
'image/gif',
'image/jpeg');

if(in_array($_FILES['picture']['type'], $allowed_types)) {

list($width, $height) = getimagesize($_FILES['picture']['tmp_name']);



if ($_FILES['picture']['type']=='image/jpeg')
$image = imagecreatefromjpeg($_FILES['picture']['tmp_name']);
else
$image = imagecreatefromgif($_FILES['picture']['tmp_name']);


/* if ($this->width && ($width_orig < $height_orig)) {
$this->width = ($this->height / $height_orig) * $width_orig;
} else {
$this->height = ($this->width / $width_orig) * $height_orig;
}
*/

$newheight = (160 / $width) * $height;

$image_p = imagecreatetruecolor(160, $newheight);
imagecopyresampled($image_p, $image, 0, 0, 0, 0, 160, $newheight, $width, $height);
imagejpeg($image_p,'avatar/'.$info['alias'].'_-_avatar.jpg', 80);

$image_p = imagecreatetruecolor(30, 30);

imagecopyresampled($image_p, $image, 0, 0, 0, 0, 30, 30, $width, $height);

imagejpeg($image_p,'avatar/'.$info['alias'].'_-_icon.jpg', 80);
/*imagejpeg($image,'avatar/'.$info['alias'].'_-_full.jpg', 80);
*/
echo 'Avatar uploaded successfully. (old avatar might appear due to cache)<br>';
/* echo '<img src="avatar/'.$info['alias'].'.jpg"><br><br>';*/

imagedestroy($image_p);
imagedestroy($image);

}


}


{
showavatar($info['alias'],"avatar");


echo '<br><br>Select & send your JPEG/GIF avatar';
echo '<form action="" method="post" enctype="multipart/form-data">;
<input type="file" name="picture">
<input name="imgpost" type="submit" value="Send">
</form>';



}

}


Extras: Filter Print Post Top
Offlinesupra
computerEnthusiast
Registered: 10/26/03
Posts: 6,446
Loc: TEXAS
Last seen: 12 years, 11 months
Re: need a picture upload script, like the one on the shroomery [Re: stefan]
    #8397934 - 05/13/08 06:44 PM (15 years, 11 months ago)

a good site for lots of code snippets and tips

http://code.google.com/

peace

Extras: Filter Print Post Top
Offlinestefan
work in progress


Registered: 04/11/01
Posts: 8,932
Loc: The Netherlands
Last seen: 3 years, 6 months
Re: need a picture upload script, like the one on the shroomery [Re: supra]
    #8400000 - 05/14/08 08:12 AM (15 years, 10 months ago)

thanks you all:thumbup:

Extras: Filter Print Post Top
Jump to top Pages: 1

Shop: Myyco.com Golden Teacher Liquid Culture For Sale   Kraken Kratom Red Vein Kratom


Similar ThreadsPosterViewsRepliesLast post
* Reduce image file size quickly and very easily astralasia 1,540 11 08/07/04 08:21 AM
by Anno
* putting images on the shroomery? exclusive58 572 4 09/13/04 02:12 PM
by exclusive58
* How do I Rip individual JPEG/GIF Clips from an MPEG or AVI PsillyNilly 1,287 10 04/24/05 02:58 PM
by OJK
* Shroomery security concern Elektrolurch 1,844 2 11/13/01 05:32 AM
by Elektrolurch
* Good php scripts? Murex 572 1 01/14/04 06:19 PM
by nife
* Scripting Languages: Ruby vs. Python Evolving 1,178 8 02/14/04 08:57 PM
by djfrog
* FREE ASP SCRIPT SITES? Fliquid 836 5 09/23/03 09:31 AM
by Fliquid
* Suspicious Script: rollback.js question_for_joo 556 1 09/05/04 06:57 PM
by psyka

Extra information
You cannot start new topics / You cannot reply to topics
HTML is disabled / BBCode is enabled
Moderator: trendal, automan, Northerner
766 topic views. 0 members, 0 guests and 4 web crawlers are browsing this forum.
[ Show Images Only | Sort by Score | Print Topic ]
Search this thread:

Copyright 1997-2024 Mind Media. Some rights reserved.

Generated in 0.026 seconds spending 0.007 seconds on 14 queries.