#!/usr/local/bin/perl
require "weblib.lib";
$cgi_lib'maxdata=512000;
$pictures="/home/todd/public_html/pictures/forum";
htmlopen("Upload a Picture for the Forums");
&ReadParse;
if($in{picture}){
	$fn=time;
	open(TMP,">/tmp/$fn");
	print TMP $in{picture};
	close(TMP);
	$picturename="jpeg:$pictures/$fn.jpg";
	system("/usr/bin/convert -geometry '640x640>' /tmp/$fn $picturename");
	print qq{<img src="http://TRConnection.com/pictures/forum/$fn.jpg" align="left">},
		qq{paste this BBcode into your message: <b>[img]http://TRConnection.com/pictures/forum/$fn.jpg[/img]</b>},
		qq{<br clear="left">\n};
}
print <<EOF;
To Upload your picture follow these instructions:
<ol>
<li>Use a photo that is already on your local computer. It will be reduced to a largest dimension of 640 pixels, so be sure the detail can be seen at that size.
<li>Browse to the picture using the "Browse" button below
<li>Click on the "Upload Picture"
<li>Note the BBcode and paste that into your message
</ol>
<form action="$weblib::URL" method="POST" enctype="multipart/form-data">
<input type="file" name="picture"><br>
<input type="submit" value="Upload Picture">
</form>
EOF
chdir $pictures;
opendir(DIR,".");
$count=0;
print qq{Back to <a href="http://forum.trconnection.com">The Forums</a>\n};
&htmlclose;
