Home | Community | Message Board


Sporeworks
Please 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
 Journal


Registered: 04/11/01
Posts: 7,763
Loc: The Netherlands
Last seen: 18 hours, 31 minutes
need a picture upload script, like the one on the shroomery
    #8391703 - 05/12/08 05:55 AM

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
 Journal User Gallery


Folding@home Statistics
Registered: 06/17/99
Posts: 23,932
Loc: my room
Last seen: 10 hours, 5 minutes
Re: need a picture upload script, like the one on the shroomery [Re: stefan]
    #8392061 - 05/12/08 09:59 AM



--------------------
The Rich Jerk
Shroomery CMS - Become an Editor!
PF-Tek for Simple Minds
Gobe


Post Extras: Print Post  Remind Me!  Notify Moderator    
InvisibleArp
rovingmycophagist
 Journal User Gallery


Registered: 04/20/98
Posts: 2,002
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

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: 2,861
Loc: TEXAS
Last seen: 5 minutes, 12 seconds
Re: need a picture upload script, like the one on the shroomery [Re: stefan]
    #8397934 - 05/13/08 06:44 PM

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
 Journal


Registered: 04/11/01
Posts: 7,763
Loc: The Netherlands
Last seen: 18 hours, 31 minutes
Re: need a picture upload script, like the one on the shroomery [Re: supra]
    #8400000 - 05/14/08 08:12 AM

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
113 3 08/27/07 07:34 AM
by Seuss
* linux shell script help
Odiumjunkie
320 7 05/23/06 12:21 PM
by Odiumjunkie
* Picture upload question
Sterile
327 4 04/02/07 04:47 PM
by Sterile
* putting images on the shroomery?
exclusive58
82 4 09/13/04 02:12 PM
by exclusive58
* What powers your Shroomery experience?
( 1 2 all )
jdirty
722 26 04/18/07 07:04 PM
by RuNE
* uploading video .avi files onto shroomery
BanezS
210 2 08/27/06 01:08 PM
by Banez
* uploading mp3 on the shroomery
Sterile
111 2 02/13/05 09:39 PM
by Sterile
* Shroomery security concern
Elektrolurch
658 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 
189 topic views. 1 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
High Mountain Compost
Please support our sponsors.

Copyright 1997-2008 Mind Media. Some rights reserved.

Generated in 0.045 seconds spending 0.031 seconds on 16 queries.