Home | Community | Message Board


SporeworksPlease support our sponsors.

Community >> Science and Technology

Welcome to the Shroomery Message Board! Please login or register to post messages and view our members-only content. You'll gain access to additional forums, encrypted messages, file attachments, board customizations, and much more!

Pages: 1
OfflinestefanM
work in progress


Registered: 04/11/01
Posts: 7,813
Loc: The Netherlands
Last seen: 1 day, 15 hours
need a picture upload script, like the one on the shroomery
    #8391703 - 05/12/08 05:55 AM (4 months, 23 days 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?


--------------------
my music (myspace) -->

psytrance. chillout.


Post Extras: Print Post  Remind Me!  Notify Moderator    
OfflineAnnoA
Experimenter
 User Gallery


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



--------------------
The Rich Jerk
Grow Mushrooms from Spores - PF-Tek for Simple Minds


Post Extras: Print Post  Remind Me!  Notify Moderator    
InvisibleArp
roving mycophagist
 User Gallery


Registered: 04/20/98
Posts: 2,101
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 (4 months, 23 days 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>';



}

}



Post Extras: Print Post  Remind Me!  Notify Moderator   Ignore User 
Onlinesupra
enthusiast
Registered: 10/26/03
Posts: 3,403
Loc: TEXAS
Last seen: 1 minute, 56 seconds
Re: need a picture upload script, like the one on the shroomery [Re: stefan]
    #8397934 - 05/13/08 06:44 PM (4 months, 22 days ago)

a good site for lots of code snippets and tips

http://code.google.com/

peace


Post Extras: Print Post  Remind Me!  Notify Moderator   Ignore User 
OfflinestefanM
work in progress


Registered: 04/11/01
Posts: 7,813
Loc: The Netherlands
Last seen: 1 day, 15 hours
Re: need a picture upload script, like the one on the shroomery [Re: supra]
    #8400000 - 05/14/08 08:12 AM (4 months, 21 days ago)

thanks you all:thumbup:


--------------------
my music (myspace) -->

psytrance. chillout.


Post Extras: Print Post  Remind Me!  Notify Moderator    
Jump to top. Pages: 1

Community >> Science and Technology

Similar ThreadsPosterViewsRepliesLast post
* Timing out with big uploads... Dunno why
Hello
127 3 08/27/07 07:34 AM
by Seuss
* linux shell script help
OJK
341 7 05/23/06 12:21 PM
by OJK
* Picture upload question
Sterile
347 4 04/02/07 04:47 PM
by Sterile
* putting images on the shroomery?
exclusive58
103 4 09/13/04 02:12 PM
by exclusive58
* What powers your Shroomery experience?
( 1 2 all )
jdirty
795 26 04/18/07 07:04 PM
by RuNE
* uploading mp3 on the shroomery
Sterile
126 2 02/13/05 09:39 PM
by Sterile
* uploading video .avi files onto shroomery
Banez
224 2 08/27/06 01:08 PM
by Banez
* Shroomery security concern
Elektrolurch
694 2 11/13/01 05:32 AM
by Elektrolurch

Extra information
You cannot start new topics / You cannot reply to topics
HTML is disabled / UBBCode is enabled
Moderator:  Lana, Diploid, automan 
256 topic views. 2 registered and 1 anonymous users are browsing this forum.
[ Toggle Favorite | Print Topic ]

del.icio.us del.icio.us Digg digg Furl Furl MyWeb MyWeb Reddit reddit StumbleUpon StumbleUpon
Search this thread:
SporeworksPlease support our sponsors.

Copyright 1997-2008 Mind Media. Some rights reserved.

Generated in 0.103 seconds spending 0.053 seconds on 16 queries.