"; exit(); } } if (!isset($action)) { //print '2003-06-18: Due to database failure. Some pics have been lost.

'; print 'Please upload your own pictures to Upptown Graffiti

'; print 'Read the rules first.
By uploading material you automatically accept them.'; print '
Provide as much information as possible.
Pics without any info are likely to be deleted...


'; print ''; print ''; print ''; print ''; print ''; print '
'; print '
'; print ' Writer:
Country: '; print ''; print ' '; print '
Category: '; print ''; print '
City:
Information: '; print '
'; print '.jpg\'s only
'; print ''; print '
'; } else { print "Uploading photo

"; if($name == "") $name = substr ($image_name, 0, (strlen($image_name)-4)); $name = strip_tags($name); $country = strip_tags($country); $city = strip_tags($city); $information = nl2br(strip_tags($information)); if(strlen($information) > 600) $text = substr($text, 0 , 1600); $date = (date("d/m-Y H:i")); print "Writer: $name from $city/$country"; //print "
ImageName: $image_name"; //print "
Type: $image_type"; // $typ is nore userfriendly $type = split("/", $image_type); // But keep both for convert command $typ = strtolower($type[1]); print "
typ: $typ"; //debugg print "
Size: $image_size Bytes"; //print "
image: $image

"; //debugg if ($image == "none") { echo("You must upload at least one file"); exit(); //? debugg? } else { $selectresult = mysql_query ("SELECT id FROM upload ORDER BY id"); if(!$selectresult) { echo "Select from upload for prcentfixs unsuccessful:
", mysql_error(); } else { $counter = 0; while ($row = mysql_fetch_array($selectresult)) { $counter++; $id = $row["id"]; } } $id += 1; //copy($image,"/www/upload/uploaded/$id.jpg"); copy($image,"/export/home/upptown/public_html/upload/uploaded/$id.jpg"); // if($typ != "jpeg" && $typ != "pjpeg" && $typ != "gif" && $typ != "x-ms-bmp" && $typ != "bmp" && $typ != "x-windows-bmp") { if($typ != "jpeg" && $typ != "pjpeg") { print "

Currently only JPG files are supported

"; /* print "not jpeg... Converting\n
"; system("mv uploaded/$id.jpg uploaded/$id.$typ"); if($typ == "bmp") { print "konverterar till \".bmp\"
"; system("convert uploaded/$id.$typ uploaded/$id.jpg"); system("rm uploaded/$id.$typ"); } */ } else { if($typ == "gif" && 0) { // Newakilles //print "Converting from \".gif\"
"; //$im = @ImageCreateFromGIF ($image); //Imagejpeg($im,'./test.jpg',20); //ImageDestroy($im); print "Converting from \".gif\"
"; system("mv uploaded/$id.jpg uploaded/$id.$typ"); system("/usr/local/bin/convert uploaded/$id.$typ uploaded/$id.jpg"); //system("rm uploaded/$id.$typ"); } if($typ == "x-ms-bmp" || $typ == "bmp" || $typ == "x-windows-bmp" && 0) { print "Converting from \".bmp\"
"; system("mv uploaded/$id.jpg uploaded/$id.$typ"); //Newakilles //system("/usr/local/bin/convert uploaded/$id.$typ uploaded/$id.jpg"); //system("rm uploaded/$id.$typ"); //Akilles // system("/usr/local/bin/bmptoppm uploaded/$id.typ | /usr/local/bin/ppmtojpeg > upladed/$id.jpg"); // $RRESULT = `/usr/local/bin/bmptoppm uploaded/$id.typ | /usr/local/bin/ppmtojpeg > uploaded/$id.jpg"`; $RRESULT = `/export/home/upptown/netpbm/bmptoppm uploaded/$id.typ | /export/home/upptown/netpbm/ppmtojpeg > uploaded/$id.jpg"`; print "Convert result: $RRESULT ."; //system("/usr/local/bin/bmptoppm uploaded/$id.$typ uploaded/$id.ppm"); //system("/usr/local/bin/ppmtojpeg uploaded/$id.ppm $id.jpg"); } //system("djpeg uploaded/$id.jpg > uploaded/tempfile2"); //system("pnmscale -height 70 uploaded/tempfile2 | cjpeg -smoo 10 -optimize -qual 95 > uploaded/$id-small.jpg"); //Newakilles //$infor = `djpeg uploaded/$id.jpg > uploaded/tempfile2`; //$infor .= `pnmscale -height 70 uploaded/tempfile2 | cjpeg -smoo 10 -optimize -qual 95 > uploaded/$id-small.jpg`; //$infor .= `rm uploaded/latest.jpg`; //$infor .= `ln -s $id.jpg uploaded/latest.jpg`; //Akilles $infor = `/usr/local/bin/djpeg uploaded/$id.jpg > uploaded/tempfile2`; $infor .= `/export/home/upptown/netpbm/pnmscale -height 70 uploaded/tempfile2 | /usr/local/bin/cjpeg -smoo 10 -optimize -qual 95 > uploaded/$id-small.jpg`; $infor .= `rm uploaded/latest.jpg`; $infor .= `ln -s $id.jpg uploaded/latest.jpg`; $infor .= `rm uploaded/latest-small.jpg`; $infor .= `ln -s $id-small.jpg uploaded/latest-small.jpg`; print "\n
Xtra info: $infor .\n
"; unlink($image); system("chmod a-x uploaded/*"); $insertresult = mysql_query ("INSERT INTO upload values('NULL','$name','$country','$city','$date','$REMOTE_ADDR','$information','$category')"); if(!$insertresult) { print "Insert Into pages:
" . mysql_error(); } else { print "

OK"; } print "
Upload successful."; ////mail("jb@material.uu.se", "[Upload] - $name", "$name \n $city/$country - $information \n\n $REMOTE_ADDR"); //mail("jb-gsm@material.uu.se", "UP - $name", "$city/$country - $information \n$REMOTE_ADDR"); $attachment = fread(fopen("uploaded/$id.jpg", "r"), filesize("uploaded/$id.jpg")); $mail = new mime_mail(); $mail->from = "upptown@darkface.pp.se"; $mail->headers = "Errors-To: jb@material.uu.se"; $mail->to = "jb@material.uu.se"; $mail->subject = "[Upload] - $name"; // made small change in class.email for html email. (text/plain -> text/html) $mail->body = "Writer: $name
Location: $city / $country
Category: $category
$information \n\n $REMOTE_ADDR. \n\n View - Admin - DELETE "; $mail->add_attachment("$attachment", "$id.jpg", "image/jpeg"); $mail->send(); # Tweet it tweet("New upload by $name: http://www.upptown.eu.org/upload/view.php3?id=$id "); print "

"; print "

"; } } } $counter = rekna(); $page = sprintf("%d", ($counter/20)); // Bad. PicsPerPage global would be better. print "View pictures in database ($counter)   Search the database   Random

"; ?>
There is only one rule:
1. I am not responsible for anything YOU upload. YOU are fully responsible.
Help:
Images should be in jpg (jpeg/pjpeg) format and have a size of no more than 500 pixels height and 1000 pixels width.
Max file-size is set to 150kb. But try to keep pictures at about 40-80kb.

The cookie is used to remeber what country you are from.